//
-// Open Service Platform
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
SysTryReturnResult(NID_APP, appId.GetLength() <= WIDGET_APP_MAX_APPID_LENGTH, E_MAX_EXCEEDED,
"The length of appid exceeded the limit(%d).", WIDGET_APP_MAX_APPID_LENGTH);
- String tmpAppId = appId;
- String executableName = L"";
-
- result r = _AppManagerImpl::ExtractValues(appId, tmpAppId, executableName );
- bool hasExecutableName = (r == E_SUCCESS);
+ result r = _AccessController::CheckUserPrivilege(_PRV_APPLICATION_KILL, _PRV_APPMANAGER_KILL);
+ SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
- return __pAppManagerImpl->TerminateApplication(tmpAppId, (hasExecutableName) ? &executableName : null);
+ return __pAppManagerImpl->TerminateApplication(appId);
}
bool
{
SysAssertf(__pAppManagerImpl != null, "Not constructed properly by platform.");
- String tmpAppId = appId;
- String executableName = L"";
-
- result r = _AppManagerImpl::ExtractValues(appId, tmpAppId, executableName );
- bool hasExecutableName = (r == E_SUCCESS);
-
- return __pAppManagerImpl->IsRunning(tmpAppId, (hasExecutableName) ? &executableName : null);
+ return __pAppManagerImpl->IsRunning(appId);
}
IList*
result r = _AccessController::CheckUserPrivilege(_PRV_APPLICATION_LAUNCH);
SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
- return __pAppManagerImpl->RegisterAppLaunch(L"", _AppInfo::GetAppExecutableName(), condition, pArguments, option);
+ return __pAppManagerImpl->RegisterAppLaunch(L"", condition, pArguments, option);
}
result
result r = _AccessController::CheckUserPrivilege(_PRV_APPLICATION_LAUNCH);
SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
- return __pAppManagerImpl->UnregisterAppLaunch(L"", _AppInfo::GetAppExecutableName(), null);
+ return __pAppManagerImpl->UnregisterAppLaunch(L"", null);
}
result
result r = _AccessController::CheckUserPrivilege(_PRV_APPLICATION_LAUNCH);
SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
- return __pAppManagerImpl->UnregisterAppLaunch(L"", _AppInfo::GetAppExecutableName(), &condition);
+ return __pAppManagerImpl->UnregisterAppLaunch(L"", &condition);
}
bool
{
SysAssertf(__pAppManagerImpl != null, "Not constructed properly by platform.");
- return __pAppManagerImpl->IsAppLaunchRegistered(L"", _AppInfo::GetAppExecutableName(), null);
+ return __pAppManagerImpl->IsAppLaunchRegistered(L"", null);
}
result
AppManager::RegisterAppLaunch(const AppId& appId, const String& condition, const IList* pArguments, LaunchOption option)
{
SysAssertf(__pAppManagerImpl != null, "Not constructed properly by platform.");
+ SysTryReturnResult(NID_APP, _Aul::IsInstalled(appId) == true, E_APP_NOT_INSTALLED, "The application(%ls) is not installed.", appId.GetPointer());
- String tmpAppId = appId;
- String executableName = L"";
-
- _AppManagerImpl::ExtractValues(appId, tmpAppId, executableName );
- SysTryReturnResult(NID_APP, _PackageManagerImpl::GetInstance()->IsPackageInstalled(tmpAppId) == true, E_APP_NOT_INSTALLED, "The application(%ls) is not installed.", appId.GetPointer());
-
- return __pAppManagerImpl->RegisterAppLaunch(tmpAppId, executableName, condition, pArguments, option);
+ return __pAppManagerImpl->RegisterAppLaunch(appId, condition, pArguments, option);
}
AppManager::UnregisterAppLaunch(const AppId& appId, const String* pCondition)
{
SysAssertf(__pAppManagerImpl != null, "Not constructed properly by platform.");
+ SysTryReturnResult(NID_APP, _Aul::IsInstalled(appId) == true, E_APP_NOT_INSTALLED, "The application(%ls) is not installed.", appId.GetPointer());
- String tmpAppId = appId;
- String executableName = L"";
-
- _AppManagerImpl::ExtractValues(appId, tmpAppId, executableName );
- SysTryReturnResult(NID_APP, _PackageManagerImpl::GetInstance()->IsPackageInstalled(tmpAppId) == true, E_APP_NOT_INSTALLED, "The application(%ls) is not installed.", appId.GetPointer());
-
- return __pAppManagerImpl->UnregisterAppLaunch(tmpAppId, executableName, pCondition);
+ return __pAppManagerImpl->UnregisterAppLaunch(appId, pCondition);
}
{
SysAssertf(__pAppManagerImpl != null, "Not constructed properly by platform.");
- String tmpAppId = appId;
- String executableName = L"";
-
- _AppManagerImpl::ExtractValues(appId, tmpAppId, executableName );
- SysTryReturn(NID_APP, _PackageManagerImpl::GetInstance()->IsPackageInstalled(tmpAppId) == true, false, E_APP_NOT_INSTALLED, "[E_APP_NOT_INSTALLED] The application(%ls) is not installed.", appId.GetPointer());
-
- return __pAppManagerImpl->IsAppLaunchRegistered(tmpAppId, executableName, pCondition);
+ return __pAppManagerImpl->IsAppLaunchRegistered(appId, pCondition);
}
result