3 * Copyright 2012 Samsung Electronics Co., Ltd
5 * Licensed under the Flora License, Version 1.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.tizenopensource.org/license
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
21 #include "clock_vconf.h"
24 * Load vconf setting from vconf module,
25 * And save such information to data
27 * @param[out] data Pointer to the application data structure,
28 * which used for store vconf setting
30 * @return EINA_FALSE if load failed
31 * EINA_TRUE if load successfully.
33 Eina_Bool clock_vconf_load_history_conf(void *data)
40 struct appdata *ad = (struct appdata *)data;
44 // read history view id from vconf module
45 ref = vconf_get_int(VCONF_CLOCK_APPLICATION_ID, &app_id);
47 if (0 == ref && app_id >= 1 && app_id <= 4) {
48 ad->history_view_id = app_id;
49 CLK_INFO("\n\n\t <<<<<<<<<<<< application_id = %d\n", app_id);
51 // if there is no history information, set default value to 1
52 ad->history_view_id = 1;
60 * Save the system setting which read from app data structure,
61 * And save such information into vconf setting
63 * @param[in] data Pointer to the application data structure,
64 * which used for read setting used for store
66 * @return EINA_FALSE if save failed
67 * EINA_TRUE if save successfully.
69 Eina_Bool clock_vconf_set_history_conf(void *data)
76 struct appdata *ad = (struct appdata *)data;
78 int app_id = ad->current_view_id;
79 // set current view id to vconf sets
80 if (vconf_set_int(VCONF_CLOCK_APPLICATION_ID, app_id)) {
82 ("\n\n\t <<<<<<<<<<<< clock_vconf_set_history_app_name FAIL\n");
86 ("\n\n\t <<<<<<<<<<<< clock_vconf_set_history_app_name OK\n");
88 vconf_sync_key(VCONF_CLOCK_APPLICATION_ID);
96 * Check battery state for judging if battery low.
98 * @return EINA_FALSE if battery low
101 Eina_Bool clock_vconf_check_battery_low()
106 if (!vconf_get_int(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, &low_status)) {
107 CLK_INFO("\n\tbattery status low = %d\n", low_status);
108 if (low_status <= VCONFKEY_SYSMAN_BAT_WARNING_LOW) {