summaryrefslogtreecommitdiff
path: root/src/mm_radio_sound_focus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mm_radio_sound_focus.c')
-rw-r--r--src/mm_radio_sound_focus.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/mm_radio_sound_focus.c b/src/mm_radio_sound_focus.c
index 668c060..766a913 100644
--- a/src/mm_radio_sound_focus.c
+++ b/src/mm_radio_sound_focus.c
@@ -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");
@@ -53,6 +54,7 @@ static void _mmradio_device_connected_cb(MMSoundDevice_t device, bool is_connect
result = _mmradio_stop(radio);
if (result != MM_ERROR_NONE)
MMRADIO_LOG_ERROR("failed to stop radio");
+ radio->sound_focus.by_focus_cb = MMRADIO_FOCUS_CB_NONE;
}
break;
default:
@@ -67,7 +69,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 +121,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 +139,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 +148,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 +169,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 +209,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 +241,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 +257,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 +265,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);
}