From: JinWang An Date: Thu, 18 Jan 2024 04:43:16 +0000 (+0900) Subject: Fix SYSTEM_SETTINGS_KEY_AUTOMATIC_TIME_UPDATE feature checker X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c50bc4a3eb99a7829ca6e2d8cf8f6179f36b9834;p=test%2Ftct%2Fnative%2Fapi.git Fix SYSTEM_SETTINGS_KEY_AUTOMATIC_TIME_UPDATE feature checker Change-Id: Ie17ff6a5c1f760c4d966acdafa602a982b09113b Signed-off-by: JinWang An --- diff --git a/src/itc/capi-system-system-settings/ITs-system-settings-common.c b/src/itc/capi-system-system-settings/ITs-system-settings-common.c index 557c2dcc3..04932c97e 100755 --- a/src/itc/capi-system-system-settings/ITs-system-settings-common.c +++ b/src/itc/capi-system-system-settings/ITs-system-settings-common.c @@ -33,6 +33,7 @@ char* SystemSettingsGetError(int nRet) switch ( nRet ) { case SYSTEM_SETTINGS_ERROR_NONE: szErrorVal = "SYSTEM_SETTINGS_ERROR_NONE"; break; + case SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED: szErrorVal = "SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED"; break; case SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER: szErrorVal = "SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER"; break; case SYSTEM_SETTINGS_ERROR_IO_ERROR: szErrorVal = "SYSTEM_SETTINGS_ERROR_IO_ERROR"; break; default: szErrorVal = "Unknown Error"; break; diff --git a/src/itc/capi-system-system-settings/ITs-system-settings-common.h b/src/itc/capi-system-system-settings/ITs-system-settings-common.h index f377a7058..c035c2399 100755 --- a/src/itc/capi-system-system-settings/ITs-system-settings-common.h +++ b/src/itc/capi-system-system-settings/ITs-system-settings-common.h @@ -36,6 +36,7 @@ #define SYSTEM_SETTINGS_LOCK_SCREEN_FEATURE "http://tizen.org/feature/systemsetting.lock_screen" #define SYSTEM_SETTINGS_NOTIFICATION_EMAIL_FEATURE "http://tizen.org/feature/systemsetting.notification_email" #define SYSTEM_SETTINGS_TELEPHONY_FEATURE "http://tizen.org/feature/network.telephony" +#define SYSTEM_SETTINGS_ETHERNET_FEATURE "http://tizen.org/feature/network.ethernet" #define SYSTEM_SETTINGS_INCOMING_CALL_FEATURE "http://tizen.org/feature/systemsetting.incoming_call" #define SYSTEM_SETTINGS_ACCESSIBILITY_GRAYSCALE_FEATURE "http://tizen.org/feature/accessibility.grayscale" #define SYSTEM_SETTINGS_ACCESSIBILITY_NEGATIVE_FEATURE "http://tizen.org/feature/accessibility.negative" diff --git a/src/itc/capi-system-system-settings/ITs-system-settings.c b/src/itc/capi-system-system-settings/ITs-system-settings.c index d44891c3e..e0238d03c 100755 --- a/src/itc/capi-system-system-settings/ITs-system-settings.c +++ b/src/itc/capi-system-system-settings/ITs-system-settings.c @@ -23,6 +23,7 @@ bool g_bSystemSettingsNotSupported = false; bool g_bSystemSettingsFontNotSupported = false; bool g_bSystemSettingsTelyphoneyNotSupported = false; +bool g_bSystemSettingsNetworkNotSupported = false; bool g_bSystemSettingsIncomingCallNotSupported = false; bool g_bSystemSettingsGrayscaleNotSupported = false; bool g_bSystemSettingsNegativeNotSupported = false; @@ -52,6 +53,7 @@ void ITs_system_settings_startup(void) g_bSystemSettingsGrayscaleNotSupported = false; g_bSystemSettingsNegativeNotSupported = false; g_bSystemSettingsRotaryNotSupported = false; + g_bSystemSettingsNetworkNotSupported = false; if ( !TCTCheckSystemInfoFeatureSupported(SYSTEM_SETTINGS_FEATURE, API_NAMESPACE) ) { @@ -65,6 +67,12 @@ void ITs_system_settings_startup(void) { g_bSystemSettingsTelyphoneyNotSupported = true; } + if ( !TCTCheckSystemInfoFeatureSupported(SYSTEM_SETTINGS_TELEPHONY_FEATURE, API_NAMESPACE)&& + !TCTCheckSystemInfoFeatureSupported(SYSTEM_SETTINGS_ETHERNET_FEATURE, API_NAMESPACE) && + !TCTCheckSystemInfoFeatureSupported(SYSTEM_SETTINGS_NETWORK_WIFI_FEATURE, API_NAMESPACE) ) + { + g_bSystemSettingsNetworkNotSupported = true; + } if (!TCTCheckSystemInfoFeatureSupported(SYSTEM_SETTINGS_INCOMING_CALL_FEATURE, API_NAMESPACE) ) { g_bSystemSettingsIncomingCallNotSupported = true; @@ -208,12 +216,13 @@ int ITc_system_settings_get_value_bool_p(void) } } - if(g_bSystemSettingsTelyphoneyNotSupported && eSystem_Settings_Key[enum_counter] == SYSTEM_SETTINGS_KEY_AUTOMATIC_TIME_UPDATE) + if(g_bSystemSettingsNetworkNotSupported && eSystem_Settings_Key[enum_counter] == SYSTEM_SETTINGS_KEY_AUTOMATIC_TIME_UPDATE) { if ( nRetVal == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED ) { FPRINTF("\\n[Line : %d][%s] Feature Not Supported , error returned = %s", __LINE__, API_NAMESPACE, SystemSettingsGetError(nRetVal)); - return 0; + nRetVal == SYSTEM_SETTINGS_ERROR_NONE; + continue; } else { @@ -227,7 +236,8 @@ int ITc_system_settings_get_value_bool_p(void) if ( nRetVal == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED ) { FPRINTF("\\n[Line : %d][%s] Feature Not Supported , error returned = %s", __LINE__, API_NAMESPACE, SystemSettingsGetError(nRetVal)); - return 0; + nRetVal == SYSTEM_SETTINGS_ERROR_NONE; + continue; } else { @@ -241,7 +251,8 @@ int ITc_system_settings_get_value_bool_p(void) if ( nRetVal == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED ) { FPRINTF("\\n[Line : %d][%s] Feature Not Supported , error returned = %s", __LINE__, API_NAMESPACE, SystemSettingsGetError(nRetVal)); - return 0; + nRetVal == SYSTEM_SETTINGS_ERROR_NONE; + continue; } else { @@ -254,7 +265,8 @@ int ITc_system_settings_get_value_bool_p(void) if ( nRetVal == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED ) { FPRINTF("\\n[Line : %d][%s] Feature Not Supported , error returned = %s", __LINE__, API_NAMESPACE, SystemSettingsGetError(nRetVal)); - return 0; + nRetVal == SYSTEM_SETTINGS_ERROR_NONE; + continue; } else { @@ -315,6 +327,12 @@ int ITc_system_settings_get_value_string_p(void) key = e_System_Settings_Key[enum_counter]; nRetVal = system_settings_get_value_string(key, &pszGetPath);// Target APIs + if( g_bSystemSettingsNotSupported || nRetVal == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED ) + { + nRetVal == SYSTEM_SETTINGS_ERROR_NONE; + break; + } + if(key == SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP || key == SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN && (!TCTCheckSystemInfoFeatureSupported(SYSTEM_SETTINGS_LOCK_SCREEN_FEATURE, API_NAMESPACE)) ) { continue; @@ -325,8 +343,7 @@ int ITc_system_settings_get_value_string_p(void) continue; } - if( g_bSystemSettingsNotSupported || - (g_bSystemSettingsFontNotSupported && (key == SYSTEM_SETTINGS_KEY_FONT_TYPE || key == SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE)) || + if( (g_bSystemSettingsFontNotSupported && (key == SYSTEM_SETTINGS_KEY_FONT_TYPE || key == SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE)) || (g_bSystemSettingsIncomingCallNotSupported && (key == SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE)) ) { @@ -334,7 +351,8 @@ int ITc_system_settings_get_value_string_p(void) { FPRINTF("\\n[Line : %d][%s] Feature Not Supported , error returned = %s", __LINE__, API_NAMESPACE, SystemSettingsGetError(nRetVal)); FREE_MEMORY(pszGetPath); - return 0; + nRetVal == SYSTEM_SETTINGS_ERROR_NONE; + continue; } else { @@ -537,7 +555,11 @@ int ITc_system_settings_add_remove_changed_cb_p(void) if ( nkey_idx == (SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED + 1) || nkey_idx == SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE ) continue; - if(nkey_idx == SYSTEM_SETTINGS_KEY_AUTOMATIC_TIME_UPDATE && ((!TCTCheckSystemInfoFeatureSupported(SYSTEM_SETTINGS_TELEPHONY_FEATURE, API_NAMESPACE)) || (!TCTCheckSystemInfoFeatureSupported(SYSTEM_SETTINGS_FONT_FEATURE, API_NAMESPACE) ))) + if(nkey_idx == SYSTEM_SETTINGS_KEY_AUTOMATIC_TIME_UPDATE && + ((!TCTCheckSystemInfoFeatureSupported(SYSTEM_SETTINGS_TELEPHONY_FEATURE, API_NAMESPACE) && + !TCTCheckSystemInfoFeatureSupported(SYSTEM_SETTINGS_ETHERNET_FEATURE, API_NAMESPACE) && + !TCTCheckSystemInfoFeatureSupported(SYSTEM_SETTINGS_NETWORK_WIFI_FEATURE, API_NAMESPACE) ) + || (!TCTCheckSystemInfoFeatureSupported(SYSTEM_SETTINGS_FONT_FEATURE, API_NAMESPACE) ))) { continue; }