#define VCONF_KEY_FMRADIO_RECORDING "memory/private/Sound/FMRadioRecording"
-struct _control_s_info{
+struct _control_s_info {
Eina_Bool is_deleting;
Eina_Bool is_launching;
Eina_Bool is_new;
.current_angle = 0,
.viewport_width = 0,
- .viewport_height= 0,
+ .viewport_height = 0,
.time_for_safety_limit = 0,
.sound_type_at_show = SOUND_TYPE_RINGTONE,
Eina_Bool volume_control_viewport_is_warning_visible(void)
{
- return control_info.is_warning_visible;
+ return control_info.is_warning_visible;
}
volume_error_e volume_control_cache_flush(void)
}
ret = app_control_set_app_id(app_control, pkgname);
- if (ret != 0)
- {
+ if (ret != 0) {
_E("Failed to set appid");
app_control_destroy(app_control);
return VOLUME_ERROR_FAIL;
}
ret = app_control_add_extra_data(app_control, op_type, operation);
- if (ret != 0)
- {
+ if (ret != 0) {
_E("Failed to add extra data");
app_control_destroy(app_control);
return VOLUME_ERROR_FAIL;
int pm_state = VCONFKEY_PM_STATE_NORMAL;
/* Check Idle-Lock */
- if(vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, &lock) < 0)
- {
+ if (vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, &lock) < 0) {
_E("Failed to get vconfkey : VCONFKEY_IDLE_LOCK_STATE");
return IDLELOCK_ERROR;
}
_D("idlelock vconf : %d", lock);
/* Check PM state */
- if(vconf_get_int(VCONFKEY_PM_STATE, &pm_state) < 0)
- {
+ if (vconf_get_int(VCONFKEY_PM_STATE, &pm_state) < 0) {
_E("Failed to get vconfkey : VCONFKEY_PM_STATE");
return IDLELOCK_ERROR;
}
_D("lock : %d / sound_type : %d", *lock, *sound_type);
- if (*lock == IDLELOCK_ON)
- {
- if (*sound_type == SOUND_TYPE_RINGTONE)
- {
+ if (*lock == IDLELOCK_ON) {
+ if (*sound_type == SOUND_TYPE_RINGTONE) {
_D("IDLELOCK is ON / sound type is Ringtone");
return LOCK_AND_NOT_MEDIA;
}
- if (*sound_type != SOUND_TYPE_RINGTONE)
- {
+ if (*sound_type != SOUND_TYPE_RINGTONE) {
_D("IDLELOCK is ON / sound type is not Ringtone(media or alaram)");
return LOCK_AND_MEDIA;
}
if (status == LOCK_AND_NOT_MEDIA) {
_D("Lock and Not Media");
if (evas_object_visible_get(win)) {
- if (VOLUME_ERROR_OK != volume_control_hide_view()) {
+ if (VOLUME_ERROR_OK != volume_control_hide_view())
_E("Failed to close volume");
- }
- if (VOLUME_ERROR_OK != volume_control_cache_flush()) {
+ if (VOLUME_ERROR_OK != volume_control_cache_flush())
_E("Failed to flush cache");
- }
}
return EINA_FALSE;
} else {
_D("LOCK_AND_MEDIA");
} else {
_D("UNLOCK");
- if (VOLUME_ERROR_OK != volume_view_change_slider_by_type(sound_type, bt_opened, earphone_connected)) {
+ if (VOLUME_ERROR_OK != volume_view_change_slider_by_type(sound_type, bt_opened, earphone_connected))
_E("Failed to changed max volume");
- }
- if(VOLUME_ERROR_OK != volume_view_window_show(sound_type)) {
+ if (VOLUME_ERROR_OK != volume_view_window_show(sound_type))
_E("Failed to show volume window");
- }
+
ecore_timer_add(0.1f, _volume_region_set_timer_cb, win);
control_info.is_launching = EINA_TRUE;
- if (bt_opened == 1 && sound_type == SOUND_TYPE_CALL) {
+ if (bt_opened == 1 && sound_type == SOUND_TYPE_CALL)
volume = bt_get_bt_volume();
- } else {
+ else {
volume = volume_sound_sound_manager_volume_get(sound_type);
_D("volume value: %d", volume);
vibration = volume_sound_vconf_status_get(TYPE_VCONF_VIBRATION_STATUS);
_D("vibration : %d", vibration);
- if(sound == 0 && sound_type == SOUND_TYPE_RINGTONE) {
+ if ((vibration == 1 && sound == 0) && sound_type == SOUND_TYPE_RINGTONE)
volume = 0;
- }
- if(VOLUME_ERROR_OK != volume_view_slider_value_set(volume)) {
+ if (VOLUME_ERROR_OK != volume_view_slider_value_set(volume))
_E("Failed to set volume value to slider");
- }
+
volume_view_volume_icon_set(sound_type, sound, vibration, bt_opened);
volume_view_volume_icon_name_set_for_access(sound_type);
}
control_info.is_deleting = EINA_TRUE;
/* hide window */
- if (VOLUME_ERROR_OK != volume_view_window_hide()) {
+ if (VOLUME_ERROR_OK != volume_view_window_hide())
_E("Failed to hide window");
- }
control_info.is_deleting = EINA_FALSE;
volume_timer_del(TYPE_TIMER_WARNING_POPUP);
/* hide window */
- if (VOLUME_ERROR_OK != volume_view_window_hide()) {
+ if (VOLUME_ERROR_OK != volume_view_window_hide())
_E("Failed to hide window");
- }
control_info.is_deleting = EINA_FALSE;
control_info.is_launching = EINA_FALSE;
void volume_control_register_vconfkey(void)
{
/* other app grab volume key => close volume */
- if (vconf_notify_key_changed(VCONFKEY_STARTER_USE_VOLUME_KEY, _starter_user_volume_key_vconf_changed_cb, NULL) != 0) {
+ if (vconf_notify_key_changed(VCONFKEY_STARTER_USE_VOLUME_KEY, _starter_user_volume_key_vconf_changed_cb, NULL) != 0)
_E("Failed to register callback function : VCONFKEY_STARTER_USE_VOLUME_KEY");
- }
/* Lock screen status vconf changed callback */
- if (vconf_notify_key_changed(VCONFKEY_IDLE_LOCK_STATE, _idle_lock_state_vconf_changed_cb, NULL) != 0) {
+ if (vconf_notify_key_changed(VCONFKEY_IDLE_LOCK_STATE, _idle_lock_state_vconf_changed_cb, NULL) != 0)
_E("Failed to notify vconfkey : VCONFKEY_IDLE_LOCK_STATE");
- }
- if (vconf_notify_key_changed(VCONFKEY_PM_LCDOFF_SOURCE, _notify_pm_lcdoff_cb, NULL) != 0) {
+ if (vconf_notify_key_changed(VCONFKEY_PM_LCDOFF_SOURCE, _notify_pm_lcdoff_cb, NULL) != 0)
_E("Failed to notify vconfkey : VCONFKEY_PM_LCDOFF_SOURCE");
- }
}
void volume_control_unregister_vconfkey(void)
{
/* other app grab volume key => close volume */
- if (vconf_ignore_key_changed(VCONFKEY_STARTER_USE_VOLUME_KEY, _starter_user_volume_key_vconf_changed_cb) < 0) {
+ if (vconf_ignore_key_changed(VCONFKEY_STARTER_USE_VOLUME_KEY, _starter_user_volume_key_vconf_changed_cb) < 0)
_E("Failed to ignore vconfkey : VCONFKEY_STARTER_USE_VOLUME_KEY");
- }
/* Lock screen status vconf changed callback */
- if (vconf_ignore_key_changed(VCONFKEY_IDLE_LOCK_STATE, _idle_lock_state_vconf_changed_cb) < 0) {
+ if (vconf_ignore_key_changed(VCONFKEY_IDLE_LOCK_STATE, _idle_lock_state_vconf_changed_cb) < 0)
_E("Failed to ignore vconfkey : VCONFKEY_IDLE_LOCK_STATE");
- }
if (vconf_ignore_key_changed
(VCONFKEY_PM_LCDOFF_SOURCE, _notify_pm_lcdoff_cb) != 0) {
retv_if(!win, VOLUME_ERROR_FAIL);
if (evas_object_visible_get(win)) {
- if(VOLUME_ERROR_OK != volume_control_hide_view()) {
+ if (VOLUME_ERROR_OK != volume_control_hide_view())
_E("Failed to close volume");
- }
- if (VOLUME_ERROR_OK != volume_control_cache_flush()) {
+ if (VOLUME_ERROR_OK != volume_control_cache_flush())
_E("Failed to flush cache");
- }
}
return VOLUME_ERROR_OK;
_D("sound status : %d", sound);
error = bt_ag_is_sco_opened(&bt_opened);
- if (error != BT_ERROR_NONE) {
+ if (error != BT_ERROR_NONE)
_E("bt_ag_is_sco_opened return [%d]", error);
- }
+
earphone_connected = earphone_get_earphone_is_connected();
_D("BT state %d, Earphone state: %d", bt_opened, earphone_connected);
retv_if(!win, VOLUME_ERROR_FAIL);
/* Create volume layout */
- if(VOLUME_ERROR_OK != volume_view_layout_create(win)) {
+ if (VOLUME_ERROR_OK != volume_view_layout_create(win)) {
_E("Failed to create volume layout");
return VOLUME_ERROR_FAIL;
}
tzsh_region_h rect = NULL;
int ret = 0;
- int x, y, w ,h;
+ int x, y, w, h;
int tmp_x;
int tmp_y;
int tmp_w;
y = tmp_x;
w = tmp_h;
h = tmp_w;
- }
- else if (current_angle == 270) {
+ } else if (current_angle == 270) {
tmp_x = x;
tmp_y = y;
tmp_w = w;
ret_if(!ly_outer);
_D("window rotated [%d] => [%d]", current_angle, changed_angle);
- if(current_angle != changed_angle) {
+ if (current_angle != changed_angle) {
current_angle = changed_angle;
control_info.current_angle = current_angle;
- switch(current_angle){
- case 90 :
- case 270 :
+ switch (current_angle) {
+ case 90:
+ case 270:
_D("show,landscape");
elm_object_signal_emit(ly_outer, "show,landscape", "bg");
break;
- default :
+ default:
_D("show,portrait");
elm_object_signal_emit(ly_outer, "show,portrait", "bg");
break;
{
int ret = EINA_FALSE;
- if(vconf_get_int(VCONFKEY_STARTER_USE_VOLUME_KEY, &ret) < 0)
- {
+ if (vconf_get_int(VCONFKEY_STARTER_USE_VOLUME_KEY, &ret) < 0) {
_E("Failed to get vconfkey : VCONFKEY_STARTER_USE_VOLUME_KEY");
return;
}
_D("ret : %d", ret);
- if(ret == 1)
- {
+ if (ret == 1) {
_D("any other App grab volume hard key");
- if(VOLUME_ERROR_OK != volume_control_hide_view()) {
+ if (VOLUME_ERROR_OK != volume_control_hide_view()) {
_E("Failed to close volume");
return;
}
- if(VOLUME_ERROR_OK != volume_control_cache_flush()) {
+ if (VOLUME_ERROR_OK != volume_control_cache_flush()) {
_E("Failed to flush cache");
return;
}
- if(vconf_set_int(VCONFKEY_STARTER_USE_VOLUME_KEY, 0) < 0) {
+ if (vconf_set_int(VCONFKEY_STARTER_USE_VOLUME_KEY, 0) < 0) {
_E("Failed to get vconfkey : VCONFKEY_STATER_USE_VOLUME_KEY");
return;
}
- }
- else if(ret == 2)
- {
+ } else if (ret == 2) {
_D("setting App grab volume hard key");
}
}
{
int lock = VCONFKEY_IDLE_UNLOCK;
- if(vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, &lock) < 0)
- {
+ if (vconf_get_int(VCONFKEY_IDLE_LOCK_STATE, &lock) < 0) {
_E("Failed to get vconfkey : VCONFKEY_IDLE_LOCK_STATE");
return;
}
_D("idle lock state : %d", lock);
- if(lock == VCONFKEY_IDLE_LAUNCHING_LOCK)
- {
- if(VOLUME_ERROR_OK != volume_view_window_hide())
- {
+ if (lock == VCONFKEY_IDLE_LAUNCHING_LOCK) {
+ if (VOLUME_ERROR_OK != volume_view_window_hide())
_E("Failed to hide window");
- }
}
}
static void _notify_pm_lcdoff_cb(keynode_t * node, void *data)
{
- if (volume_view_warning_popup_get()) {
+ if (volume_view_warning_popup_get())
volume_view_destroy_warning_popup();
- }
- if(VOLUME_ERROR_OK != volume_control_hide_view())
- {
+ if (VOLUME_ERROR_OK != volume_control_hide_view())
_E("Failed to close volume");
- }
- if(VOLUME_ERROR_OK != volume_control_cache_flush())
- {
+ if (VOLUME_ERROR_OK != volume_control_cache_flush())
_E("Failed to flush cache");
- }
}