#include <FMsgPushManager.h>
#include <FBaseSysLog.h>
#include <FSec_AccessController.h>
+#include <FSys_SystemInfoImpl.h>
#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
{
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.");