From 6f5bb074d6c1acfdc42ab867302571c3feda44c6 Mon Sep 17 00:00:00 2001 From: junkyu han Date: Fri, 5 Jan 2018 11:39:40 +0900 Subject: [PATCH] Fix Coding rule non-compliance Change-Id: I88b714f227da3b1517089bc6b3e8b6eca1049b08 --- inc/_util_log.h | 14 +-- inc/control.h | 2 +- inc/timer.h | 2 +- src/bt.c | 13 +- src/control.c | 136 ++++++++------------- src/earphone.c | 23 ++-- src/key_event.c | 126 +++++++++---------- src/main.c | 6 +- src/sound.c | 18 ++- src/timer.c | 27 ++-- src/view.c | 77 ++++++------ test/test_main.c | 3 +- .../unit_test_group_test/unit_test_group.c | 8 +- test/unit/unit_test/unit_test_main.c | 3 +- 14 files changed, 188 insertions(+), 270 deletions(-) diff --git a/inc/_util_log.h b/inc/_util_log.h index 8beebb2..e6ab19c 100755 --- a/inc/_util_log.h +++ b/inc/_util_log.h @@ -39,11 +39,11 @@ #define _E(format, arg...) LOG_V(DLOG_ERROR, LOG_TAG, format, ##arg) #define _F(format, arg...) LOG_V(DLOG_FATAL, LOG_TAG, format, ##arg) -#define _SECURE_E(fmt, arg...) SECURE_LOGE("[%s:%d] "fmt,__FUNCTION__,__LINE__,##arg) -#define _SECURE_D(fmt, arg...) SECURE_LOGD("[%s:%d] "fmt,__FUNCTION__,__LINE__,##arg) +#define _SECURE_E(fmt, arg...) SECURE_LOGE("[%s:%d] "fmt, __FUNCTION__, __LINE__, ##arg) +#define _SECURE_D(fmt, arg...) SECURE_LOGD("[%s:%d] "fmt, __FUNCTION__, __LINE__, ##arg) #define retvm_if_timer(timer, expr, val, fmt, arg...) do { \ - if(expr) { \ + if (expr) { \ _E(fmt, ##arg); \ _E("(%s) -> %s() return", #expr, __FUNCTION__); \ timer = NULL; \ @@ -52,7 +52,7 @@ } while (0) #define retvm_if(expr, val, fmt, arg...) do { \ - if(expr) { \ + if (expr) { \ _E(fmt, ##arg); \ _E("(%s) -> %s() return", #expr, __FUNCTION__); \ return (val); \ @@ -60,14 +60,14 @@ } while (0) #define retv_if(expr, val) do { \ - if(expr) { \ + if (expr) { \ _E("(%s) -> %s() return", #expr, __FUNCTION__); \ return (val); \ } \ } while (0) #define retm_if(expr, fmt, arg...) do { \ - if(expr) { \ + if (expr) { \ _E(fmt, ##arg); \ _E("(%s) -> %s() return", #expr, __FUNCTION__); \ return; \ @@ -75,7 +75,7 @@ } while (0) #define ret_if(expr) do { \ - if(expr) { \ + if (expr) { \ _E("(%s) -> %s() return", #expr, __FUNCTION__); \ return; \ } \ diff --git a/inc/control.h b/inc/control.h index 85b295f..007aba3 100755 --- a/inc/control.h +++ b/inc/control.h @@ -25,7 +25,7 @@ enum { }; /* _check_status() return value */ -enum{ +enum { LOCK_AND_NOT_MEDIA = -0x1, UNLOCK_STATUS, LOCK_AND_MEDIA, diff --git a/inc/timer.h b/inc/timer.h index 355daa1..580cfe6 100755 --- a/inc/timer.h +++ b/inc/timer.h @@ -24,7 +24,7 @@ x = NULL;\ } #define ADD_TIMER(x, time, _timer_cb, data) \ - if(x != NULL) DEL_TIMER(x); \ + if (x != NULL) DEL_TIMER(x); \ x = ecore_timer_add(time, _timer_cb, data);\ _D("ADDTIMER x : %p\n", x);\ diff --git a/src/bt.c b/src/bt.c index 9e4164b..82d6acf 100644 --- a/src/bt.c +++ b/src/bt.c @@ -42,8 +42,8 @@ int bt_get_bt_volume(void) int bt_vol = 0; ret = bt_ag_get_speaker_gain(&bt_vol); - if (ret != BT_ERROR_NONE) - { + + if (ret != BT_ERROR_NONE) { _E("bt_ag_get_speaker_gain Failed"); return -1; } @@ -101,8 +101,7 @@ static void _bt_volume_changed_cb(int volume, void *user_data) _E("bt_ag_is_sco_opened return [%d]", error); _D("BT state %d", bt_opened); - if (bt_opened == true && sound_type == SOUND_TYPE_CALL) - { + if (bt_opened == true && sound_type == SOUND_TYPE_CALL) { _bt_display_bt_volume_view(sound_type, sound, vibration, bt_opened); _D("BT SCO volume level is : %d", volume); if (VOLUME_ERROR_OK != volume_view_slider_value_set(volume)) @@ -122,15 +121,13 @@ static int _bt_register_changed_cb(void) int ret = 0; ret = bt_audio_initialize(); - if (ret != BT_ERROR_NONE) - { + if (ret != BT_ERROR_NONE) { _E("bt audio initialize failed"); return -1; } ret = bt_ag_set_speaker_gain_changed_cb(_bt_volume_changed_cb, NULL); - if (ret != BT_ERROR_NONE) - { + if (ret != BT_ERROR_NONE) { _E("register bt volume changed callback failed"); return -1; } diff --git a/src/control.c b/src/control.c index e7bb9c2..ec9c102 100755 --- a/src/control.c +++ b/src/control.c @@ -37,7 +37,7 @@ #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; @@ -64,7 +64,7 @@ static struct _control_s_info control_info = { .current_angle = 0, .viewport_width = 0, - .viewport_height= 0, + .viewport_height = 0, .time_for_safety_limit = 0, .sound_type_at_show = SOUND_TYPE_RINGTONE, @@ -150,7 +150,7 @@ Eina_Bool volume_control_get_time_for_safety_limit(void) 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) @@ -205,16 +205,14 @@ volume_error_e volume_control_app_launch_with_bundle(const char *op_type, const } 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; @@ -234,16 +232,14 @@ int volume_control_get_vconf_idlelock(void) 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; } @@ -262,16 +258,13 @@ int volume_control_check_status(int *lock, sound_type_e *sound_type) _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; } @@ -310,13 +303,11 @@ Eina_Bool volume_control_show_view(int status, sound_type_e sound_type, int soun 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 { @@ -324,32 +315,30 @@ Eina_Bool volume_control_show_view(int status, sound_type_e sound_type, int soun _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); } @@ -368,9 +357,8 @@ volume_error_e volume_control_close_bt_display(void) 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; @@ -395,9 +383,8 @@ volume_error_e volume_control_hide_view(void) 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; @@ -410,31 +397,26 @@ volume_error_e volume_control_hide_view(void) 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) { @@ -448,13 +430,11 @@ volume_error_e volume_control_pause(void) 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; @@ -486,9 +466,9 @@ volume_error_e volume_control_reset(bundle *b) _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); @@ -516,7 +496,7 @@ volume_error_e volume_control_initialize(void) 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; } @@ -578,7 +558,7 @@ static void _volume_service_region_set(Evas_Object *win, Evas_Object *warning_po 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; @@ -612,8 +592,7 @@ static void _volume_service_region_set(Evas_Object *win, Evas_Object *warning_po 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; @@ -650,16 +629,16 @@ static void _rotate_changed_cb(void *data, Evas_Object *obj, void *event_info) 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; @@ -690,31 +669,27 @@ static void _starter_user_volume_key_vconf_changed_cb(keynode_t *key, void *data { 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"); } } @@ -723,35 +698,26 @@ static void _idle_lock_state_vconf_changed_cb(keynode_t *key, void *data) { 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"); - } } diff --git a/src/earphone.c b/src/earphone.c index c0386a1..2daca39 100644 --- a/src/earphone.c +++ b/src/earphone.c @@ -28,21 +28,20 @@ static void _volume_earphone_changed_cb(keynode_t *node, void *data) int ret; ret = vconf_get_int(VCONFKEY_SYSMAN_EARJACK, &status); - if (ret < 0) { + if (ret < 0) return; - } switch (status) { - case VCONFKEY_SYSMAN_EARJACK_3WIRE: - case VCONFKEY_SYSMAN_EARJACK_4WIRE: - case VCONFKEY_SYSMAN_EARJACK_TVOUT: - _D("Earphone is connected"); - earphone_is_connected = 1; - break; - default: - _D("Earphone is disconnected"); - earphone_is_connected = 0; - break; + case VCONFKEY_SYSMAN_EARJACK_3WIRE: + case VCONFKEY_SYSMAN_EARJACK_4WIRE: + case VCONFKEY_SYSMAN_EARJACK_TVOUT: + _D("Earphone is connected"); + earphone_is_connected = 1; + break; + default: + _D("Earphone is disconnected"); + earphone_is_connected = 0; + break; } } diff --git a/src/key_event.c b/src/key_event.c index d9004d2..20c88bd 100755 --- a/src/key_event.c +++ b/src/key_event.c @@ -92,10 +92,10 @@ Eina_Bool volume_key_event_is_pressing_get(void) void volume_key_event_handler_add(void) { - if(!key_event_info.handler_volume_up) + if (!key_event_info.handler_volume_up) key_event_info.handler_volume_up = ecore_event_handler_add(ECORE_EVENT_KEY_UP, _key_release_cb, NULL); - if(!key_event_info.handler_volume_down) + if (!key_event_info.handler_volume_down) key_event_info.handler_volume_down = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _key_press_cb, NULL); } @@ -103,7 +103,7 @@ void volume_key_event_handler_del(void) { ret_if(key_event_info.handler_volume_up == NULL); ecore_event_handler_del(key_event_info.handler_volume_up); - key_event_info.handler_volume_up= NULL; + key_event_info.handler_volume_up = NULL; ret_if(key_event_info.handler_volume_down == NULL); ecore_event_handler_del(key_event_info.handler_volume_down); @@ -128,9 +128,8 @@ static volume_error_e _mute_key_press() _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(); @@ -204,8 +203,7 @@ static volume_error_e _volume_up_key_press(int status, sound_type_e sound_type, _D("mute -> vib."); volume_sound_vconf_status_set(TYPE_VCONF_VIBRATION_STATUS, 1); volume_sound_vib_play(); - } - else { + } else { _D("vib -> sound"); volume_sound_vconf_status_set(TYPE_VCONF_SOUND_STATUS, 1); volume_sound_vconf_status_set(TYPE_VCONF_VIBRATION_STATUS, 0); @@ -213,8 +211,7 @@ static volume_error_e _volume_up_key_press(int status, sound_type_e sound_type, volume_view_slider_value_set(sound_level+1); _D("new sound value: %d", sound_level+1); } - } - else { + } else { /*adjust the sound level normally */ if (sound_level != sound_step) { volume_sound_level_set(sound_type, sound_level+1); @@ -222,14 +219,12 @@ static volume_error_e _volume_up_key_press(int status, sound_type_e sound_type, _D("new sound value: %d", sound_level+1); } } - } - else if (sound_type == SOUND_TYPE_NOTIFICATION) { + } else if (sound_type == SOUND_TYPE_NOTIFICATION) { if (!sound) { /* No sound in notification type. */ volume_view_slider_value_set(0); elm_object_disabled_set(volume_view_slider_get(), EINA_TRUE); - } - else { + } else { /*adjust the sound level normally */ if (sound_level != sound_step) { volume_sound_level_set(sound_type, sound_level+1); @@ -237,9 +232,8 @@ static volume_error_e _volume_up_key_press(int status, sound_type_e sound_type, _D("new sound value: %d", sound_level+1); } } - } + } else if (sound_type == SOUND_TYPE_CALL && bt_opened) { /* Sound type is not ringtone. Need to adjust sound level */ - else if (sound_type == SOUND_TYPE_CALL && bt_opened) { int bt_vol = 0; if (bt_ag_get_speaker_gain(&bt_vol) != BT_ERROR_NONE) _E("Getting bt volume is failed"); @@ -247,33 +241,31 @@ static volume_error_e _volume_up_key_press(int status, sound_type_e sound_type, _D("BT VOLUME : %d", bt_vol); if (bt_vol != sound_step) { - if(bt_ag_notify_speaker_gain(bt_vol+1) != BT_ERROR_NONE) + if (bt_ag_notify_speaker_gain(bt_vol+1) != BT_ERROR_NONE) _E("Setting bt volume is failed"); volume_view_slider_value_set(bt_vol+1); _D("New BT VOLUME : %d", bt_vol+1); } - } - else { + } else { if (sound_type == SOUND_TYPE_MEDIA && (bt_opened || earphone_connected) && sound_level + 1 > SAFETY_LIMIT) { if (volume_control_get_safety_limit()) { display_state_e state; volume_sound_level_set(sound_type, SAFETY_LIMIT); volume_view_slider_value_set(SAFETY_LIMIT); - if (VOLUME_ERROR_OK != volume_view_send_warning_signal(EINA_TRUE)) { + if (VOLUME_ERROR_OK != volume_view_send_warning_signal(EINA_TRUE)) _E("Failed to set warning status"); - } + if (VOLUME_ERROR_OK != volume_view_open_warning_popup()) { _E("Failed to open waring popup!!"); return VOLUME_ERROR_FAIL; } - if (device_display_get_state(&state) != DEVICE_ERROR_NONE) { + if (device_display_get_state(&state) != DEVICE_ERROR_NONE) _E("Failed to get display state"); - } + if (state == DISPLAY_STATE_SCREEN_OFF || state == DISPLAY_STATE_SCREEN_DIM) { device_display_change_state(DISPLAY_STATE_NORMAL); - if(FEEDBACK_ERROR_NONE != feedback_play_type(FEEDBACK_TYPE_VIBRATION, FEEDBACK_PATTERN_WAKEUP)) { + if (FEEDBACK_ERROR_NONE != feedback_play_type(FEEDBACK_TYPE_VIBRATION, FEEDBACK_PATTERN_WAKEUP)) _E("Failed to play vibration"); - } } if (status == LOCK_AND_MEDIA) { /* Check LCD */ @@ -323,7 +315,7 @@ static volume_error_e _volume_down_key_press(int status, sound_type_e sound_type if (elm_object_disabled_get(volume_view_slider_get())) elm_object_disabled_set(volume_view_slider_get(), EINA_FALSE); - if(sound_type == SOUND_TYPE_RINGTONE){ + if (sound_type == SOUND_TYPE_RINGTONE) { if (!sound) /* Check sound status change case. */ _D("Do nothing."); @@ -339,14 +331,12 @@ static volume_error_e _volume_down_key_press(int status, sound_type_e sound_type } } } - } - else if (sound_type == SOUND_TYPE_NOTIFICATION) { - if(!sound) { + } else if (sound_type == SOUND_TYPE_NOTIFICATION) { + if (!sound) { /* No sound in notification type. */ volume_view_slider_value_set(0); elm_object_disabled_set(volume_view_slider_get(), EINA_TRUE); - } - else { + } else { /*adjust the sound level normally */ if (val != 0) { volume_sound_level_set(sound_type, val-1); @@ -354,46 +344,43 @@ static volume_error_e _volume_down_key_press(int status, sound_type_e sound_type _D("new sound value: %d", val-1); } } - } - else if(sound_type == SOUND_TYPE_CALL && bt_opened) { + } else if (sound_type == SOUND_TYPE_CALL && bt_opened) { int bt_vol = 0; - if(bt_ag_get_speaker_gain(&bt_vol) != BT_ERROR_NONE) + if (bt_ag_get_speaker_gain(&bt_vol) != BT_ERROR_NONE) _E("Getting bt volume is failed"); _D("BT VOLUME : %d", bt_vol); - if(bt_ag_notify_speaker_gain(bt_vol-1) != BT_ERROR_NONE) + if (bt_ag_notify_speaker_gain(bt_vol-1) != BT_ERROR_NONE) _E("Setting bt volume is failed"); volume_view_slider_value_set(bt_vol-1); _D("New BT VOLUME : %d", bt_vol-1); - } + } else { /* Sound type is not ringtone. Need to adjust sound level */ - else { if (volume_control_get_safety_limit() && sound_type == SOUND_TYPE_MEDIA && (bt_opened || earphone_connected) && val > SAFETY_LIMIT) { display_state_e state; volume_sound_level_set(sound_type, SAFETY_LIMIT); volume_view_slider_value_set(SAFETY_LIMIT); - if (VOLUME_ERROR_OK != volume_view_send_warning_signal(EINA_TRUE)) { + if (VOLUME_ERROR_OK != volume_view_send_warning_signal(EINA_TRUE)) _E("Failed to set warning status"); - } + if (VOLUME_ERROR_OK != volume_view_open_warning_popup()) { _E("Failed to open waring popup!!"); return VOLUME_ERROR_FAIL; } - if (device_display_get_state(&state) != DEVICE_ERROR_NONE) { + if (device_display_get_state(&state) != DEVICE_ERROR_NONE) _E("Failed to get display state"); - } + if (state == DISPLAY_STATE_SCREEN_OFF || state == DISPLAY_STATE_SCREEN_DIM) { device_display_change_state(DISPLAY_STATE_NORMAL); - if(FEEDBACK_ERROR_NONE != feedback_play_type(FEEDBACK_TYPE_VIBRATION, FEEDBACK_PATTERN_WAKEUP)) { + if (FEEDBACK_ERROR_NONE != feedback_play_type(FEEDBACK_TYPE_VIBRATION, FEEDBACK_PATTERN_WAKEUP)) _E("Failed to play vibration"); - } } - if (status == LOCK_AND_MEDIA) { + if (status == LOCK_AND_MEDIA) /* Check LCD */ volume_view_window_show(sound_type); - } + volume_timer_del(TYPE_TIMER_SU); volume_timer_del(TYPE_TIMER_SD); volume_timer_add(10.0, TYPE_TIMER_WARNING_POPUP); @@ -404,7 +391,7 @@ static volume_error_e _volume_down_key_press(int status, sound_type_e sound_type } } - if(sound_type != SOUND_TYPE_ALARM) + if (sound_type != SOUND_TYPE_ALARM) volume_sound_play(); volume_timer_del(TYPE_TIMER_SD); @@ -418,15 +405,15 @@ static volume_error_e _volume_popup_check_in_alarm_type(sound_type_e sound_type) { int is_enabled = 0; - if(sound_type == SOUND_TYPE_ALARM) { + if (sound_type == SOUND_TYPE_ALARM) { _D("Sound type is Alarm Type"); - if(vconf_get_bool(VCONFKEY_ALARM_VOLUME_POPUP_ENABLE, &is_enabled) < 0) { + if (vconf_get_bool(VCONFKEY_ALARM_VOLUME_POPUP_ENABLE, &is_enabled) < 0) { _E("Failed to get vconfkey : VCONFKEY_ALARM_VOLUME_POPUP_ENABLE"); return VOLUME_ERROR_FAIL; } _D("volume popup enabled in alarm type : %d", is_enabled); - if(!is_enabled) { + if (!is_enabled) { _D("alarm type but vconf for the volume popup is disabled"); return VOLUME_ERROR_FAIL; } @@ -466,17 +453,17 @@ static Eina_Bool _key_press_cb(void *data, int type, void *event) volume_control_set_safety_limit(EINA_TRUE); } - if(!strncmp(ev->keyname, KEY_CANCEL, strlen(KEY_CANCEL)) || !strncmp(ev->keyname, KEY_BACK, strlen(KEY_BACK))) { + if (!strncmp(ev->keyname, KEY_CANCEL, strlen(KEY_CANCEL)) || !strncmp(ev->keyname, KEY_BACK, strlen(KEY_BACK))) { _D("%s is pressed", ev->keyname); return ECORE_CALLBACK_CANCEL; } - if(volume_view_is_slider_touching_get()) { + if (volume_view_is_slider_touching_get()) { _E("Failed to show volume : is_slider_touching is EINA_TRUE"); return ECORE_CALLBACK_CANCEL; } - if(vconf_get_int(VCONFKEY_STARTER_USE_VOLUME_KEY, &key_status) < 0) { + if (vconf_get_int(VCONFKEY_STARTER_USE_VOLUME_KEY, &key_status) < 0) { _E("Failed to get vconf : VCONFKEY_STATER_USE_VOLUME_KEY"); return ECORE_CALLBACK_CANCEL; } @@ -484,18 +471,18 @@ static Eina_Bool _key_press_cb(void *data, int type, void *event) #ifndef FEATURE_SDK int is_call = -1; - if(!strncmp(ev->keyname, KEY_MUTE, strlen(KEY_MUTE))) { + if (!strncmp(ev->keyname, KEY_MUTE, strlen(KEY_MUTE))) { _D("MUTE key is pressed"); - if(VOLUME_ERROR_OK != _mute_key_press()) + if (VOLUME_ERROR_OK != _mute_key_press()) _E("Failed to press MUTE key"); return ECORE_CALLBACK_CANCEL; } - if(vconf_get_int(VCONFKEY_TELEPHONY_CALL_STATE, &is_call) < 0 || is_call < 0) { + if (vconf_get_int(VCONFKEY_TELEPHONY_CALL_STATE, &is_call) < 0 || is_call < 0) { _E("Failed to get call state vconf"); return ECORE_CALLBACK_CANCEL; } - if(is_call>0) { + if (is_call > 0) { _D("Call is active"); return ECORE_CALLBACK_CANCEL; } @@ -508,13 +495,13 @@ static Eina_Bool _key_press_cb(void *data, int type, void *event) _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("module state - bt: %d, earphone: %d", bt_opened, earphone_connected); - if(VOLUME_ERROR_OK != _volume_popup_check_in_alarm_type(sound_type)) { + if (VOLUME_ERROR_OK != _volume_popup_check_in_alarm_type(sound_type)) { _E("Failed to set volume popup"); return ECORE_CALLBACK_CANCEL; } @@ -526,11 +513,10 @@ static Eina_Bool _key_press_cb(void *data, int type, void *event) volume_timer_del(TYPE_TIMER_POPUP); if (!strncmp(ev->keyname, KEY_VOLUMEUP, strlen(KEY_VOLUMEUP))) { - if(VOLUME_ERROR_OK != _volume_up_key_press(status, sound_type, sound, bt_opened, earphone_connected)) + if (VOLUME_ERROR_OK != _volume_up_key_press(status, sound_type, sound, bt_opened, earphone_connected)) _E("Failed to press volume up key"); - } - else if (!strncmp(ev->keyname, KEY_VOLUMEDOWN, strlen(KEY_VOLUMEDOWN))) { - if(VOLUME_ERROR_OK != _volume_down_key_press(status, sound_type, sound, bt_opened, earphone_connected)) + } else if (!strncmp(ev->keyname, KEY_VOLUMEDOWN, strlen(KEY_VOLUMEDOWN))) { + if (VOLUME_ERROR_OK != _volume_down_key_press(status, sound_type, sound, bt_opened, earphone_connected)) _E("Failed to press volume down key"); } @@ -548,16 +534,16 @@ static Eina_Bool _key_release_cb(void *data, int type, void *event) key_event_info.is_pressing = EINA_FALSE; - if(!strncmp(ev->keyname, KEY_CANCEL, strlen(KEY_CANCEL))) { + if (!strncmp(ev->keyname, KEY_CANCEL, strlen(KEY_CANCEL))) { _D("%s is released", ev->keyname); - 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 ECORE_CALLBACK_CANCEL; } - if(!strncmp(ev->keyname, KEY_BACK, strlen(KEY_BACK))) { + if (!strncmp(ev->keyname, KEY_BACK, strlen(KEY_BACK))) { _D("BACK Key is released"); return ECORE_CALLBACK_CANCEL; } @@ -565,18 +551,16 @@ static Eina_Bool _key_release_cb(void *data, int type, void *event) if (!strncmp(ev->keyname, KEY_VOLUMEUP, strlen(KEY_VOLUMEUP))) { _D("up key released and del timer"); volume_timer_del(TYPE_TIMER_SU); - } - else if (!strncmp(ev->keyname, KEY_VOLUMEDOWN, strlen(KEY_VOLUMEDOWN))) { + } else if (!strncmp(ev->keyname, KEY_VOLUMEDOWN, strlen(KEY_VOLUMEDOWN))) { _D("down key released and del timer"); volume_timer_del(TYPE_TIMER_SD); } volume_timer_del(TYPE_TIMER_POPUP); - if(volume_view_is_slider_touching_get() == EINA_FALSE) { - if (!volume_view_warning_popup_get()) { + if (volume_view_is_slider_touching_get() == EINA_FALSE) { + if (!volume_view_warning_popup_get()) volume_timer_add(3.0, TYPE_TIMER_POPUP); - } } _D("key release fini"); diff --git a/src/main.c b/src/main.c index d0addc8..3cdffbb 100755 --- a/src/main.c +++ b/src/main.c @@ -85,7 +85,7 @@ static void _terminate_app(void *user_data) static void _pause_app(void *user_data) { - if(VOLUME_ERROR_OK != volume_control_pause()) + if (VOLUME_ERROR_OK != volume_control_pause()) _E("Failed to pause volume"); } @@ -98,13 +98,13 @@ static void _control_app(app_control_h service, void *user_data) bundle *b = NULL; app_control_to_bundle(service, &b); - if(VOLUME_ERROR_OK != volume_control_reset(b)) { + if (VOLUME_ERROR_OK != volume_control_reset(b)) { _E("Failed to reset volume"); return; } Evas_Object *win = volume_view_win_get(); - if(win) + if (win) elm_win_activate(win); } diff --git a/src/sound.c b/src/sound.c index 0121e42..ec9964d 100755 --- a/src/sound.c +++ b/src/sound.c @@ -85,9 +85,8 @@ void volume_sound_vib_play(void) _D("Play Feedback : vibration"); - if (FEEDBACK_ERROR_NONE != feedback_play_type(FEEDBACK_TYPE_VIBRATION, FEEDBACK_PATTERN_VIBRATION_ON)) { + if (FEEDBACK_ERROR_NONE != feedback_play_type(FEEDBACK_TYPE_VIBRATION, FEEDBACK_PATTERN_VIBRATION_ON)) _E("Failed to play feedback"); - } sound_info.is_vibration = EINA_TRUE; } @@ -103,9 +102,8 @@ void volume_sound_play(void) ret_if(sound_type == SOUND_TYPE_NOTIFICATION); _D("Play Feedback : sound"); - if(FEEDBACK_ERROR_NONE != feedback_play(FEEDBACK_PATTERN_VOLUME_KEY)) { + if (FEEDBACK_ERROR_NONE != feedback_play(FEEDBACK_PATTERN_VOLUME_KEY)) _E("Failed to play feedback"); - } return; } @@ -115,7 +113,7 @@ void volume_sound_setting_sound_play(void) int snd_enabled = _setting_sound_enabled(); _D("snd_enabled(%d)", snd_enabled); - if(snd_enabled == 1) + if (snd_enabled == 1) volume_sound_feedback_play(FEEDBACK_TYPE_SOUND, FEEDBACK_PATTERN_TAP); } @@ -233,9 +231,9 @@ void volume_sound_change_set(int val) volume_sound_play(); } else { - if (sound_type != SOUND_TYPE_MEDIA) { + if (sound_type != SOUND_TYPE_MEDIA) volume_sound_vconf_status_set(TYPE_VCONF_SOUND_STATUS, 0); - } + volume_view_slider_value_set(0); volume_sound_level_set(sound_type, 0); @@ -249,8 +247,7 @@ void volume_sound_change_set(int val) void volume_sound_vconf_status_set(volume_vconf_type_e type, int val) { char *vconfkey = NULL; - switch (type) - { + switch (type) { case TYPE_VCONF_SOUND_STATUS: vconfkey = VCONFKEY_SETAPPL_SOUND_STATUS_BOOL; break; @@ -271,8 +268,7 @@ int volume_sound_vconf_status_get(volume_vconf_type_e type) int ret = -1; char *vconfkey = NULL; - switch (type) - { + switch (type) { case TYPE_VCONF_SOUND_STATUS: vconfkey = VCONFKEY_SETAPPL_SOUND_STATUS_BOOL; break; diff --git a/src/timer.c b/src/timer.c index 49ed9f5..68cf17c 100755 --- a/src/timer.c +++ b/src/timer.c @@ -33,18 +33,6 @@ #include "bt.h" #include "earphone.h" -#define DEL_TIMER(x) \ - if (x) {\ - _D("DELTIMER x : %p\n", x);\ - ecore_timer_del(x);\ - x = NULL;\ - } -#define ADD_TIMER(x, time, _timer_cb, data) \ - if(x != NULL) DEL_TIMER(x); \ - x = ecore_timer_add(time, _timer_cb, data);\ - _D("ADDTIMER x : %p\n", x);\ - - struct _timer_s_info { Ecore_Timer *popup_timer; /* pop-up timer */ Ecore_Timer *slider_timer; /* slider timer */ @@ -262,9 +250,9 @@ static Eina_Bool _timer_short_up_cb(void *data) _D("sound value : %d", val); 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("module state - bt: %d, earphone: %d", bt_opened, earphone_connected); @@ -276,21 +264,20 @@ static Eina_Bool _timer_short_up_cb(void *data) int status = volume_control_check_status(&lock, &type); volume_sound_level_set(sound_type, SAFETY_LIMIT); volume_view_slider_value_set(SAFETY_LIMIT); - if (VOLUME_ERROR_OK != volume_view_send_warning_signal(EINA_TRUE)) { + if (VOLUME_ERROR_OK != volume_view_send_warning_signal(EINA_TRUE)) _E("Failed to set warning status"); - } + if (VOLUME_ERROR_OK != volume_view_open_warning_popup()) { _E("Failed to open waring popup!!"); return VOLUME_ERROR_FAIL; } - if (device_display_get_state(&state) != DEVICE_ERROR_NONE) { + if (device_display_get_state(&state) != DEVICE_ERROR_NONE) _E("Failed to get display state"); - } + if (state == DISPLAY_STATE_SCREEN_OFF || state == DISPLAY_STATE_SCREEN_DIM) { device_display_change_state(DISPLAY_STATE_NORMAL); - if(FEEDBACK_ERROR_NONE != feedback_play_type(FEEDBACK_TYPE_VIBRATION, FEEDBACK_PATTERN_WAKEUP)) { + if (FEEDBACK_ERROR_NONE != feedback_play_type(FEEDBACK_TYPE_VIBRATION, FEEDBACK_PATTERN_WAKEUP)) _E("Failed to play vibration"); - } } if (status == LOCK_AND_MEDIA) { /* Check LCD */ diff --git a/src/view.c b/src/view.c index 594a024..b24a507 100755 --- a/src/view.c +++ b/src/view.c @@ -164,13 +164,15 @@ sound_type_e volume_view_pre_sound_type_get(void) return view_info.pre_sound_type; } -volume_error_e volume_view_set_default_slider(){ +volume_error_e volume_view_set_default_slider() +{ Evas_Object *slider = volume_view_slider_get(); elm_object_style_set(slider, "default"); return VOLUME_ERROR_OK; } -volume_error_e volume_view_set_warning_slider(){ +volume_error_e volume_view_set_warning_slider() +{ Evas_Object *slider = volume_view_slider_get(); elm_object_style_set(slider, "warning"); Edje_Message_Float_Set *msg = alloca(sizeof(Edje_Message_Float_Set) + (sizeof(double))); @@ -196,12 +198,11 @@ int volume_mute_toggle_set() volume_sound_vconf_status_set(TYPE_VCONF_SOUND_STATUS, 0); volume_sound_vconf_status_set(TYPE_VCONF_VIBRATION_STATUS, 0); - if(VOLUME_ERROR_OK != volume_view_slider_value_set(0)) + if (VOLUME_ERROR_OK != volume_view_slider_value_set(0)) _E("Failed to set slider value"); return 0; - } - else { + } else { volume_sound_vconf_status_set(TYPE_VCONF_SOUND_STATUS, 1); volume_sound_vconf_status_set(TYPE_VCONF_VIBRATION_STATUS, 0); @@ -295,9 +296,8 @@ volume_error_e volume_view_open_warning_popup(void) void volume_view_destroy_warning_popup(void) { _D("Destroy warning popup"); - if (VOLUME_ERROR_OK != volume_view_send_warning_signal(EINA_FALSE)) { + if (VOLUME_ERROR_OK != volume_view_send_warning_signal(EINA_FALSE)) _E("Failed to set warning status"); - } evas_object_del(view_info.warning_popup); view_info.warning_popup = NULL; @@ -312,7 +312,7 @@ volume_error_e volume_view_slider_value_set(int val) { _D("Slider value set : %d", val); retv_if(view_info.is_slider_touching, VOLUME_ERROR_FAIL); - retv_if(val<0, VOLUME_ERROR_FAIL); + retv_if(val < 0, VOLUME_ERROR_FAIL); elm_slider_value_set(view_info.slider, val); @@ -331,8 +331,7 @@ void volume_view_volume_icon_set(sound_type_e sound_type, int sound, int vibrati return; } - switch (sound_type) - { + switch (sound_type) { case SOUND_TYPE_ALARM: case SOUND_TYPE_RINGTONE: if (sound) @@ -357,7 +356,7 @@ void volume_view_volume_icon_set(sound_type_e sound_type, int sound, int vibrati case SOUND_TYPE_NOTIFICATION: if (sound) img = IMG_VOLUME_ICON_NOTI; - else if(vibration) + else if (vibration) img = IMG_VOLUME_ICON_NOTI_VIB; else img = IMG_VOLUME_ICON_NOTI_MUTE; @@ -376,8 +375,7 @@ void volume_view_volume_icon_name_set_for_access(sound_type_e sound_type) _D("Volume icon name set"); char buf[2056]; - switch (sound_type) - { + switch (sound_type) { case SOUND_TYPE_RINGTONE: snprintf(buf, sizeof(buf), "%s%s", _("IDS_ST_HEADER_RINGTONES"), "volume"); break; @@ -465,17 +463,17 @@ volume_error_e volume_view_send_warning_signal(Eina_Bool warning) } else { int current_angle = volume_control_get_current_angle(); _D("Current angle: %d", current_angle); - switch(current_angle){ - case 90 : - case 270 : - _D("show,landscape"); - elm_object_signal_emit(view_info.ly_outer, "show,landscape", "bg"); - break; - default : - _D("show,portrait"); - elm_object_signal_emit(view_info.ly_outer, "show,portrait", "bg"); - break; - } + switch (current_angle) { + case 90: + case 270: + _D("show,landscape"); + elm_object_signal_emit(view_info.ly_outer, "show,landscape", "bg"); + break; + default: + _D("show,portrait"); + elm_object_signal_emit(view_info.ly_outer, "show,portrait", "bg"); + break; + } } return VOLUME_ERROR_OK; } @@ -486,11 +484,10 @@ volume_error_e volume_view_window_show(sound_type_e type) elm_win_iconified_set(view_info.win, EINA_FALSE); - if (type == SOUND_TYPE_CALL) { + if (type == SOUND_TYPE_CALL) _D("Sound type is Call"); - } else { + else volume_view_setting_icon_callback_add(); - } return VOLUME_ERROR_OK; } @@ -533,14 +530,12 @@ void _connect_to_wm(Evas_Object *win) tzsh_window tz_win; view_info.tzsh = tzsh_create(TZSH_TOOLKIT_TYPE_EFL); - if (!view_info.tzsh) { + if (!view_info.tzsh) _E("Failed to get connection to Tizen window manager"); - } tz_win = elm_win_window_id_get(win); - if (!tz_win) { + if (!tz_win) _E("Failed to get Tizen window manager"); - } /* * Tizen SDK do not support tzsh yet @@ -548,9 +543,8 @@ void _connect_to_wm(Evas_Object *win) */ #if 0 view_info.volume_service = tzsh_volume_service_create(view_info.tzsh, tz_win); - if (!view_info.volume_service) { + if (!view_info.volume_service) _E("Failed to get volume service"); - } #endif } @@ -718,10 +712,10 @@ Evas_Object* show_lockscreen_splash(const char* bg_path) _lock_sound_check(); /* hide volume window */ - if(VOLUME_ERROR_OK != volume_view_window_hide()) + if (VOLUME_ERROR_OK != volume_view_window_hide()) _E("Failed to hide window"); - Evas_Object *win_splash = elm_win_add(NULL,"lockscreen_splash", ELM_WIN_NOTIFICATION); + Evas_Object *win_splash = elm_win_add(NULL, "lockscreen_splash", ELM_WIN_NOTIFICATION); if (!win_splash) { _E("Failed to add splash window"); @@ -836,21 +830,20 @@ static void _button_mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *e static void _app_control_error_check(int ret) { if (ret != APP_CONTROL_ERROR_NONE) { - switch (ret) - { - case APP_CONTROL_ERROR_INVALID_PARAMETER : + switch (ret) { + case APP_CONTROL_ERROR_INVALID_PARAMETER: _E("error : APP_CONTROL_ERROR_INVALID_PARAMETER"); break; - case APP_CONTROL_ERROR_OUT_OF_MEMORY : + case APP_CONTROL_ERROR_OUT_OF_MEMORY: _E("error : APP_CONTROL_ERROR_OUT_OF_MEMORY"); break; - case APP_CONTROL_ERROR_APP_NOT_FOUND : + case APP_CONTROL_ERROR_APP_NOT_FOUND: _E("error : APP_CONTROL_ERROR_APP_NOT_FOUND"); break; - case APP_CONTROL_ERROR_LAUNCH_REJECTED : + case APP_CONTROL_ERROR_LAUNCH_REJECTED: _E("error : APP_CONTROL_ERROR_LAUNCH_REJECTED"); break; - default : + default: _E("error : %d", ret); break; } diff --git a/test/test_main.c b/test/test_main.c index ccfef16..0652570 100755 --- a/test/test_main.c +++ b/test/test_main.c @@ -67,9 +67,8 @@ int main(int argc, char *argv[]) lifecycle_callback.terminate = __terminate; int ret = ui_app_main(argc, argv, &lifecycle_callback, NULL); - if (ret != APP_ERROR_NONE) { + if (ret != APP_ERROR_NONE) __T("app_main() is failed. err = %d", ret); - } unit_fini(); diff --git a/test/unit/unit_test/unit_test_group_test/unit_test_group.c b/test/unit/unit_test/unit_test_group_test/unit_test_group.c index 186a7d5..aefcadd 100755 --- a/test/unit/unit_test/unit_test_group_test/unit_test_group.c +++ b/test/unit/unit_test/unit_test_group_test/unit_test_group.c @@ -40,9 +40,8 @@ void unit_test_group(void) static void __run_next_group(void) { - if (s_info.current_group >= 2) { + if (s_info.current_group >= 2) return ; - } unit_init(); TEST_GROUP(s_info.group_name[s_info.current_group], s_info.group_starter_pool[s_info.current_group], __complete_group_cb); @@ -50,11 +49,10 @@ static void __run_next_group(void) static void __complete_group_cb(void) { - if (s_info.current_group == 0) { + if (s_info.current_group == 0) __unit_test_run_group(0, 1, __unit_test_pass_group); - } else if (s_info.current_group == 1) { + else if (s_info.current_group == 1) __unit_test_run_group(0, 1, __unit_test_fail_group); - } s_info.current_group += 1; diff --git a/test/unit/unit_test/unit_test_main.c b/test/unit/unit_test/unit_test_main.c index fb51f03..987a322 100755 --- a/test/unit/unit_test/unit_test_main.c +++ b/test/unit/unit_test/unit_test_main.c @@ -46,9 +46,8 @@ int main(int argc, char *argv[]) lifecycle_callback.terminate = __terminate; int ret = ui_app_main(argc, argv, &lifecycle_callback, NULL); - if (ret != APP_ERROR_NONE) { + if (ret != APP_ERROR_NONE) __T("app_main() is failed. err = %d", ret); - } return 0; } -- 2.7.4