Update for user preference for AppControl resolution
authorJaesung Ku <jaesung.ku@samsung.com>
Fri, 21 Jun 2013 03:08:33 +0000 (12:08 +0900)
committerJaesung Ku <jaesung.ku@samsung.com>
Fri, 21 Jun 2013 03:08:33 +0000 (12:08 +0900)
Change-Id: Iddb1b69e91a4492f691de51532ae6dd5530fc5b0
Signed-off-by: Jaesung Ku <jaesung.ku@samsung.com>
inc/FApp_AppManagerService.h [changed mode: 0644->0755]
inc/FApp_AppManagerStub.h [changed mode: 0644->0755]
src/FApp_AppManagerService.cpp [changed mode: 0644->0755]
src/FApp_AppManagerStub.cpp [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index c3e720d..d4d20df
@@ -69,6 +69,9 @@ public:
        virtual result RemoveEventListener(int clientId);
        virtual void OnApplicationTerminated(const _AppContext& appInfo);
 
+       virtual bool IsUserPreferredAppForAppControlResolution(const AppId& appId);
+       virtual result ClearUserPreferenceForAppControlResolution(const AppId& appId);
+
 private:
        result SendEventToAllListeners(const _AppManagerEventArg& arg);
 
old mode 100644 (file)
new mode 100755 (executable)
index 086cb92..1731386
@@ -82,6 +82,9 @@ public:
        virtual result OnServiceEventReceived(int clientId, const _AppManagerEventArg& arg);
        virtual result OnTerminateApplicationRequested(int clientId);
 
+       bool OnIsUserPreferredAppForAppControlResolution(const AppId& appId, bool *pRes, result *pResException);
+       bool OnClearUserPreferenceForAppControlResolution(const AppId& appId, result *pRes);
+
 private:
        result StartIpcServer(void);
        _AppManagerStub(const _AppManagerStub& value);
old mode 100644 (file)
new mode 100755 (executable)
index 3e91480..340be15
@@ -28,6 +28,7 @@
 #include "FAppPkg_PackageManagerImpl.h"
 #include "FApp_ContextManager.h"
 #include "FApp_AppManagerService.h"
+#include "FApp_AulServer.h"
 
 
 using namespace Tizen::Base;
@@ -212,5 +213,16 @@ _AppManagerService::Dump(void)
        __pContextMgr->Dump();
 }
 
+bool 
+_AppManagerService::IsUserPreferredAppForAppControlResolution(const AppId& appId)
+{
+       return _AulServer::IsUserPreferredAppForAppControlResolution(appId);
+}
+
+result 
+_AppManagerService::ClearUserPreferenceForAppControlResolution(const AppId& appId)
+{
+       return _AulServer::ClearUserPreferenceForAppControlResolution(appId);
+}
 
 }}//namespace Tizen { namespace App {
old mode 100644 (file)
new mode 100755 (executable)
index 49bb13a..9300a12
@@ -249,6 +249,8 @@ _AppManagerStub::OnIpcRequestReceived(_IpcServer& server, const IPC::Message& me
                IPC_MESSAGE_HANDLER_EX(AppManager_UnregisterApplication, &server, OnUnregisterApplication)
                IPC_MESSAGE_HANDLER_EX(AppManager_AddEventListener, &server, OnAddEventListener)
                IPC_MESSAGE_HANDLER_EX(AppManager_RemoveEventListener, &server, OnRemoveEventListener)
+               IPC_MESSAGE_HANDLER_EX(AppManager_IsUserPreferredAppForAppControlResolution, &server, OnIsUserPreferredAppForAppControlResolution)
+               IPC_MESSAGE_HANDLER_EX(AppManager_ClearUserPreferenceForAppControlResolution, &server, OnClearUserPreferenceForAppControlResolution)
        IPC_END_MESSAGE_MAP()
 }
 
@@ -276,5 +278,49 @@ _AppManagerStub::OnIpcClientDisconnected(const _IpcServer& server, int clientId)
 //     SysLog(NID_APP, "(pkgId:%ls, clientId:%d)\n", server.GetClientPackageId().GetPointer(), clientId);
 }
 
+bool
+_AppManagerStub::OnIsUserPreferredAppForAppControlResolution(const AppId& appId, bool *pRes, result *pResException)
+{
+       SysTryCatch(NID_APP, __pAppManagerService != null, *pResException = E_SYSTEM, E_SYSTEM, "__pAppManagerService is null!");
+       SysLog(NID_APP, "app(%ls)", appId.GetPointer());
+
+/*
+       *pResException = _AccessController::CheckSystemPrivilege(__pIpcServer->GetClientPackageId(), _PRV_APPMANAGER_SETTING);
+
+       if (IsFailed(*pResException))
+       {
+               SysLog(NID_APP, "[E_PRIVILEGE_DENIED]The application(%ls) does not have the privilege to call this method.", appId.GetPointer());
+               *pResException = E_PRIVILEGE_DENIED;
+               return true;
+       }
+*/     
+       *pRes = __pAppManagerService->IsUserPreferredAppForAppControlResolution(appId);
+
+CATCH:
+       return true;
+
+}
+
+bool
+_AppManagerStub::OnClearUserPreferenceForAppControlResolution(const AppId& appId, result *pRes)
+{
+       SysTryCatch(NID_APP, __pAppManagerService != null, *pRes = E_SYSTEM, E_SYSTEM, "__pAppManagerService is null!");
+       SysLog(NID_APP, "app(%ls)", appId.GetPointer());
+/*
+       *pRes = _AccessController::CheckSystemPrivilege(__pIpcServer->GetClientPackageId(), _PRV_APPMANAGER_SETTING);
+
+       if (IsFailed(*pRes))
+       {
+               SysLog(NID_APP, "[E_PRIVILEGE_DENIED]The application(%ls) does not have the privilege to call this method.", appId.GetPointer());
+               *pRes = E_PRIVILEGE_DENIED;
+               return true;    
+       }
+*/
+       *pRes = __pAppManagerService->ClearUserPreferenceForAppControlResolution(appId);
+
+CATCH:
+       return true;
+
+}
 
 }}//namespace Tizen { namespace App {