//
-// Open Service Platform
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
SysTryReturnResult(NID_APP, __pAppManagerImpl != null, E_OUT_OF_MEMORY, "");
r = __pAppManagerImpl->Construct();
- SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r));
+ if (IsFailed(r))
+ {
+ SysPropagate(NID_APP, r);
+ goto CATCH;
+ }
return r;
String sharedPath;
result r = _AppManagerImpl::GetAppRootPath(appId, sharedPath);
- SysTryReturn(NID_APP, !IsFailed(r), sharedPath, r, "[%s] Propagating to caller...",
- GetErrorMessage(r));
+ SysTryReturn(NID_APP, !IsFailed(r), sharedPath, r, "[%s] Propagating to caller...", GetErrorMessage(r));
sharedPath.Append(L"shared/");
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
SysAssertf(__pAppManagerImpl != null, "Not constructed properly by platform.");
Tizen::Base::Runtime::IEventListener* pListener = &listener;
- return __pAppManagerImpl->SetEventListener(AE_CHECKPOINT, pListener);
+ return __pAppManagerImpl->SetEventListener(_APP_EVENT_CHECKPOINT, pListener);
}
void
return __pAppManagerImpl->GetActiveApp(appId);
}
+bool
+AppManager::IsUserPreferredAppForAppControlResolution(const AppId& appId) const
+{
+ SysAssertf(__pAppManagerImpl != null, "Not constructed properly by platform.");
+ SysTryReturn(NID_APP, _Aul::IsInstalled(appId) == true, false, E_APP_NOT_INSTALLED, "The application(%ls) is not installed.", appId.GetPointer());
+
+ return __pAppManagerImpl->IsUserPreferredAppForAppControlResolution(appId);
+}
+
+result
+AppManager::ClearUserPreferenceForAppControlResolution(const AppId& appId)
+{
+ 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());
+
+ return __pAppManagerImpl->ClearUserPreferenceForAppControlResolution(appId);
+}
+
}} // Tizen::App