From: jungmin76.park Date: Thu, 10 Oct 2013 09:03:24 +0000 (+0900) Subject: fix problem that inactive provider of running application isn't updated when lang... X-Git-Tag: accepted/tizen/20131018.123424~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=021a6c8cbb412a6cf11133300b4882204ea169eb;p=platform%2Fframework%2Fnative%2Fappwidget-service.git fix problem that inactive provider of running application isn't updated when lang/font setting is changed [P131010-00642] Change-Id: I43498da55c9153bbd41cab5292d33cb6e7b6ba95 Signed-off-by: jungmin76.park --- diff --git a/inc/FShell_AppContext.h b/inc/FShell_AppContext.h index f4df21d..dd6b05b 100644 --- a/inc/FShell_AppContext.h +++ b/inc/FShell_AppContext.h @@ -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); diff --git a/inc/FShell_AppWidgetContext.h b/inc/FShell_AppWidgetContext.h index 49a2d48..3ded99f 100644 --- a/inc/FShell_AppWidgetContext.h +++ b/inc/FShell_AppWidgetContext.h @@ -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; diff --git a/inc/FShell_AppWidgetManagerService.h b/inc/FShell_AppWidgetManagerService.h index e1f5411..988e569 100644 --- a/inc/FShell_AppWidgetManagerService.h +++ b/inc/FShell_AppWidgetManagerService.h @@ -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); diff --git a/src/FShell_AppContext.cpp b/src/FShell_AppContext.cpp index 5331e3e..e30e2e0 100644 --- a/src/FShell_AppContext.cpp +++ b/src/FShell_AppContext.cpp @@ -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 > 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 > 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) { diff --git a/src/FShell_AppWidgetContext.cpp b/src/FShell_AppWidgetContext.cpp index 034348c..bb451e6 100644 --- a/src/FShell_AppWidgetContext.cpp +++ b/src/FShell_AppWidgetContext.cpp @@ -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) { diff --git a/src/FShell_AppWidgetManagerService.cpp b/src/FShell_AppWidgetManagerService.cpp index ef54c8c..9541481 100644 --- a/src/FShell_AppWidgetManagerService.cpp +++ b/src/FShell_AppWidgetManagerService.cpp @@ -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 > 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(); } }