static const char *VCONF_FLIGHT_MODE = VCONFKEY_TELEPHONY_FLIGHT_MODE;
static const char *VCONF_AUDIO_JACK = VCONFKEY_SYSMAN_EARJACK;
-static const char *VCONF_SILENT_MODE = "db/setting/sound/sound_on";
-static const char *VCONF_VIBRATION_ENABLED = "db/setting/sound/vibration_on";
+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;
int runtime_info_flightmode_get_value(runtime_info_value_h value)
{
- bool vconf_value;
+ int vconf_value;
if (runtime_info_vconf_get_value_bool(VCONF_FLIGHT_MODE, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = 0;
- value->b = vconf_value;
+ value->b = (bool)vconf_value;
return RUNTIME_INFO_ERROR_NONE;
}
int vconf_value;
if (runtime_info_vconf_get_value_int(VCONF_AUDIO_JACK, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = VCONFKEY_SYSMAN_EARJACK_REMOVED;
switch (vconf_value) {
case VCONFKEY_SYSMAN_EARJACK_3WIRE:
int runtime_info_silent_mode_get_value(runtime_info_value_h value)
{
- bool vconf_value;
+ int sound, vib;
- if (runtime_info_vconf_get_value_bool(VCONF_SILENT_MODE, &vconf_value))
+ if (runtime_info_vconf_get_value_bool(VCONF_SOUND_ENABLED, &sound))
return RUNTIME_INFO_ERROR_IO_ERROR;
- value->b = vconf_value;
+ 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)
{
- return runtime_info_vconf_set_event_cb(VCONF_SILENT_MODE, RUNTIME_INFO_KEY_SILENT_MODE_ENABLED, 0);
+ 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_SILENT_MODE, 0);
+ 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)
{
- bool vconf_value;
+ int vconf_value;
if (runtime_info_vconf_get_value_bool(VCONF_VIBRATION_ENABLED, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = 0;
- value->b = vconf_value;
+ value->b = (bool)vconf_value;
return RUNTIME_INFO_ERROR_NONE;
}
int runtime_info_auto_rotation_enabled_get_value(runtime_info_value_h value)
{
- bool vconf_value;
+ int vconf_value;
if (runtime_info_vconf_get_value_bool(VCONF_ROTATION_LOCK_ENABLED, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = 0;
- value->b = vconf_value;
+ value->b = (bool)vconf_value;
return RUNTIME_INFO_ERROR_NONE;
}
if (runtime_info_vconf_get_value_int(VCONF_BATTERY_CHARGING, &vconf_value))
return RUNTIME_INFO_ERROR_IO_ERROR;
+ /* regard not supported as disconnected */
+ if (vconf_value == -ENOTSUP)
+ vconf_value = false;
+
value->b = vconf_value;
return RUNTIME_INFO_ERROR_NONE;
int vconf_value;
if (runtime_info_vconf_get_value_int(VCONF_TVOUT_CONNECTED, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = VCONFKEY_SYSMAN_EARJACK_REMOVED;
switch (vconf_value) {
case VCONFKEY_SYSMAN_EARJACK_TVOUT:
int vconf_value;
if (runtime_info_vconf_get_value_int(VCONF_AUDIO_JACK_STATUS, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = VCONFKEY_SYSMAN_EARJACK_REMOVED;
switch (vconf_value) {
case VCONFKEY_SYSMAN_EARJACK_3WIRE:
int vconf_value;
if (runtime_info_vconf_get_value_int(VCONF_SLIDING_KEYBOARD_STATUS, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = VCONFKEY_SYSMAN_SLIDING_KEYBOARD_NOT_SUPPORTED;
switch (vconf_value) {
case VCONFKEY_SYSMAN_SLIDING_KEYBOARD_NOT_AVAILABE:
int vconf_value;
if (runtime_info_vconf_get_value_int(VCONF_USB_CONNECTED, &vconf_value))
- return RUNTIME_INFO_ERROR_IO_ERROR;
+ vconf_value = VCONFKEY_SYSMAN_USB_DISCONNECTED;
switch (vconf_value) {
case VCONFKEY_SYSMAN_USB_DISCONNECTED:
switch (vconf_value) {
case VCONFKEY_SYSMAN_CHARGER_DISCONNECTED:
+ /* regard not supported as disconnected */
+ case -ENOTSUP:
value->b = false;
break;
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;
+ value->i = vconf_value;
return RUNTIME_INFO_ERROR_NONE;
}