Fix SYSTEM_SETTINGS_KEY_AUTOMATIC_TIME_UPDATE feature checker 85/304485/2
authorJinWang An <jinwang.an@samsung.com>
Thu, 18 Jan 2024 04:43:16 +0000 (13:43 +0900)
committerJinWang An <jinwang.an@samsung.com>
Thu, 18 Jan 2024 05:36:52 +0000 (14:36 +0900)
Change-Id: Ie17ff6a5c1f760c4d966acdafa602a982b09113b
Signed-off-by: JinWang An <jinwang.an@samsung.com>
src/itc/capi-system-system-settings/ITs-system-settings-common.c
src/itc/capi-system-system-settings/ITs-system-settings-common.h
src/itc/capi-system-system-settings/ITs-system-settings.c

index 557c2dcc36e59b45284f3023b4770dc9553ea6a7..04932c97e8b0242d94882f7d360fbffcd92b6d83 100755 (executable)
@@ -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;
index f377a705880af8ecbb18fe8c33633e0a40a713e8..c035c2399eb98225d3f26634684530234362e040 100755 (executable)
@@ -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"
index d44891c3ec840cb62940663e03d0f1578111df82..e0238d03c1f782e8086619c56c80e5f72455bc88 100755 (executable)
@@ -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;
                }