From 016ae83eef1caf07a07fcddb72849c535c6b72e1 Mon Sep 17 00:00:00 2001 From: Hyunbin Lee Date: Thu, 31 Oct 2013 10:16:35 +0900 Subject: [PATCH] Add application.launch privilege to AppControl::Stop() Change-Id: I23bdf88070efe68843029e2b874d36c0f6bfd090 Signed-off-by: Hyunbin Lee --- inc/FAppAppControl.h | 5 ++++- src/app/FAppAppControl.cpp | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/inc/FAppAppControl.h b/inc/FAppAppControl.h index cd11400..80ede82 100644 --- a/inc/FAppAppControl.h +++ b/inc/FAppAppControl.h @@ -1053,7 +1053,7 @@ _OSP_EXPORT_ extern const Tizen::Base::String APPCONTROL_RESULT_TERMINATED; * String telUri = L"tel:12345678900"; * * AppControl* pAc = AppManager::FindAppControlN(L"tizen.phone", L"http://tizen.org/appcontrol/operation/dial"); -* if(pAc) +* if(pAc) * { * pAc->Start(&telUri, null, null, null); * delete pAc; @@ -1244,9 +1244,12 @@ public: * tizen.email, tizen.filemanager, tizen.gallery, tizen.imageviewer, tizen.mmsmessages, and tizen.smsmessages. * * @since 2.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/application.launch * * @return An error code * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. * @exception E_SYSTEM A system error has occurred. * @exception E_INVALID_OPERATION The application control is not permitted to call this method. * @remarks This method is asynchronous. diff --git a/src/app/FAppAppControl.cpp b/src/app/FAppAppControl.cpp index c5d3893..447d748 100644 --- a/src/app/FAppAppControl.cpp +++ b/src/app/FAppAppControl.cpp @@ -90,6 +90,9 @@ AppControl::FindAndStart(const String& operationId, const String* pUriPattern, c result AppControl::Stop(void) { + 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."); + SysAssertf(__pAppControlImpl != null, "Instance is not constructed properly."); return __pAppControlImpl->Stop(); } -- 2.7.4