From: Kichan Kwon Date: Thu, 12 Dec 2019 02:16:14 +0000 (+0900) Subject: Check more feature support X-Git-Tag: accepted/tizen/unified/20201230.121825^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F33%2F219933%2F3;p=platform%2Fcore%2Fapi%2Fruntime-info.git Check more feature support - Packet data, Data roaming, Vibration and TV out Change-Id: I32bd0ded8c06b52fc396a9833a025e54be4edaa4 Signed-off-by: Kichan Kwon --- diff --git a/src/runtime_info_connectivity.c b/src/runtime_info_connectivity.c index 905ba9e..5aadc7f 100644 --- a/src/runtime_info_connectivity.c +++ b/src/runtime_info_connectivity.c @@ -200,6 +200,8 @@ int runtime_info_packet_data_get_value(runtime_info_value_h value) int vconf_value; int ret; + RETURN_ERROR_IF_NOT_SUPPORTED("http://tizen.org/feature/network.telephony"); + ret = runtime_info_vconf_get_value_bool(VCONF_PACKET_DATA_ENABLED, &vconf_value); if (ret == RUNTIME_INFO_ERROR_NONE) value->b = (bool)vconf_value; @@ -222,6 +224,8 @@ int runtime_info_data_roaming_get_value(runtime_info_value_h value) int vconf_value; int ret; + RETURN_ERROR_IF_NOT_SUPPORTED("http://tizen.org/feature/network.telephony"); + ret = runtime_info_vconf_get_value_bool(VCONF_DATA_ROAMING_ENABLED, &vconf_value); if (ret == RUNTIME_INFO_ERROR_NONE) value->b = (bool)vconf_value; diff --git a/src/runtime_info_system.c b/src/runtime_info_system.c index cd9d678..78b5348 100644 --- a/src/runtime_info_system.c +++ b/src/runtime_info_system.c @@ -72,6 +72,8 @@ int runtime_info_vibration_enabled_get_value(runtime_info_value_h value) int vconf_value; int ret; + RETURN_ERROR_IF_NOT_SUPPORTED("http://tizen.org/feature/feedback.vibration"); + ret = runtime_info_vconf_get_value_bool(VCONF_VIBRATION_ENABLED, &vconf_value); if (ret == RUNTIME_INFO_ERROR_NONE) value->b = (bool)vconf_value; @@ -143,6 +145,18 @@ int runtime_info_tvout_connected_get_value(runtime_info_value_h value) int vconf_value; int ret; + bool supported; + ret = system_info_get_platform_bool("http://tizen.org/feature/screen.output.hdmi", &supported); + if (ret != SYSTEM_INFO_ERROR_NONE) + return RUNTIME_INFO_ERROR_IO_ERROR; + if (!supported) { + ret = system_info_get_platform_bool("http://tizen.org/feature/screen.output.rca", &supported); + if (ret != SYSTEM_INFO_ERROR_NONE) + return RUNTIME_INFO_ERROR_IO_ERROR; + if (!supported) + return RUNTIME_INFO_ERROR_NOT_SUPPORTED; + } + ret = runtime_info_vconf_get_value_int(VCONF_TVOUT_CONNECTED, &vconf_value); if (ret == RUNTIME_INFO_ERROR_NONE) value->b = vconf_value;