Fix the vconfkey related with TV out
[platform/core/api/runtime-info.git] / src / runtime_info_system.c
index 2761305..74f0ffe 100644 (file)
@@ -28,7 +28,7 @@ static const char *VCONF_AUDIO_JACK = VCONFKEY_SYSMAN_EARJACK;
 static const char *VCONF_VIBRATION_ENABLED = VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL;
 static const char *VCONF_ROTATION_LOCK_ENABLED = VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL;
 static const char *VCONF_BATTERY_CHARGING = VCONFKEY_SYSMAN_BATTERY_CHARGE_NOW;
-static const char *VCONF_TVOUT_CONNECTED = VCONFKEY_SYSMAN_EARJACK;
+static const char *VCONF_TVOUT_CONNECTED = VCONFKEY_SYSMAN_HDMI;
 static const char *VCONF_AUDIO_JACK_STATUS = VCONFKEY_SYSMAN_EARJACK;
 static const char *VCONF_USB_CONNECTED = VCONFKEY_SYSMAN_USB_STATUS;
 static const char *VCONF_CHARGER_CONNECTED = VCONFKEY_SYSMAN_CHARGER_STATUS;
@@ -140,30 +140,20 @@ int runtime_info_tvout_connected_get_value(runtime_info_value_h value)
        int ret;
 
        ret = runtime_info_vconf_get_value_int(VCONF_TVOUT_CONNECTED, &vconf_value);
-       if (ret != RUNTIME_INFO_ERROR_NONE)
-               return ret;
-
-       switch (vconf_value) {
-       case VCONFKEY_SYSMAN_EARJACK_TVOUT:
-               value->b = true;
-               break;
-
-       default:
-               value->b = false;
-               break;
-       }
+       if (ret == RUNTIME_INFO_ERROR_NONE)
+               value->b = vconf_value;
 
        return ret;
 }
 
 int runtime_info_tvout_connected_set_event_cb(void)
 {
-       return runtime_info_vconf_set_event_cb(VCONF_TVOUT_CONNECTED, RUNTIME_INFO_KEY_TV_OUT_CONNECTED, 1);
+       return runtime_info_vconf_set_event_cb(VCONF_TVOUT_CONNECTED, RUNTIME_INFO_KEY_TV_OUT_CONNECTED, 0);
 }
 
 void runtime_info_tvout_connected_unset_event_cb(void)
 {
-       runtime_info_vconf_unset_event_cb(VCONF_TVOUT_CONNECTED, 1);
+       runtime_info_vconf_unset_event_cb(VCONF_TVOUT_CONNECTED, 0);
 }
 
 
@@ -292,6 +282,8 @@ int runtime_info_get_frequency_cpufreq(int core_idx, char *type, int *cpu_freq)
        snprintf(path, sizeof(path), "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_%s_freq",
                        core_idx, type);
        cpufreq_fp = fopen(path, "r");
+
+       //LCOV_EXCL_START : fallback routine
        if (cpufreq_fp == NULL) {
                if (core_idx > 0) {
                        _I("Fail to get the information about core%d. Get the core0's instead",
@@ -307,12 +299,15 @@ int runtime_info_get_frequency_cpufreq(int core_idx, char *type, int *cpu_freq)
                        return RUNTIME_INFO_ERROR_IO_ERROR;
                }
        }
+       //LCOV_EXCL_STOP
 
        if (!fscanf(cpufreq_fp, "%d", &result)) {
+               //LCOV_EXCL_START : system error
                _E("IO_ERROR(0x%08x) : there is no information in the cpuinfo file",
                                RUNTIME_INFO_ERROR_IO_ERROR);
                fclose(cpufreq_fp);
                return RUNTIME_INFO_ERROR_IO_ERROR;
+               //LCOV_EXCL_STOP
        }
 
        *cpu_freq = result / 1000;
@@ -320,6 +315,7 @@ int runtime_info_get_frequency_cpufreq(int core_idx, char *type, int *cpu_freq)
        return RUNTIME_INFO_ERROR_NONE;
 }
 
+//LCOV_EXCL_START : fallback routine
 int runtime_info_get_frequency_cpuinfo(int core_idx, int *cpu_freq)
 {
        FILE *cpuinfo_fp;
@@ -361,5 +357,6 @@ int runtime_info_get_frequency_cpuinfo(int core_idx, int *cpu_freq)
        }
 
        fclose(cpuinfo_fp);
-       return RUNTIME_INFO_ERROR_NOT_SUPPORTED;
+       return RUNTIME_INFO_ERROR_NO_DATA;
 }
+//LCOV_EXCL_STOP