fix problem that inactive provider of running application isn't updated when lang...
authorjungmin76.park <jungmin76.park@samsung.com>
Thu, 10 Oct 2013 09:03:24 +0000 (18:03 +0900)
committerjungmin76.park <jungmin76.park@samsung.com>
Thu, 10 Oct 2013 10:53:09 +0000 (19:53 +0900)
Change-Id: I43498da55c9153bbd41cab5292d33cb6e7b6ba95
Signed-off-by: jungmin76.park <jungmin76.park@samsung.com>
inc/FShell_AppContext.h
inc/FShell_AppWidgetContext.h
inc/FShell_AppWidgetManagerService.h
src/FShell_AppContext.cpp
src/FShell_AppWidgetContext.cpp
src/FShell_AppWidgetManagerService.cpp

index f4df21dc13d4399797d64578b1261ca3edfb0aab..dd6b05bee76685d31c147a8a122c8df2702ebf5d 100644 (file)
@@ -72,6 +72,7 @@ public:
        result OnAppWidgetForegroundAll(void);
 
        result RequestUpdate(const Tizen::Base::String& providerName, const Tizen::Base::String& argument);
+       result RequestUpdateAllInactiveted(void);
        result SendRequestToApp(const Tizen::App::AppId& providerAppId, const Tizen::Base::String& operation, Tizen::Base::Collection::HashMap* pArgs);
        result SendPendingEvent(void);
 
index 49a2d4874ec722326a5f0d8d09007c42c40f575c..3ded99f5e6a8874f024516467390ee4ce01a367b 100644 (file)
@@ -105,6 +105,7 @@ public:
        int GetWidth(void) const;
        int GetHeight(void) const;
        int GetPriority(void) const;
+       bool IsActive(void) const;
 
 private:
        result SendAddRequest(int width, int height) const;
index e1f54118d6563faee2b1d07f0f70733ed8807fec..988e5695b46b45254974618ccbe5af2273dab636 100644 (file)
@@ -111,7 +111,7 @@ private:
        _AppWidgetContext* FindAppWidget(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId) const;
        void StartPingTimer(void);
        virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
-       result RequestUpdateAllSuspened(void) const;
+       result RequestUpdateAllInactiveted(void) const;
        static void InitSingleton(void);
        static void DestroySingleton(void);
        static bool SetSettingEventListener(Tizen::System::ISettingEventListener& listener);
index 5331e3eadf9a71b62a046a17db46111062b2e099..e30e2e035c21477e8ee8cd0dfa0b70c7361ad991 100644 (file)
@@ -405,8 +405,8 @@ _AppContext::GetProviderCount(void) const
 result
 _AppContext::RequestUpdate(const Tizen::Base::String& providerName, const Tizen::Base::String& argument)
 {
+       SysLog(NID_SHELL, "Enter.");
        bool found = false;
-       bool requestToAll = providerName.IsEmpty();
 
        unique_ptr< IMapEnumeratorT<String, _AppWidgetContext*> > pAppWidgetContextEnum(__appWidgetContextList.GetMapEnumeratorN());
        SysTryReturnResult(NID_SHELL, pAppWidgetContextEnum, E_SYSTEM, "Failed to invoke __appWidgetContextList.GetMapEnumeratorN()");
@@ -416,7 +416,7 @@ _AppContext::RequestUpdate(const Tizen::Base::String& providerName, const Tizen:
                _AppWidgetContext* pAppWidgetContext = null;
                pAppWidgetContextEnum->GetValue(pAppWidgetContext);
 
-               if (pAppWidgetContext->GetProviderName() == providerName || requestToAll == true)
+               if (pAppWidgetContext->GetProviderName() == providerName)
                {
                        pAppWidgetContext->OnUpdateAsync(this, argument);
                        found = true;
@@ -427,6 +427,28 @@ _AppContext::RequestUpdate(const Tizen::Base::String& providerName, const Tizen:
        return (found) ? E_SUCCESS : E_OBJ_NOT_FOUND;
 }
 
+result
+_AppContext::RequestUpdateAllInactiveted(void)
+{
+       SysLog(NID_SHELL, "Exit.");
+       unique_ptr< IMapEnumeratorT<String, _AppWidgetContext*> > pAppWidgetContextEnum(__appWidgetContextList.GetMapEnumeratorN());
+       SysTryReturnResult(NID_SHELL, pAppWidgetContextEnum, E_SYSTEM, "Failed to invoke __appWidgetContextList.GetMapEnumeratorN()");
+
+       while (pAppWidgetContextEnum->MoveNext() == E_SUCCESS)
+       {
+               _AppWidgetContext* pAppWidgetContext = null;
+               pAppWidgetContextEnum->GetValue(pAppWidgetContext);
+
+               if (pAppWidgetContext->IsActive() == false)
+               {
+                       pAppWidgetContext->OnUpdateAsync(this, L"");
+               }
+       }
+
+       SysLog(NID_SHELL, "Exit.");
+       return E_SUCCESS;
+}
+
 result
 _AppContext::OnAppWidgetBackground(const Tizen::Base::String& instanceId)
 {
index 034348c033c11f3ca365e604b034a90e537a0605..bb451e63617d69733188fec7e7731817790d20db 100644 (file)
@@ -540,6 +540,12 @@ _AppWidgetContext::GetInstanceId(void) const
        return __instanceId;
 }
 
+bool
+_AppWidgetContext::IsActive(void) const
+{
+       return __isRemoteBufferProxyCreated;
+}
+
 void
 _AppWidgetContext::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
 {
index ef54c8c3dc1e7925347798f42dab36f12fb0f6ca..954148151acd9a6b9a0bffed8dcf0679e6bb29b2 100644 (file)
@@ -291,7 +291,7 @@ AppWidgetManagerService::OnSettingChanged(Tizen::Base::String& key)
                || key == KEY_SETTING_COUNTRY )
        {
                SysLog(NID_SHELL, "'%ls' is changed.", key.GetPointer() );
-               RequestUpdateAllSuspened();
+               RequestUpdateAllInactiveted();
        }
 }
 
@@ -606,8 +606,9 @@ AppWidgetManagerService::RequestUpdate(const Tizen::App::AppId& appId, const Tiz
 }
 
 result
-AppWidgetManagerService::RequestUpdateAllSuspened(void) const
+AppWidgetManagerService::RequestUpdateAllInactiveted(void) const
 {
+       SysLog(NID_SHELL, "Enter.");
        unique_ptr< IMapEnumeratorT<String, _AppContext*> > pAppContextEnum(__appContextList.GetMapEnumeratorN());
        SysTryReturnResult(NID_SHELL, pAppContextEnum, E_SYSTEM, "Failed to invoke __appContextList.GetMapEnumeratorN()");
 
@@ -616,9 +617,9 @@ AppWidgetManagerService::RequestUpdateAllSuspened(void) const
                _AppContext* pAppContext = null;
                pAppContextEnum->GetValue(pAppContext);
 
-               if ( pAppContext && _AppManagerImpl::GetInstance()->IsRunning(pAppContext->GetAppId()) == false )
+               if (pAppContext)
                {
-                       pAppContext->RequestUpdate(L"", L"");
+                       pAppContext->RequestUpdateAllInactiveted();
                }
        }