Add application.launch privilege to AppControl::Stop()
authorHyunbin Lee <hyunbin.lee@samsung.com>
Thu, 31 Oct 2013 01:16:35 +0000 (10:16 +0900)
committerHyunbin Lee <hyunbin.lee@samsung.com>
Thu, 31 Oct 2013 05:28:04 +0000 (14:28 +0900)
Change-Id: I23bdf88070efe68843029e2b874d36c0f6bfd090
Signed-off-by: Hyunbin Lee <hyunbin.lee@samsung.com>
inc/FAppAppControl.h
src/app/FAppAppControl.cpp

index cd11400..80ede82 100644 (file)
@@ -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.
index c5d3893..447d748 100644 (file)
@@ -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();
 }