startfunc;
struct appdata *ad = user_data;
- sound_stream_focus_state_e state_for_playback;
- sound_stream_focus_state_e state_for_recording;
- int ret = SOUND_MANAGER_ERROR_INVALID_PARAMETER;
- ret = sound_manager_get_focus_state(ad->stream_info, &state_for_playback,
- &state_for_recording);
- if(ret != SOUND_MANAGER_ERROR_NONE) {
- ERROR_TRACE("failed in sound_manager_get_focus_state");
- }
-
- if (state_for_playback == SOUND_STREAM_FOCUS_STATE_RELEASED) {
+ if (focus_mask == SOUND_STREAM_FOCUS_FOR_PLAYBACK && focus_state == SOUND_STREAM_FOCUS_STATE_RELEASED) {
mp_player_mgr_pause(ad);
sound_manager_get_focus_reacquisition(ad->stream_info, &reacquire_state);
sound_manager_set_focus_reacquisition(ad->stream_info, EINA_FALSE);
}
} else {
- if (reason_for_change == SOUND_STREAM_FOCUS_CHANGED_BY_VOIP ||
- reason_for_change == SOUND_STREAM_FOCUS_CHANGED_BY_CALL ||
- reason_for_change == SOUND_STREAM_FOCUS_CHANGED_BY_RINGTONE) {
- ERROR_TRACE("Some other application has the focus currently... Returning...");
- char *message = STR_MP_UNABLE_TO_PLAY_DURING_CALL;
- if (message) {
- int ret = notification_status_message_post(dgettext("music-player", message));
- if (ret != 0) {
- ERROR_TRACE("notification_status_message_post()... [0x%x]", ret);
- } else {
- DEBUG_TRACE("message: [%s]", message);
- }
- }
- return;
- }
mp_play_control_play_pause(ad, true);
}
}