From 4f754c66278ec936b2cab67485d2224fe0f576aa Mon Sep 17 00:00:00 2001 From: Jaemin Ahn Date: Wed, 20 Mar 2013 16:18:30 +0900 Subject: [PATCH] Add E_UNSUPPORTED_OPERATION on push feature. Change-Id: I30c923332e2e3dbb3eee184ccb22b592a074bac4 Signed-off-by: Jaemin Ahn --- CMakeLists.txt | 1 + src/FMsgPushManager.cpp | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 748ae95..8ca1882 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,7 @@ INCLUDE_DIRECTORIES( /usr/include/osp/app /usr/include/osp/base /usr/include/osp/security + /usr/include/osp/system /usr/include/msg-service /usr/include/dbus-1.0 /usr/lib/dbus-1.0/include diff --git a/src/FMsgPushManager.cpp b/src/FMsgPushManager.cpp index 0f7c69d..8093e1f 100644 --- a/src/FMsgPushManager.cpp +++ b/src/FMsgPushManager.cpp @@ -24,11 +24,13 @@ #include #include #include +#include #include "FMsg_PushManagerImpl.h" using namespace Tizen::Base; using namespace Tizen::Base::Collection; using namespace Tizen::Security; +using namespace Tizen::System; namespace Tizen { namespace Messaging { @@ -47,11 +49,18 @@ PushManager::~PushManager(void) result PushManager::Construct(IPushManagerListener& managerListener, IPushEventListener& eventListener) { + static const wchar_t _PUSH[] = L"http://tizen.org/feature/network.push"; + result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_PUSH); SysTryReturnResult(NID_MSG, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + bool isPushSupported = false; + + r = _SystemInfoImpl::GetSysInfo(_PUSH, isPushSupported); + SysTryReturnResult(NID_NET, r == E_SUCCESS && isPushSupported, E_UNSUPPORTED_OPERATION, "Push messaging is not supported."); + SysAssertf(__pPushManagerImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); -- 2.7.4