From a6a0ea247d8023b42eba84ce51a4c9eb0e480f43 Mon Sep 17 00:00:00 2001 From: Kichan Kwon Date: Thu, 12 Dec 2019 11:16:14 +0900 Subject: [PATCH] Check more feature support - Packet data, Data roaming, Vibration and TV out Change-Id: I32bd0ded8c06b52fc396a9833a025e54be4edaa4 Signed-off-by: Kichan Kwon --- src/runtime_info_connectivity.c | 4 ++++ src/runtime_info_system.c | 14 ++++++++++++++ 2 files changed, 18 insertions(+) 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; -- 2.7.4