2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 #include "clock_vconf.h"
23 * Load vconf setting from vconf module,
24 * And save such information to data
26 * @param[out] data Pointer to the application data structure,
27 * which used for store vconf setting
29 * @return EINA_FALSE if load failed
30 * EINA_TRUE if load successfully.
32 Eina_Bool clock_vconf_load_history_conf(void *data)
39 struct appdata *ad = (struct appdata *)data;
43 // read history view id from vconf module
44 ref = vconf_get_int(VCONF_CLOCK_APPLICATION_ID, &app_id);
46 if (0 == ref && app_id >= 1 && app_id <= 4) {
47 ad->history_view_id = app_id;
48 CLK_INFO("\n\n\t <<<<<<<<<<<< application_id = %d\n", app_id);
50 // if there is no history information, set default value to 1
51 ad->history_view_id = 1;
59 * Save the system setting which read from app data structure,
60 * And save such information into vconf setting
62 * @param[in] data Pointer to the application data structure,
63 * which used for read setting used for store
65 * @return EINA_FALSE if save failed
66 * EINA_TRUE if save successfully.
68 Eina_Bool clock_vconf_set_history_conf(void *data)
75 struct appdata *ad = (struct appdata *)data;
77 int app_id = ad->current_view_id;
78 // set current view id to vconf sets
79 if (vconf_set_int(VCONF_CLOCK_APPLICATION_ID, app_id)) {
81 ("\n\n\t <<<<<<<<<<<< clock_vconf_set_history_app_name FAIL\n");
85 ("\n\n\t <<<<<<<<<<<< clock_vconf_set_history_app_name OK\n");
87 vconf_sync_key(VCONF_CLOCK_APPLICATION_ID);
95 * Check battery state for judging if battery low.
97 * @return EINA_FALSE if battery low
100 Eina_Bool clock_vconf_check_battery_low()
105 if (!vconf_get_int(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, &low_status)) {
106 CLK_INFO("\n\tbattery status low = %d\n", low_status);
107 if (low_status <= VCONFKEY_SYSMAN_BAT_WARNING_LOW) {