From: jungmin76.park Date: Tue, 4 Jun 2013 00:10:11 +0000 (+0900) Subject: fix privilege error for shortcut, and add filter code (livebox_service_nodisplay) X-Git-Tag: accepted/tizen/20130912.150013^2~80^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1e1adbefd1c2e0e9bbddfebdb69dfd6de95042a4;p=platform%2Fframework%2Fnative%2Fshell.git fix privilege error for shortcut, and add filter code (livebox_service_nodisplay) Change-Id: I0872b598e9a7d809b004381dffeb15fbb85a63b6 Signed-off-by: jungmin76.park --- diff --git a/inc/FShellShortcutManager.h b/inc/FShellShortcutManager.h index 840d37f..a4870ac 100644 --- a/inc/FShellShortcutManager.h +++ b/inc/FShellShortcutManager.h @@ -114,7 +114,7 @@ public: * * @since 2.1 * @privlevel public - * @privilege %http://tizen.org/privilege/shortcut + * @privilege %http://tizen.org/privilege/shortcut.install * * @return An error code * @param[in] appId The application ID diff --git a/src/FShell_AppWidgetManagerImpl.cpp b/src/FShell_AppWidgetManagerImpl.cpp index 3685b6a..4f4909d 100644 --- a/src/FShell_AppWidgetManagerImpl.cpp +++ b/src/FShell_AppWidgetManagerImpl.cpp @@ -104,20 +104,25 @@ _AppWidgetManagerImpl::Construct() } // c style callback for livebox_service_get_pkglist -int GetAppWidgetProviderInfoCallback(const char *pPackageId, const char *pProviderId, int is_prime, void *data) +int GetAppWidgetProviderInfoCallback(const char *pPackageId, const char *pProviderId, int isPrimary, void *pData) { - SysLog(NID_SHELL, "%s, %s, is_prime(%d)", pPackageId, pProviderId, is_prime); + int isHidden = livebox_service_nodisplay(pProviderId); + TryReturn(isHidden == 0, 0, "[E_SUCCESS] livebox_service_nodisplay returns true."); - IList* pAppWidgetProviderInfos = static_cast(data); - SysTryReturn(NID_SHELL, pAppWidgetProviderInfos, 0, E_SYSTEM, "[E_SYSTEM] system error."); + SysLog(NID_SHELL, "%s, %s, isPrimary(%d)", pPackageId, pProviderId, isPrimary); + + IList* pAppWidgetProviderInfos = static_cast(pData); + SysTryReturn(NID_SHELL, pAppWidgetProviderInfos, 0, E_SYSTEM, "[E_SYSTEM] pData should be not null!"); String providerId(pProviderId); String appId; String providerName; _AppWidgetManagerImpl::ExtractAppIdAndProviderName(providerId, appId, providerName); - AppWidgetProviderInfo* pInfo = _AppWidgetProviderInfoImpl::GetAppWidgetProviderInfoN(appId, providerName, is_prime); - pAppWidgetProviderInfos->Add(*pInfo); + std::unique_ptr pInfo( _AppWidgetProviderInfoImpl::GetAppWidgetProviderInfoN(appId, providerName, isPrimary) ); + SysTryReturn(NID_SHELL, pInfo.get(), 0, E_SYSTEM, "[E_SYSTEM] Failed to invoke GetAppWidgetProviderInfoN(%ls, %ls).", appId.GetPointer(), providerName.GetPointer()); + + pAppWidgetProviderInfos->Add(*pInfo.release()); return 0; } diff --git a/src/FShell_AppWidgetPopupView.cpp b/src/FShell_AppWidgetPopupView.cpp index 57a9c5b..e59df9f 100644 --- a/src/FShell_AppWidgetPopupView.cpp +++ b/src/FShell_AppWidgetPopupView.cpp @@ -129,7 +129,7 @@ _AppWidgetPopupView::Initialize(const FloatRectangle& bounds) SysLog(NID_SHELL, "[%f %f]", x, y); int ret = livebox_create_pd_with_position(__pAppWidgetView->__pAppWidget, x, y, OnAppWidgetPopupCreated, this); - SysTryReturn(NID_SHELL, ret == 0, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); + SysTryReturn(NID_SHELL, ret == 0, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] livebox_create_pd_with_position returned error (%d)", ret); result r = SetBounds(bounds); SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));