Add more logs for debugging
[platform/core/multimedia/libmm-radio.git] / src / mm_radio_sound_focus.c
index 668c060..696bc8f 100644 (file)
@@ -35,6 +35,7 @@ static void _mmradio_device_connected_cb(MMSoundDevice_t device, bool is_connect
 
        MMRADIO_LOG_FENTER();
        MMRADIO_CHECK_INSTANCE_RETURN_VOID(radio);
+       MMRADIO_LOG_INFO("device [%d] is_connected [%d]", device, is_connected);
 
        if (mm_sound_get_device_type(device, &type) != MM_ERROR_NONE) {
                MMRADIO_LOG_ERROR("getting device type failed");
@@ -67,7 +68,7 @@ void _mmradio_sound_signal_callback(mm_sound_signal_name_t signal, int value, vo
        mm_radio_sound_focus *sound_focus = (mm_radio_sound_focus *)user_data;
        int ret = MM_ERROR_NONE;
 
-       MMRADIO_LOG_DEBUG("sound signal callback %d / %d", signal, value);
+       MMRADIO_LOG_INFO("sound signal callback %d / %d", signal, value);
 
        if (signal == MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS) {
                if (value == 1) {
@@ -119,7 +120,7 @@ int mmradio_sound_focus_register(mm_radio_sound_focus *sound_focus,
 
        /* read session information */
        ret = _mm_session_util_read_information(pid, &session_type, &session_flags);
-       MMRADIO_LOG_DEBUG("Read Session type ret:0x%X", ret);
+       MMRADIO_LOG_INFO("Read Session type ret:0x%X", ret);
        if (ret == MM_ERROR_INVALID_HANDLE) {
                MMRADIO_LOG_WARNING("subscribe_id=%d", sound_focus->subscribe_id);
                if (sound_focus->subscribe_id == 0) {
@@ -137,7 +138,7 @@ int mmradio_sound_focus_register(mm_radio_sound_focus *sound_focus,
                                MMRADIO_LOG_ERROR("mm_sound_set_focus_watch_callback is failed");
                                return MM_ERROR_POLICY_BLOCKED;
                        }
-                       MMRADIO_LOG_DEBUG("(%p) set focus watch callback = %d", param, sound_focus->watch_id);
+                       MMRADIO_LOG_INFO("(%p) set focus watch callback = %d", param, sound_focus->watch_id);
 
                        /* register device connected callback */
                        ret = mm_sound_add_device_connected_callback(MM_SOUND_DEVICE_TYPE_EXTERNAL_FLAG,
@@ -146,7 +147,7 @@ int mmradio_sound_focus_register(mm_radio_sound_focus *sound_focus,
                                MMRADIO_LOG_ERROR("mm_sound_add_device_connected_callback is failed");
                                return MM_ERROR_POLICY_BLOCKED;
                        }
-                       MMRADIO_LOG_ERROR("register device connected callback for the value is 0, sub_cb id %d", sound_focus->device_subs_id);
+                       MMRADIO_LOG_INFO("register device connected callback for the value is 0, sub_cb id %d", sound_focus->device_subs_id);
                }
                ret = MM_ERROR_NONE;
        } else if (ret == MM_ERROR_NONE) {
@@ -167,7 +168,7 @@ int mmradio_sound_focus_register(mm_radio_sound_focus *sound_focus,
 
                                ret = mm_sound_register_focus_for_session(handle, pid, "radio", focus_cb, param);
                                if (ret != MM_ERROR_NONE) {
-                                       MMRADIO_LOG_DEBUG("mm_sound_register_focus_for_session is failed");
+                                       MMRADIO_LOG_ERROR("mm_sound_register_focus_for_session is failed");
                                        return MM_ERROR_POLICY_BLOCKED;
                                }
                                MMRADIO_LOG_DEBUG("(%p) register focus for session %d", param, pid);
@@ -207,7 +208,7 @@ int mmradio_sound_focus_register(mm_radio_sound_focus *sound_focus,
                                        MMRADIO_LOG_ERROR("mm_sound_add_device_connected_callback is failed");
                                        return MM_ERROR_POLICY_BLOCKED;
                                }
-                               MMRADIO_LOG_DEBUG("(%p) add device connected callback = %d", param, sound_focus->device_subs_id);
+                               MMRADIO_LOG_INFO("(%p) add device connected callback = %d", param, sound_focus->device_subs_id);
                        }
                } else if (sound_focus->session_type == MM_SESSION_TYPE_REPLACED_BY_STREAM) {
                        /* didn't register device connected cb */
@@ -239,7 +240,7 @@ int mmradio_sound_focus_deregister(mm_radio_sound_focus *sound_focus)
        }
 
        if (sound_focus->watch_id > 0) {
-               MMRADIO_LOG_DEBUG("unset the focus watch cb %d", sound_focus->watch_id);
+               MMRADIO_LOG_INFO("unset the focus watch cb %d", sound_focus->watch_id);
 
                ret = mm_sound_unset_focus_watch_callback(sound_focus->watch_id);
                sound_focus->watch_id = 0;
@@ -255,7 +256,7 @@ int mmradio_sound_focus_deregister(mm_radio_sound_focus *sound_focus)
        }
        /* unregister device connected callback */
        if (sound_focus->device_subs_id > 0) {
-               MMRADIO_LOG_DEBUG("unset the device connected cb %d", sound_focus->device_subs_id);
+               MMRADIO_LOG_INFO("unset the device connected cb %d", sound_focus->device_subs_id);
                ret = mm_sound_remove_device_connected_callback(sound_focus->device_subs_id);
                sound_focus->device_subs_id = 0;
                if (ret != MM_ERROR_NONE)
@@ -263,7 +264,7 @@ int mmradio_sound_focus_deregister(mm_radio_sound_focus *sound_focus)
        }
 
        if (sound_focus->subscribe_id > 0) {
-               MMRADIO_LOG_DEBUG("unset mm_sound_subscribe_signal_for_daemon %d", sound_focus->subscribe_id);
+               MMRADIO_LOG_INFO("unset mm_sound_subscribe_signal_for_daemon %d", sound_focus->subscribe_id);
                mm_sound_unsubscribe_signal(sound_focus->subscribe_id);
        }