Synchronized tizen_2.1 branch with master
[platform/framework/native/telephony.git] / src / FTelNetworkInfo.cpp
index e3a9783..32137a8 100644 (file)
 #include <FTelNetworkInfo.h>
 #include <FBaseSysLog.h>
 #include <FSec_AccessController.h>
+#include <FSys_SystemInfoImpl.h>
 #include "FTel_NetworkInfoImpl.h"
 
 
 using namespace Tizen::Base;
 using namespace Tizen::Security;
+using namespace Tizen::System;
 
 
 namespace Tizen { namespace Telephony
@@ -184,14 +186,21 @@ NetworkInfo::GetHashCode(void) const
 int
 NetworkInfo::GetRssi(void)
 {
+       static const wchar_t _TELEPHONY[] = L"http://tizen.org/feature/network.telephony";
+
        ClearLastResult();
 
        int rssi = -1;
        result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO, _PRV_TELEPHONY);
-
        SysTryReturn(NID_TEL, r == E_SUCCESS, rssi, E_PRIVILEGE_DENIED,
                        "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
 
+       bool isTelephonySupported = false;
+
+    r = _SystemInfoImpl::GetSysInfo(_TELEPHONY, isTelephonySupported);
+    SysTryReturn(NID_TEL, r == E_SUCCESS && isTelephonySupported, rssi, E_UNSUPPORTED_OPERATION,
+               "[%s] Telephony is not supported.", GetErrorMessage(E_UNSUPPORTED_OPERATION));
+
        rssi = _NetworkInfoImpl::GetRssi();
 
        r = GetLastResult();