}
}
-void __recorder_focus_state_cb(sound_stream_info_h stream_info, sound_stream_focus_change_reason_e reason, const char *extra_info, void *user_data)
+void __recorder_focus_state_cb(sound_stream_info_h stream_info, sound_stream_focus_mask_e focus_mask, sound_stream_focus_state_e focus_state,
+ sound_stream_focus_change_reason_e reason, int sound_behavior, const char *extra_info, void *user_data)
{
SLOG(LOG_DEBUG, TAG_STTD, "[Recorder] Focus state changed cb");
SLOG(LOG_ERROR, TAG_STTD, "[Recorder ERROR] Invalid stream info handle");
return;
}
+ SLOG(LOG_WARN, TAG_STTD, "[Recorder] focus state changed to (%d) with reason(%s)", (int)focus_state, __stt_get_focus_changed_reason_code(reason));
- int ret;
- sound_stream_focus_state_e state_for_recording;
- ret = sound_manager_get_focus_state(g_stream_info_h, NULL, &state_for_recording);
- if (SOUND_MANAGER_ERROR_NONE != ret) {
- SLOG(LOG_ERROR, TAG_STTD, "[Recorder ERROR] Fail to get focus state");
- return;
- }
-
- SLOG(LOG_WARN, TAG_STTD, "[Recorder] focus state changed to (%d) with reason(%s)", (int)state_for_recording, __stt_get_focus_changed_reason_code(reason));
-
- if (STTD_RECORDER_STATE_RECORDING == g_recorder_state && SOUND_STREAM_FOCUS_STATE_RELEASED == state_for_recording) {
+ if (STTD_RECORDER_STATE_RECORDING == g_recorder_state && SOUND_STREAM_FOCUS_STATE_RELEASED == focus_state) {
SLOG(LOG_WARN, TAG_STTD, "[Recorder] Focus released as interrupt");
if (NULL != g_interrupt_cb) {
g_interrupt_cb();
return STTD_ERROR_INVALID_PARAMETER;
}
- ret = sound_manager_acquire_focus(g_stream_info_h, SOUND_STREAM_FOCUS_FOR_RECORDING, NULL);
+ ret = sound_manager_acquire_focus(g_stream_info_h, SOUND_STREAM_FOCUS_FOR_RECORDING, SOUND_BEHAVIOR_NONE, NULL);
if (SOUND_MANAGER_ERROR_NONE != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Recorder ERROR] Fail to acquire focus : %d", ret);
} else {
g_recorder_state = STTD_RECORDER_STATE_READY;
- ret = sound_manager_release_focus(g_stream_info_h, SOUND_STREAM_FOCUS_FOR_RECORDING, NULL);
+ ret = sound_manager_release_focus(g_stream_info_h, SOUND_STREAM_FOCUS_FOR_RECORDING, SOUND_BEHAVIOR_NONE, NULL);
if (SOUND_MANAGER_ERROR_NONE != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Recorder ERROR] Fail to release focus :%d", ret);
}