}
}
+static bool skip_device(const char *stream_role, const char *device_type)
+{
+ int sound_on = 1;
+
+ if (pa_streq(device_type, DEVICE_TYPE_FORWARDING))
+ return true;
+
+ if (pa_streq(device_type, DEVICE_TYPE_BT))
+ return true;
+
+ /* get sound profile */
+ if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &sound_on) < 0) {
+ pa_log_error("failed to get vconf - sound status");
+ return false;
+ }
+
+ if (!sound_on && pa_streq(stream_role, STREAM_ROLE_RINGTONE_CALL) && pa_streq(device_type, DEVICE_TYPE_SPEAKER)) {
+ pa_log_info("sound status is 0 with ringtone-call stream, skip built-in speaker");
+ return true;
+ }
+
+ return false;
+}
+
/* Set the proper sink(source) according to the data of the parameter.
* - ROUTE_TYPE_AUTO(_ALL)
* 1. Find the proper sink/source comparing between avail_devices
pa_log_debug(" ** found a matched device: type[%-16s], direction[0x%x]", dm_device_type, dm_device_direction);
use_internal_codec = pa_tz_device_is_use_internal_codec(device);
if (use_internal_codec) {
- /* if the device type is forwarding, keep going to next device for proper UCM setting */
- if (pa_streq(dm_device_type, DEVICE_TYPE_FORWARDING))
- continue;
- if (pa_streq(dm_device_type, DEVICE_TYPE_BT))
+ /* if it needs to skip it, keep going to next device for proper UCM setting */
+ if (skip_device(data->stream_role, dm_device_type))
continue;
hal_direction = CONVERT_TO_HAL_DIRECTION(data->stream_type);
route_info.num_of_devices++;
#define GET_STREAM_PROPLIST(stream, type) \
(type == STREAM_SINK_INPUT ? ((pa_sink_input*)stream)->proplist : ((pa_source_output*)stream)->proplist)
+#define STREAM_ROLE_RINGTONE_CALL "ringtone-call"
#define STREAM_ROLE_CALL_VOICE "call-voice"
#define STREAM_ROLE_CALL_VIDEO "call-video"
#define STREAM_ROLE_VOIP "voip"