[Bug] When using device with not supported feature
http://tizen.org/feature/network.telephony
e.g. R800 device, below code returns no error:
tizen.systeminfo.getPropertyValueArray("NETWORK", (s) => {console.log(s)}, (s) => {console.log(s)})
listener for "NETWORK" property is never triggered also:
tizen.systeminfo.addPropertyValueChangeListener("NETWORK", (s) => console.log(s));
[verification]
Systeminfo TCT 100% passrate.
After fix, listener and getter works properly on TW3.
Change-Id: I9f0d533055926d186305fb7c39418de1fed76f5b
return PlatformResult(ErrorCode::NO_ERROR);
}
+PlatformResult SysteminfoUtils::CheckWifiSupport() {
+ ScopeLogger();
+ bool supported = false;
+ PlatformResult ret =
+ SystemInfoDeviceCapability::GetValueBool("tizen.org/feature/network.wifi", &supported);
+ if (ret.IsError()) {
+ return ret;
+ }
+ if (!supported) {
+ return LogAndCreateResult(ErrorCode::NOT_SUPPORTED_ERR,
+ "Wifi is not supported on this device");
+ }
+ return PlatformResult(ErrorCode::NO_ERROR);
+}
+
PlatformResult SysteminfoUtils::CheckCameraFlashSupport() {
ScopeLogger();
bool supported = false;
static common::PlatformResult GetRuntimeInfoString(system_settings_key_e key,
std::string *platform_string);
static common::PlatformResult CheckTelephonySupport();
+ static common::PlatformResult CheckWifiSupport();
static common::PlatformResult CheckCameraFlashSupport();
static common::PlatformResult CheckIfEthernetNetworkSupported();
static common::PlatformResult GetTotalMemory(long long *result);
PlatformResult ret = SysteminfoUtils::CheckTelephonySupport();
if (ret.IsError()) {
*count = 0;
+ if ("NETWORK" == property && SysteminfoUtils::CheckWifiSupport()) {
+ // Telephony is not supported in this case, but WiFi is still supported, thus setting
+ // counter to 1.
+ *count = 1;
+ }
} else {
*count = tapi_manager_->GetSimCount();
}