4 * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
8 * Jaewon Lim <jaewon81.lim@samsung.com>
9 * Woojin Jung <woojin2.jung@samsung.com>
10 * Juyoung Kim <j0.kim@samsung.com>
11 * Nikita Kalyazin <n.kalyazin@samsung.com>
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
17 * http://www.apache.org/licenses/LICENSE-2.0
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
27 * - Samsung RnD Institute Russia
34 #include "device_vconf.h"
36 int get_wifi_status(void)
41 res = vconf_get_int(VCONFKEY_WIFI_STATE, &wifi_status);
43 LOG_ONCE_W("get error #%d\n", res);
44 wifi_status = VCONFKEY_WIFI_OFF;
50 int get_bt_status(void)
55 res = vconf_get_int(VCONFKEY_BT_STATUS, &bt_status);
57 LOG_ONCE_W("get error #%d\n", res);
58 bt_status = VCONFKEY_BT_STATUS_OFF;
64 int get_gps_status(void)
69 res = vconf_get_int(VCONFKEY_LOCATION_ENABLED, &gps_status);
71 LOG_ONCE_W("get error #%d\n", res);
72 gps_status = VCONFKEY_LOCATION_GPS_OFF;
73 } else if (gps_status != 0) {
74 res = vconf_get_int(VCONFKEY_LOCATION_GPS_STATE, &gps_status);
76 LOG_ONCE_W("get error #%d\n", res);
77 gps_status = VCONFKEY_LOCATION_GPS_OFF;
84 int get_rssi_status(void)
87 int flightmode_status;
91 res = vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE,
94 LOG_ONCE_W("get err #%d <%s>\n", res,
95 VCONFKEY_TELEPHONY_FLIGHT_MODE);
96 flightmode_status = 0;
99 if (!flightmode_status) {
100 res = vconf_get_int(VCONFKEY_TELEPHONY_RSSI, &rssi_status);
102 LOG_ONCE_W("rssi get err #%d\n", res);
103 rssi_status = VCONFKEY_TELEPHONY_RSSI_0;
106 rssi_status = VCONFKEY_TELEPHONY_RSSI_0;
114 int get_call_status(void)
119 res = vconf_get_int(VCONFKEY_CALL_STATE, &call_status);
121 LOG_ONCE_W("get err #%d\n", res);
122 call_status = VCONFKEY_CALL_OFF;
128 int get_dnet_status(void)
133 res = vconf_get_int(VCONFKEY_DNET_STATE, &dnet_status);
135 LOG_ONCE_W("get err #%d <%s>\n", res, VCONFKEY_DNET_STATE);
136 dnet_status = VCONFKEY_DNET_OFF;
142 int get_camera_status(void)
144 int camera_status = 0;
146 if (vconf_get_int(VCONFKEY_CAMERA_STATE, &camera_status) < 0) {
147 camera_status = VCONFKEY_CAMERA_STATE_NULL;
150 return camera_status;
153 int get_sound_status(void)
155 int sound_status = 0;
158 res = vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL,
161 LOG_ONCE_W("get err #%d\n", res);
168 int get_audio_status(void)
173 res = vconf_get_int(VCONFKEY_SOUND_STATUS,
176 LOG_ONCE_W("get err #%d\n", res);
180 return !!audio_state;
183 int get_vibration_status(void)
185 int vibration_status = 0;
188 res = vconf_get_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL,
191 LOG_ONCE_W("get err #%d\n", res);
192 vibration_status = 0;
195 return vibration_status;