X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FFTelSimInfo.cpp;h=3c96ed9c0b62d7d74ed7640cb87152eca184138e;hb=20e5b4e5c35c36b8c433695151b982b8a3b1dd0b;hp=ca24fc10082afa53bbd2aa67b032d0aae89e7bf4;hpb=d9f955cfbdc35f604bbcd72b236b55770ab65d30;p=platform%2Fframework%2Fnative%2Ftelephony.git diff --git a/src/FTelSimInfo.cpp b/src/FTelSimInfo.cpp index ca24fc1..3c96ed9 100644 --- a/src/FTelSimInfo.cpp +++ b/src/FTelSimInfo.cpp @@ -22,10 +22,12 @@ #include #include #include +#include #include "FTel_SimInfoImpl.h" using namespace Tizen::Base; using namespace Tizen::Security; +using namespace Tizen::System; namespace Tizen { namespace Telephony { @@ -50,10 +52,16 @@ SimInfo::~SimInfo(void) result SimInfo::Construct(void) { + static const wchar_t _TELEPHONY[] = L"http://tizen.org/feature/network.telephony"; + SysAssertf(__pSimInfoImpl == 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."); __pSimInfoImpl = new (std::nothrow)_SimInfoImpl(); SysTryReturnResult(NID_TEL, __pSimInfoImpl != null, E_OUT_OF_MEMORY, "Memory allocation failed");