Adjust some error log to warn level and add some comment 81/107281/2
authorWootak Jung <wootak.jung@samsung.com>
Tue, 27 Dec 2016 09:57:25 +0000 (18:57 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Tue, 27 Dec 2016 10:08:26 +0000 (19:08 +0900)
Change-Id: Id7c37b148f526da1e3b36659e76971985dcaf84d

module/src/callmgr-ringer.c
module/src/callmgr-sensor.c
packaging/call-manager.spec
service/src/callmgr-core.c

index b28c85fe97b8e4f982f5f4512df948bde43622f3..b9a145903bd17fe892b5c8c227bed132ea48d91b 100644 (file)
@@ -297,9 +297,14 @@ int _callmgr_ringer_destroy_ringtone_stream(callmgr_ringer_handle_h ringer_handl
        dbg("_callmgr_ringer_destroy_ringtone_stream()");
        CM_RETURN_VAL_IF_FAIL(ringer_handle, -1);
 
+       if (ringer_handle->ringtone_stream_handle == NULL) {
+               warn("No ringtone_stream_handle");
+               return -1;
+       }
+
        ret = sound_manager_release_focus(ringer_handle->ringtone_stream_handle, SOUND_STREAM_FOCUS_FOR_PLAYBACK|SOUND_STREAM_FOCUS_FOR_RECORDING, SOUND_BEHAVIOR_NONE, NULL);
        if (ret != SOUND_MANAGER_ERROR_NONE) {
-               err("sound_manager_release_focus() get failed with err[%d]", ret);
+               err("sound_manager_release_focus() get failed with err[%d][%s]", ret, get_error_message(ret));
        }
 
        ret = sound_manager_destroy_stream_information(ringer_handle->ringtone_stream_handle);
@@ -480,13 +485,16 @@ static int __callmgr_ringer_stop_melody(callmgr_ringer_handle_h ringer_handle)
 
        CM_RETURN_VAL_IF_FAIL(ringer_handle, -1);
 
+       if (ringer_handle->player_handle == NULL) {
+               warn("No player_handle");
+               return -1;
+       }
+
        if (ringer_handle->increment_timer != 0) {
                g_source_remove(ringer_handle->increment_timer);
                ringer_handle->increment_timer = 0;
        }
 
-       CM_RETURN_VAL_IF_FAIL(ringer_handle->player_handle, -1);
-
        player_get_state(ringer_handle->player_handle, &player_state);
 
        info("current player state = %d", player_state);
@@ -585,7 +593,11 @@ static int __callmgr_ringer_stop_vibration(callmgr_ringer_handle_h ringer_handle
 {
        dbg("..");
        CM_RETURN_VAL_IF_FAIL(ringer_handle, -1);
-       CM_RETURN_VAL_IF_FAIL(ringer_handle->haptic_handle, -1);
+
+       if (ringer_handle->haptic_handle == NULL) {
+               warn("No haptic_handle");
+               return -1;
+       }
 
        if (ringer_handle->vibration_timer != 0) {
                info("vib_timer_id removing..");
@@ -689,7 +701,7 @@ int _callmgr_ringer_stop_local_ringback_tone(callmgr_ringer_handle_h ringer_hand
        CM_RETURN_VAL_IF_FAIL(ringer_handle, -1);
 
        if (ringer_handle->ringback_tone_play_handle == -1) {
-               err("Wrong handle to stop tone_player");
+               warn("No ringback_tone_play_handle");
                return -1;
        }
 
@@ -764,8 +776,12 @@ int _callmgr_ringer_stop_alert(callmgr_ringer_handle_h ringer_handle)
 
        CM_RETURN_VAL_IF_FAIL(ringer_handle, -1);
 
+       /* Stop melody if exist */
        __callmgr_ringer_stop_melody(ringer_handle);
+
+       /* Stop vibration if exist */
        __callmgr_ringer_stop_vibration(ringer_handle);
+
        ringer_handle->current_status = CM_RINGER_STATUS_IDLE_E;
 
        return 0;
@@ -780,8 +796,7 @@ int _callmgr_ringer_stop_alternate_tone(callmgr_ringer_handle_h ringer_handle)
        CM_RETURN_VAL_IF_FAIL(ringer_handle, -1);
 
        if (ringer_handle->alternate_tone_handle == -1) {
-               err("Invalid tone handle");
-
+               warn("No alternate_tone_handle");
                return -1;
        }
 
@@ -815,6 +830,8 @@ int _callmgr_ringer_play_effect(callmgr_ringer_handle_h ringer_handle, cm_ringer
        int sound_manager_ret = SOUND_MANAGER_ERROR_NONE;
        char *effect_path = NULL;
 
+       dbg("effect_type: [%s]", effect_type == CM_RINGER_EFFECT_CONNECT_TONE_E ? "CONNECT_TONE" : "DISCONNECT_TONE");
+
        ringer_handle->play_effect_cb_fn = cb_fn;
        ringer_handle->play_effect_user_data = user_data;
 
@@ -858,7 +875,7 @@ int _callmgr_ringer_stop_effect(callmgr_ringer_handle_h ringer_handle)
        dbg("_callmgr_ringer_stop_effect");
 
        if (ringer_handle->play_effect_handle < 0) {
-               err("Invalid handle");
+               warn("No play_effect_handle");
                return -1;
        }
 
index 2b3cdc44289c99390ca67d7a6ae81f26660505d8..cd75914790cf50c6a3f8a878ae78ff1faed57c37 100644 (file)
@@ -94,7 +94,7 @@ int _callmgr_sensor_face_down_start(callmgr_sensor_handle_h sensor_handle)
        gboolean motion_turn_over_option = FALSE;
 
        if (gesture_is_supported(GESTURE_TURN_FACE_DOWN, &is_supported) != GESTURE_ERROR_NONE) {
-               err("Err");
+               warn("GESTURE_TURN_FACE_DOWN is not supported");
                return -1;
        }
 
@@ -149,7 +149,7 @@ int _callmgr_sensor_face_down_stop(callmgr_sensor_handle_h sensor_handle)
        CM_RETURN_VAL_IF_FAIL(sensor_handle, -1);
 
        if (sensor_handle->gesture_handle == NULL) {
-               warn("No handle");
+               warn("No gesture_handle");
                return -1;
        }
 
index 4d95e2e3279ebac98f8ec49235256ff8a7c5fa8b..5371224b78696e1774cfcb78a28e9f3449c10a51 100644 (file)
@@ -1,6 +1,6 @@
 %define major 0
 %define minor 1
-%define patchlevel 98
+%define patchlevel 99
 %define ext_feature 0
 
 Name:           call-manager
index 579079c512fd8c29ff6b026c6a131aba7bff95cd..cc1e35ed7d31cde63b0d009b3bd9d12914281c87 100644 (file)
@@ -682,11 +682,13 @@ static void __callmgr_core_stop_incom_noti(callmgr_core_data_t *core_data)
        /* Reset value */
        core_data->is_video_recording = FALSE;
 
-       /* Stop ringtone */
+       /* Stop alternate tone if exist */
        _callmgr_ringer_stop_alternate_tone(core_data->ringer_handle);
+
+       /* Stop ringtone if exist */
        _callmgr_ringer_stop_alert(core_data->ringer_handle);
 
-       /* Stop motion sensor */
+       /* Stop motion sensor if exist */
        _callmgr_sensor_face_down_stop(core_data->sensor_handle);
 }
 
@@ -815,6 +817,7 @@ static void __callmgr_core_process_telephony_events(cm_telephony_event_type_e ev
 
                __callmgr_core_cancel_auto_answer(core_data);
                __callmgr_core_stop_incom_noti(core_data);
+               /* Destroy ringtone stream if MT call is terminated */
                _callmgr_ringer_destroy_ringtone_stream(core_data->ringer_handle);
                _callmgr_ringer_stop_local_ringback_tone(core_data->ringer_handle);