return ret;
}
}
+
+ /* check previous acquired focus */
+ if (radio->sound_focus.watch_id > 0) {
+ char *stream_type = NULL;
+ char *ext_info = NULL;
+ int option = 0;
+
+ ret = mm_sound_get_stream_type_of_acquired_focus(FOCUS_FOR_BOTH, &stream_type, &option, &ext_info);
+ if (ret == MM_ERROR_NONE) {
+ MMRADIO_LOG_DEBUG("Focus is acquired by stream_type[%s], option[%d], ext_info[%s]",
+ stream_type, option, ext_info);
+ if (!strcmp(stream_type, "alarm") || !strcmp(stream_type, "ringtone-voip") ||
+ !strcmp(stream_type, "ringtone-call") || !strcmp(stream_type, "voip") ||
+ !strcmp(stream_type, "call-voice") || !strcmp(stream_type, "call-video")) {
+ MMRADIO_LOG_DEBUG("Blcoked by session policy, focus_acquired_by[%s]", stream_type);
+ free(ext_info);
+ free(stream_type);
+ return MM_ERROR_POLICY_BLOCKED;
+ }
+ free(ext_info);
+ free(stream_type);
+ }
+ }
#endif
/* set stored frequency */
return ret;
}
}
+
+ /* check previous acquired focus */
+ if (radio->sound_focus.watch_id > 0) {
+ char *stream_type = NULL;
+ char *ext_info = NULL;
+ int option = 0;
+
+ ret = mm_sound_get_stream_type_of_acquired_focus(FOCUS_FOR_BOTH, &stream_type, &option, &ext_info);
+ if (ret == MM_ERROR_NONE) {
+ MMRADIO_LOG_DEBUG("Focus is acquired by stream_type[%s], option[%d], ext_info[%s]",
+ stream_type, option, ext_info);
+ if (!strcmp(stream_type, "alarm") || !strcmp(stream_type, "ringtone-voip") ||
+ !strcmp(stream_type, "ringtone-call") || !strcmp(stream_type, "voip") ||
+ !strcmp(stream_type, "call-voice") || !strcmp(stream_type, "call-video")) {
+ MMRADIO_LOG_DEBUG("Blcoked by session policy, focus_acquired_by[%s]", stream_type);
+ free(ext_info);
+ free(stream_type);
+ return MM_ERROR_POLICY_BLOCKED;
+ }
+ free(ext_info);
+ free(stream_type);
+ }
+ }
#endif
if (!radio->is_ready) {