#include <FGrpDimension.h>
#include <FApp_AppImpl.h>
#include <FBase_StringConverter.h>
+#include <FAppPkg_PackageManagerImpl.h>
#include <FShellAppWidgetProviderInfo.h>
#include <FShellAppWidgetProvider.h>
AppWidgetProviderInfo*
_AppWidgetManagerImpl::GetDefaultAppWidgetProviderInfoN(const Tizen::App::PackageId& packageId)
{
+ SysTryReturn(NID_SHELL, Tizen::App::Package::_PackageManagerImpl::GetInstance()->IsPackageInstalled(packageId) == true,
+ null, E_APP_NOT_INSTALLED,
+ "[E_APP_NOT_INSTALLED] The application package(%ls) is not installed.", packageId.GetPointer() );
+
std::unique_ptr<char[]> pPackageId(_StringConverter::CopyToCharArrayN(packageId) );
std::unique_ptr<char[]> pDefaultProviderId(livebox_service_pkgname(pPackageId.get()) );
- SysTryReturn(NID_SHELL, pDefaultProviderId.get(), null, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND]");
+ SysTryReturn(NID_SHELL, pDefaultProviderId.get(), null, E_SUCCESS, "Specified package(%ls) has no default provider.", packageId.GetPointer() );
String providerId(pDefaultProviderId.get());
String appId;
{
SysLog(NID_SHELL, "Enter.");
- __pIpcClient = new (std::nothrow) _IpcClient();
- SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_OUT_OF_MEMORY, "_IpcClient creation failed.");
+ std::unique_ptr<_IpcClient> pIpcClient(new (std::nothrow) _IpcClient() );
+ SysTryReturnResult(NID_SHELL, pIpcClient, E_OUT_OF_MEMORY, "_IpcClient creation failed.");
const int MAX_TRY_COUNT = 5;
- const int TRY_SLEEP_TIME = 500;
+ const int TRY_SLEEP_TIME = 250;
int count = 0;
while (true)
{
- result r = __pIpcClient->Construct(IPC_SERVER_NAME, this);
+ result r = pIpcClient->Construct(IPC_SERVER_NAME, this);
if (r == E_SUCCESS)
{
SysLog(NID_APP, "Succeeded in connecting service(%s)", IPC_SERVER_NAME);
+ __pIpcClient = pIpcClient.release();
return E_SUCCESS;
}
result
_AppWidgetManagerProxy::RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& argument)
{
- SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_INVALID_STATE, "__pIpcClient instance must not be null.");
+ SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null.");
SysLog(NID_SHELL, "Enter.");
// String providerId;
// if( providerName.IsEmpty() == true)
result
_AppWidgetManagerProxy::RequestUpdateInstance(const Tizen::Base::String& instanceId, const Tizen::Base::String& argument)
{
- SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_INVALID_STATE, "__pIpcClient instance must not be null.");
+ SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null.");
SysLog(NID_SHELL, "Enter.");
result ret = E_SUCCESS;
result
_AppWidgetManagerProxy::RequestSharedMemoryId(const Tizen::Base::String& instanceId, int width, int height, int& shmId )
{
- SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_INVALID_STATE, "__pIpcClient instance must not be null.");
+ SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null.");
std::auto_ptr<IPC::Message> pMsg (new (std::nothrow) AppWidgetManager_RequestSharedMemoryId(instanceId, width, height, &shmId));
result r = __pIpcClient->SendRequest(*pMsg.get());
result
_AppWidgetManagerProxy::RequestSharedMemoryIdForPD(const Tizen::Base::String& instanceId, int width, int height, int& shmId )
{
- SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_INVALID_STATE, "__pIpcClient instance must not be null.");
+ SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null.");
std::auto_ptr<IPC::Message> pMsg (new (std::nothrow) AppWidgetManager_RequestSharedMemoryIdForPD(instanceId, width, height, &shmId));
result r = __pIpcClient->SendRequest(*pMsg.get());
result
_AppWidgetManagerProxy::RequestSyncSharedMemory(const Tizen::Base::String& instanceId, int width, int height)
{
- SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_INVALID_STATE, "__pIpcClient instance must not be null.");
+ SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null.");
SysLog(NID_SHELL, "");
result ret = E_FAILURE;
result
_AppWidgetManagerProxy::RequestSyncSharedMemoryForPD(const Tizen::Base::String& instanceId)
{
- SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_INVALID_STATE, "__pIpcClient instance must not be null.");
+ SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null.");
SysLog(NID_SHELL, "");
result ret = E_FAILURE;
result
_AppWidgetManagerProxy::RequestReleaseSharedMemory(const Tizen::Base::String& instanceId)
{
- SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_INVALID_STATE, "__pIpcClient instance must not be null.");
+ SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null.");
SysLog(NID_SHELL, "");
result ret = E_FAILURE;
result
_AppWidgetManagerProxy::RequestReleaseSharedMemoryForPD(const Tizen::Base::String& instanceId)
{
- SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_INVALID_STATE, "__pIpcClient instance must not be null.");
+ SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null.");
SysLog(NID_SHELL, "");
result ret = E_FAILURE;
result
_AppWidgetManagerProxy::SendResult(const Tizen::Base::String& instanceId, bool isSucceeded)
{
- SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_INVALID_STATE, "__pIpcClient instance must not be null.");
+ SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null.");
SysLog(NID_SHELL, "");
std::auto_ptr<IPC::Message> pMsg (new (std::nothrow) AppWidgetManager_SendResult(instanceId, isSucceeded));
#include <FBaseSysLog.h>
#include <FBase_StringConverter.h>
#include <FApp_AppInfo.h>
+#include <FApp_Aul.h>
#include <FAppPkg_PackageManagerImpl.h>
#include <FAppPkg_PackageInfoImpl.h>
#include <FShellAppWidgetProviderInfo.h>
__providerId = _AppWidgetManagerImpl::MakeProviderName(appId, name);
std::unique_ptr<char[]> pProviderId(_StringConverter::CopyToCharArrayN(__providerId));
- __displayName = livebox_service_i18n_name(pProviderId.get(), null);
- __configurationAppControlAppId = livebox_service_setup_appid(pProviderId.get());
+ std::unique_ptr<char[]> pDisplayName(livebox_service_i18n_name(pProviderId.get(), null));
+ std::unique_ptr<char[]> pSetUpAppId(livebox_service_setup_appid(pProviderId.get()));
+ __displayName = pDisplayName.get();
+ __configurationAppControlAppId = pSetUpAppId.get();
SysSecureLog(NID_SHELL, "appId(%ls), name(%ls), providerId(%ls), displayName(%ls), configuration(%ls)", appId.GetPointer(), name.GetPointer(), __providerId.GetPointer(), __displayName.GetPointer(), __configurationAppControlAppId.GetPointer() );
}
AppWidgetProviderInfo*
_AppWidgetProviderInfoImpl::GetAppWidgetProviderInfoN(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, bool isDefault)
{
+ SysTryReturn(NID_SHELL, IsExist(appId, providerName) == true, null, E_APP_NOT_INSTALLED, "The application(%ls) is not installed.", appId.GetPointer());
+
AppWidgetProviderInfo* pInfo = new (std::nothrow) AppWidgetProviderInfo(appId, providerName);
SysTryReturn(NID_SHELL, pInfo, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to allocate memory for AppWidgetProviderInfo." );
return pInfo;
}
+bool
+_AppWidgetProviderInfoImpl::IsExist(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName)
+{
+ SysTryReturn(NID_SHELL, Tizen::App::_Aul::IsInstalled(appId) == true, false, E_APP_NOT_INSTALLED, "The application(%ls) is not installed.", appId.GetPointer());
+
+ std::unique_ptr<char[]> pProviderId(_StringConverter::CopyToCharArrayN(_AppWidgetManagerImpl::MakeProviderName(appId, providerName)));
+ std::unique_ptr<char[]> pPackageId(livebox_service_appid(pProviderId.get()));
+ SysTryReturn(NID_SHELL, pPackageId.get(), false, E_APP_NOT_INSTALLED, "The application(%ls) is not installed.", appId.GetPointer());
+
+ return true;
+}
+
_AppWidgetProviderInfoImpl*
_AppWidgetProviderInfoImpl::GetImpl(const AppWidgetProviderInfo& appwidgetProviderInfo)
{
{
SysLog(NID_SHELL, "Enter.");
- __pIpcClient = new (std::nothrow) _IpcClient();
- SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_OUT_OF_MEMORY, "_IpcClient creation failed.");
+ std::unique_ptr<_IpcClient> pIpcClient( new (std::nothrow) _IpcClient() );
+ SysTryReturnResult(NID_SHELL, pIpcClient, E_OUT_OF_MEMORY, "_IpcClient creation failed.");
const int MAX_TRY_COUNT = 5;
const int TRY_SLEEP_TIME = 250;
int count = 0;
while (true)
{
- result r = __pIpcClient->Construct(IPC_SERVER_NAME);
+ result r = pIpcClient->Construct(IPC_SERVER_NAME);
if (r == E_SUCCESS)
{
SysLog(NID_APP, "Succeeded in connecting service(%s)", IPC_SERVER_NAME);
+ __pIpcClient = pIpcClient.release();
return E_SUCCESS;
}
result
_LockManagerProxy::Unlock(void)
{
- SysTryReturnResult(NID_APP, __pIpcClient != null, E_INVALID_STATE, "__pIpcClient instance must not be null.");
+ SysTryReturnResult(NID_APP, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null.");
result response = E_SUCCESS;
#include <FBaseSysLog.h>
#include <FBase.h>
#include <FBase_StringConverter.h>
+#include <FApp_Aul.h>
#include <FApp.h>
#include "FShell_ShortcutManagerImpl.h"
result
_ShortcutManagerImpl::AddShortcut(const AppId& appId, const String& displayName, const String& iconFilePath, const String& uriData, bool allowDuplication)
{
- SysLog(NID_SHELL, "_ShortcutManagerImpl::AddShortcut enters.");
+ SysTryReturnResult(NID_SHELL, _Aul::IsInstalled(appId) == true, E_APP_NOT_INSTALLED, "The application(%ls) is not installed.", appId.GetPointer());
+
std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
std::unique_ptr<char[]> pIcon(_StringConverter::CopyToCharArrayN(iconFilePath));
std::unique_ptr<char[]> pName(_StringConverter::CopyToCharArrayN(displayName));
SysTryReturnResult(NID_SHELL, ret != SHORTCUT_ERROR_COMM, E_SUCCESS, "It's failed to add_to_home_shortcut, but regarded as success.");
SysTryReturnResult(NID_SHELL, ret != SHORTCUT_ERROR_MEMORY, E_OUT_OF_MEMORY, "It's failed to add_to_home_shortcut.");
SysTryReturnResult(NID_SHELL, ret == SHORTCUT_SUCCESS, E_SYSTEM, "Failed to add_to_home_shortcut");
- SysLog(NID_SHELL, "_ShortcutManagerImpl::AddShortcut exits.");
+
+ SysLog(NID_SHELL, "Successed.");
return E_SUCCESS;
}
*/
_AppWidgetProviderInfoImpl& operator =(const _AppWidgetProviderInfoImpl& rhs);
+ static bool IsExist(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName);
+
+
private:
Tizen::Base::String __appId;
Tizen::Base::String __name;