From 0411a94b816951db194af2e79ec9baf3035eb05c Mon Sep 17 00:00:00 2001 From: Jiyoung Yun Date: Thu, 7 May 2015 18:54:56 +0900 Subject: [PATCH] runtime-info: Remove internal enums Please refer to below ACR issue: http://168.219.209.56/jira/browse/ACR-108 Conflicts: src/runtime_info_location.c Change-Id: I668c6d9baab19b8dcf324c46ea4dbc7637ec4fd0 Signed-off-by: Jiyoung Yun --- include/runtime_info.h | 24 ------ src/runtime_info.c | 92 --------------------- src/runtime_info_connectivity.c | 39 --------- src/runtime_info_locale.c | 173 ---------------------------------------- src/runtime_info_location.c | 23 ------ src/runtime_info_system.c | 128 ----------------------------- 6 files changed, 479 deletions(-) delete mode 100644 src/runtime_info_locale.c diff --git a/include/runtime_info.h b/include/runtime_info.h index 6ce30da..603bc5e 100644 --- a/include/runtime_info.h +++ b/include/runtime_info.h @@ -46,32 +46,22 @@ typedef enum { * @brief Enumeration for keys for runtime information.. */ typedef enum { - RUNTIME_INFO_KEY_FLIGHT_MODE_ENABLED, /**<@internal Indicates whether the device is in flight mode. */ - RUNTIME_INFO_KEY_WIFI_STATUS, /**<@internal Indicates the current status of Wi-Fi. */ RUNTIME_INFO_KEY_BLUETOOTH_ENABLED, /**i = RUNTIME_INFO_WIFI_STATUS_DISABLED; - break; - - case VCONFKEY_WIFI_UNCONNECTED: - value->i = RUNTIME_INFO_WIFI_STATUS_UNCONNECTED; - break; - - case VCONFKEY_WIFI_CONNECTED: - case VCONFKEY_WIFI_TRANSFER: - value->i = RUNTIME_INFO_WIFI_STATUS_CONNECTED; - break; - - default: - return RUNTIME_INFO_ERROR_IO_ERROR; - } - - return RUNTIME_INFO_ERROR_NONE; -} - -int runtime_info_wifi_status_set_event_cb() -{ - return runtime_info_vconf_set_event_cb(VCONF_WIFI_STATUS, RUNTIME_INFO_KEY_WIFI_STATUS, 0); -} - -void runtime_info_wifi_status_unset_event_cb() -{ - runtime_info_vconf_unset_event_cb(VCONF_WIFI_STATUS, 0); -} - int runtime_info_bt_enabled_get_value(runtime_info_value_h value) { int vconf_value; diff --git a/src/runtime_info_locale.c b/src/runtime_info_locale.c deleted file mode 100644 index 36bc70c..0000000 --- a/src/runtime_info_locale.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include - -#include -#include - -#include -#include - -#ifdef LOG_TAG -#undef LOG_TAG -#endif - -#define LOG_TAG "CAPI_SYSTEM_RUNTIME_INFO" - -static const char *VCONF_24HOUR_FORMAT = VCONFKEY_REGIONFORMAT_TIME1224; -static const char *VCONF_FIRST_DAY_OF_WEEK = VCONFKEY_SETAPPL_WEEKOFDAY_FORMAT_INT; -static const char *VCONF_LANGUAGE = VCONFKEY_LANGSET; -static const char *VCONF_REGION = VCONFKEY_REGIONFORMAT; - -int runtime_info_24hour_format_get_value(runtime_info_value_h value) -{ - int vconf_value; - - if (runtime_info_vconf_get_value_int(VCONF_24HOUR_FORMAT, &vconf_value)) - return RUNTIME_INFO_ERROR_IO_ERROR; - - switch (vconf_value) { - case VCONFKEY_TIME_FORMAT_12: - value->b = false; - break; - - case VCONFKEY_TIME_FORMAT_24: - value->b = true; - break; - - default: - return RUNTIME_INFO_ERROR_IO_ERROR; - } - - return RUNTIME_INFO_ERROR_NONE; -} - -int runtime_info_24hour_format_set_event_cb() -{ - return runtime_info_vconf_set_event_cb(VCONF_24HOUR_FORMAT, RUNTIME_INFO_KEY_24HOUR_CLOCK_FORMAT_ENABLED, 0); -} - -void runtime_info_24hour_format_unset_event_cb() -{ - runtime_info_vconf_unset_event_cb(VCONF_24HOUR_FORMAT, 0); -} - -int runtime_info_first_day_of_week_get_value(runtime_info_value_h value) -{ - int vconf_value; - - if (runtime_info_vconf_get_value_int(VCONF_FIRST_DAY_OF_WEEK, &vconf_value)) - return RUNTIME_INFO_ERROR_IO_ERROR; - - switch (vconf_value) { - case SETTING_WEEKOFDAY_FORMAT_SUNDAY: - value->i = RUNTIME_INFO_FIRST_DAY_OF_WEEK_SUNDAY; - break; - - case SETTING_WEEKOFDAY_FORMAT_MONDAY: - value->i = RUNTIME_INFO_FIRST_DAY_OF_WEEK_MONDAY; - break; - - case SETTING_WEEKOFDAY_FORMAT_TUESDAY: - value->i = RUNTIME_INFO_FIRST_DAY_OF_WEEK_TUESDAY; - break; - - case SETTING_WEEKOFDAY_FORMAT_WEDNESDAY: - value->i = RUNTIME_INFO_FIRST_DAY_OF_WEEK_WEDNESDAY; - break; - - case SETTING_WEEKOFDAY_FORMAT_THURSDAY: - value->i = RUNTIME_INFO_FIRST_DAY_OF_WEEK_THURSDAY; - break; - - case SETTING_WEEKOFDAY_FORMAT_FRIDAY: - value->i = RUNTIME_INFO_FIRST_DAY_OF_WEEK_FRIDAY; - break; - - case SETTING_WEEKOFDAY_FORMAT_SATURDAY: - value->i = RUNTIME_INFO_FIRST_DAY_OF_WEEK_SATURDAY; - break; - - default: - return RUNTIME_INFO_ERROR_IO_ERROR; - } - - return RUNTIME_INFO_ERROR_NONE; -} - -int runtime_info_first_day_of_week_set_event_cb() -{ - return runtime_info_vconf_set_event_cb(VCONF_FIRST_DAY_OF_WEEK, RUNTIME_INFO_KEY_FIRST_DAY_OF_WEEK, 0); -} - -void runtime_info_first_day_of_week_unset_event_cb() -{ - runtime_info_vconf_unset_event_cb(VCONF_FIRST_DAY_OF_WEEK, 0); -} - -int runtime_info_language_get_value(runtime_info_value_h value) -{ - char *vconf_value; - char *token = NULL; - - if (runtime_info_vconf_get_value_string(VCONF_LANGUAGE, &vconf_value)) - return RUNTIME_INFO_ERROR_IO_ERROR; - - token = strchr(vconf_value, '.'); - - if(token) - *token = '\0'; - - value->s = vconf_value; - - return RUNTIME_INFO_ERROR_NONE; -} - -int runtime_info_language_set_event_cb() -{ - return runtime_info_vconf_set_event_cb(VCONF_LANGUAGE, RUNTIME_INFO_KEY_LANGUAGE, 0); -} - -void runtime_info_language_unset_event_cb() -{ - runtime_info_vconf_unset_event_cb(VCONF_LANGUAGE, 0); -} - -int runtime_info_region_get_value(runtime_info_value_h value) -{ - char *vconf_value; - - if (runtime_info_vconf_get_value_string(VCONF_REGION, &vconf_value)) - return RUNTIME_INFO_ERROR_IO_ERROR; - - value->s = vconf_value; - - return RUNTIME_INFO_ERROR_NONE; -} - -int runtime_info_region_set_event_cb() -{ - return runtime_info_vconf_set_event_cb(VCONF_REGION, RUNTIME_INFO_KEY_REGION, 0); -} - -void runtime_info_region_unset_event_cb() -{ - runtime_info_vconf_unset_event_cb(VCONF_REGION, 0); -} - diff --git a/src/runtime_info_location.c b/src/runtime_info_location.c index 11e4ba1..e276bd8 100644 --- a/src/runtime_info_location.c +++ b/src/runtime_info_location.c @@ -31,7 +31,6 @@ #define LOG_TAG "CAPI_SYSTEM_RUNTIME_INFO" static const char *VCONF_LOCATION_SERVICE_ENABLED = VCONFKEY_LOCATION_ENABLED; -static const char *VCONF_LOCATION_AGPS_ENABLED = VCONFKEY_LOCATION_AGPS_ENABLED; static const char *VCONF_LOCATION_NETWORK_ENABLED = VCONFKEY_LOCATION_NETWORK_ENABLED; int runtime_info_location_service_get_value(runtime_info_value_h value) @@ -56,28 +55,6 @@ void runtime_info_location_service_unset_event_cb() runtime_info_vconf_unset_event_cb(VCONF_LOCATION_SERVICE_ENABLED, 0); } -int runtime_info_location_agps_get_value(runtime_info_value_h value) -{ - int vconf_value; - int ret; - - ret = runtime_info_vconf_get_value_int(VCONF_LOCATION_AGPS_ENABLED, &vconf_value); - if (ret == RUNTIME_INFO_ERROR_NONE) - value->b = vconf_value; - - return ret; -} - -int runtime_info_location_agps_set_event_cb() -{ - return runtime_info_vconf_set_event_cb(VCONF_LOCATION_AGPS_ENABLED, RUNTIME_INFO_KEY_LOCATION_ADVANCED_GPS_ENABLED, 0); -} - -void runtime_info_location_agps_unset_event_cb() -{ - runtime_info_vconf_unset_event_cb(VCONF_LOCATION_AGPS_ENABLED, 0); -} - int runtime_info_location_network_get_value(runtime_info_value_h value) { int vconf_value; diff --git a/src/runtime_info_system.c b/src/runtime_info_system.c index 2838c2f..4a98a29 100644 --- a/src/runtime_info_system.c +++ b/src/runtime_info_system.c @@ -30,41 +30,16 @@ #define LOG_TAG "CAPI_SYSTEM_RUNTIME_INFO" -static const char *VCONF_FLIGHT_MODE = VCONFKEY_TELEPHONY_FLIGHT_MODE; static const char *VCONF_AUDIO_JACK = VCONFKEY_SYSMAN_EARJACK; -static const char *VCONF_SOUND_ENABLED = VCONFKEY_SETAPPL_SOUND_STATUS_BOOL; 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_AUDIO_JACK_STATUS = VCONFKEY_SYSMAN_EARJACK; -static const char *VCONF_SLIDING_KEYBOARD_STATUS = VCONFKEY_SYSMAN_SLIDING_KEYBOARD; static const char *VCONF_USB_CONNECTED = VCONFKEY_SYSMAN_USB_STATUS; static const char *VCONF_CHARGER_CONNECTED = VCONFKEY_SYSMAN_CHARGER_STATUS; -int runtime_info_flightmode_get_value(runtime_info_value_h value) -{ - int vconf_value; - - if (runtime_info_vconf_get_value_bool(VCONF_FLIGHT_MODE, &vconf_value)) - vconf_value = 0; - - value->b = (bool)vconf_value; - - return RUNTIME_INFO_ERROR_NONE; -} - -int runtime_info_flightmode_set_event_cb(void) -{ - return runtime_info_vconf_set_event_cb(VCONF_FLIGHT_MODE, RUNTIME_INFO_KEY_FLIGHT_MODE_ENABLED, 0); -} - -void runtime_info_flightmode_unset_event_cb(void) -{ - runtime_info_vconf_unset_event_cb(VCONF_FLIGHT_MODE, 0); -} - int runtime_info_audiojack_get_value(runtime_info_value_h value) { int vconf_value; @@ -98,45 +73,6 @@ void runtime_info_audiojack_unset_event_cb(void) runtime_info_vconf_unset_event_cb(VCONF_AUDIO_JACK, 0); } -int runtime_info_silent_mode_get_value(runtime_info_value_h value) -{ - int sound, vib; - - if (runtime_info_vconf_get_value_bool(VCONF_SOUND_ENABLED, &sound)) - return RUNTIME_INFO_ERROR_IO_ERROR; - - if (runtime_info_vconf_get_value_bool(VCONF_VIBRATION_ENABLED, &vib)) - return RUNTIME_INFO_ERROR_IO_ERROR; - - if (sound == 0 && vib == 0) - value->b = true; - else - value->b = false; - - return RUNTIME_INFO_ERROR_NONE; -} - -int runtime_info_silent_mode_set_event_cb(void) -{ - int ret; - - ret = runtime_info_vconf_set_event_cb(VCONF_SOUND_ENABLED, RUNTIME_INFO_KEY_SILENT_MODE_ENABLED, 0); - if (ret != RUNTIME_INFO_ERROR_NONE) - return ret; - - ret = runtime_info_vconf_set_event_cb(VCONF_VIBRATION_ENABLED, RUNTIME_INFO_KEY_SILENT_MODE_ENABLED, 1); - if (ret != RUNTIME_INFO_ERROR_NONE) - runtime_info_vconf_unset_event_cb(VCONF_SOUND_ENABLED, 0); - - return ret; -} - -void runtime_info_silent_mode_unset_event_cb(void) -{ - runtime_info_vconf_unset_event_cb(VCONF_SOUND_ENABLED, 0); - runtime_info_vconf_unset_event_cb(VCONF_VIBRATION_ENABLED, 1); -} - int runtime_info_vibration_enabled_get_value(runtime_info_value_h value) { int vconf_value; @@ -273,45 +209,6 @@ void runtime_info_audio_jack_status_unset_event_cb(void) runtime_info_vconf_unset_event_cb(VCONF_AUDIO_JACK_STATUS, 2); } - -int runtime_info_sliding_keyboard_opened_get_value(runtime_info_value_h value) -{ - int vconf_value; - - if (runtime_info_vconf_get_value_int(VCONF_SLIDING_KEYBOARD_STATUS, &vconf_value)) - vconf_value = VCONFKEY_SYSMAN_SLIDING_KEYBOARD_NOT_SUPPORTED; - - switch (vconf_value) { - case VCONFKEY_SYSMAN_SLIDING_KEYBOARD_NOT_AVAILABE: - value->b = false; - break; - - case VCONFKEY_SYSMAN_SLIDING_KEYBOAED_AVAILABLE: - value->b = true; - break; - - case VCONFKEY_SYSMAN_SLIDING_KEYBOARD_NOT_SUPPORTED: - value->b = false; - break; - - default: - return RUNTIME_INFO_ERROR_IO_ERROR; - } - - return RUNTIME_INFO_ERROR_NONE; -} - -int runtime_info_sliding_keyboard_opened_set_event_cb(void) -{ - return runtime_info_vconf_set_event_cb(VCONF_SLIDING_KEYBOARD_STATUS, RUNTIME_INFO_KEY_SLIDING_KEYBOARD_OPENED, 0); -} - -void runtime_info_sliding_keyboard_opened_unset_event_cb(void) -{ - runtime_info_vconf_unset_event_cb(VCONF_SLIDING_KEYBOARD_STATUS, 0); -} - - int runtime_info_usb_connected_get_value(runtime_info_value_h value) { int vconf_value; @@ -385,28 +282,3 @@ void runtime_info_charger_connected_unset_event_cb(void) { runtime_info_vconf_unset_event_cb(VCONF_CHARGER_CONNECTED, 0); } - - -int runtime_info_vibration_level_haptic_feedback_get_value(runtime_info_value_h value) -{ - int vconf_value; - - if (runtime_info_vconf_get_value_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, &vconf_value)) - return RUNTIME_INFO_ERROR_IO_ERROR; - - value->i = vconf_value; - - return RUNTIME_INFO_ERROR_NONE; -} - -int runtime_info_vibration_level_haptic_feedback_set_event_cb(void) -{ - return runtime_info_vconf_set_event_cb(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, RUNTIME_INFO_KEY_VIBRATION_LEVEL_HAPTIC_FEEDBACK, 0); -} - -void runtime_info_vibration_level_haptic_feedback_unset_event_cb(void) -{ - runtime_info_vconf_unset_event_cb(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, 0); -} - - -- 2.7.4