Accounts application crash fix when launched from settings if privacy is turned off 67/14667/1 tizen
authorVinay Sachdeva <v.sachdeva@samsung.com>
Thu, 9 Jan 2014 19:44:34 +0000 (01:14 +0530)
committerVinay Sachdeva <v.sachdeva@samsung.com>
Thu, 9 Jan 2014 19:44:34 +0000 (01:14 +0530)
Change-Id: I7c425e3380dc638ddbe6df73f23bffbe0ceceb6b
Signed-off-by: Vinay Sachdeva <v.sachdeva@samsung.com>
inc/AccAccountApp.h
src/AccAccountApp.cpp

index 2c3d57b..f2d0bd7 100644 (file)
@@ -25,7 +25,8 @@
 #include <FApp.h>
 
 class AccountApp
-       : public Tizen::App::UiApp
+       : public Tizen::App::UiApp,
+       public Tizen::App::IAppControlProviderEventListener
 {
 public:
        AccountApp(void);
@@ -37,6 +38,9 @@ public:
        virtual void OnForeground(void);
 
        static Tizen::App::UiApp* CreateInstance(void);
+
+       virtual void    OnAppControlRequestReceived (RequestId reqId, const Tizen::Base::String &operationId, const Tizen::Base::String *pUriData, const Tizen::Base::String *pMimeType, const Tizen::Base::Collection::IMap *pExtraData);
+
 };
 
 #endif // _ACC_ACCOUNT_APP_H_
index 68ea81f..50b3fad 100644 (file)
@@ -20,6 +20,8 @@
  */
 
 #include <FApp.h>
+#include <FBase.h>
+#include <FSocial.h>
 #include <FUi.h>
 #include "AccAccountApp.h"
 #include "AccMainForm.h"
 #include "AppResourceId.h"
 #include "AccAccountPresentationModel.h"
 
+
 using namespace Tizen::App;
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Social;
 using namespace Tizen::Ui::Controls;
 
 AccountApp::AccountApp(void)
@@ -47,12 +53,23 @@ AccountApp::CreateInstance(void)
 bool
 AccountApp::OnAppInitializing(Tizen::App::AppRegistry& appRegistry)
 {
+       AppControlProviderManager::GetInstance()->SetAppControlProviderEventListener(this);
        return true;
 }
 
 bool
 AccountApp::OnAppInitialized(void)
 {
+
+       AccountAccessor* pAccountAccessor = AccountAccessor::GetInstance();
+       IList* pAccountList = pAccountAccessor->GetAllAccountsN();
+       if (pAccountList == null)
+       {
+               return false;
+       }
+       pAccountList->RemoveAll(true);
+       delete pAccountList;
+
        MainFrame* pAccountFrame = new (std::nothrow) MainFrame();
        pAccountFrame->Construct();
        AddFrame(*pAccountFrame);
@@ -74,3 +91,19 @@ AccountApp::OnForeground(void)
        TryReturnVoid(pCurrentForm, "There is no current form.");
        pCurrentForm->SendUserEvent(0, null);
 }
+void
+AccountApp::OnAppControlRequestReceived (RequestId reqId, const Tizen::Base::String &operationId, const Tizen::Base::String *pUriData, const Tizen::Base::String *pMimeType, const Tizen::Base::Collection::IMap *pExtraData)
+{
+       AppLog("AccountApp::OnAppControlRequestReceived called");
+       AccountAccessor* pAccountAccessor = AccountAccessor::GetInstance();
+       IList* pAccountList = pAccountAccessor->GetAllAccountsN();
+       if (pAccountList == null)
+       {
+               AppControlProviderManager::GetInstance()->SendAppControlResult(reqId,APP_CTRL_RESULT_TERMINATED,null);
+       }
+       else
+       {
+               pAccountList->RemoveAll(true);
+               delete pAccountList;
+       }
+}