}
// 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<IList*>(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<IList*>(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<AppWidgetProviderInfo> 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;
}
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));