X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FFTelNetworkManager.cpp;h=866d96b87c0644675718bb04535ef34b2aab8d44;hb=20e5b4e5c35c36b8c433695151b982b8a3b1dd0b;hp=09af74ec9d252a56a3d94f024dee855b505e2a2b;hpb=d9f955cfbdc35f604bbcd72b236b55770ab65d30;p=platform%2Fframework%2Fnative%2Ftelephony.git diff --git a/src/FTelNetworkManager.cpp b/src/FTelNetworkManager.cpp index 09af74e..866d96b 100644 --- a/src/FTelNetworkManager.cpp +++ b/src/FTelNetworkManager.cpp @@ -24,9 +24,11 @@ #include #include #include +#include #include "FTel_NetworkManagerImpl.h" using namespace Tizen::Security; +using namespace Tizen::System; namespace Tizen { namespace Telephony { @@ -44,10 +46,16 @@ NetworkManager::~NetworkManager(void) result NetworkManager::Construct(ITelephonyNetworkEventListener* pListener) { + static const wchar_t _TELEPHONY[] = L"http://tizen.org/feature/network.telephony"; + SysAssertf(__pNetworkManagerImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class."); result r = E_SUCCESS; + bool isTelephonySupported = false; + + r = _SystemInfoImpl::GetSysInfo(_TELEPHONY, isTelephonySupported); + SysTryReturnResult(NID_TEL, r == E_SUCCESS && isTelephonySupported, E_UNSUPPORTED_OPERATION, "Telephony is not supported."); __pNetworkManagerImpl = new (std::nothrow) _NetworkManagerImpl(); SysTryReturnResult(NID_TEL, __pNetworkManagerImpl != null, E_OUT_OF_MEMORY, "Memory allocation failed.");