1# Copyright 2016 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5# Disable HSP/HFP on Google WiFi (Gale) with UART-HCI Bluetooth
6# which is incapable to handle SCO audio.
7platform_name="$(mosys platform name)"
8if [ "$platform_name" = "Gale" ]; then
9     DISABLE_PROFILE="--disable_profile=hfp,hsp"
10fi
11# For board needs different device configs, check which config
12# directory to use. Use that directory for both volume curves
13# and dsp config.
14if [ -f /etc/cras/get_device_config_dir ]; then
15  device_config_dir="$(sh /etc/cras/get_device_config_dir)"
16  DEVICE_CONFIG_DIR="--device_config_dir=${device_config_dir}"
17  DSP_CONFIG="--dsp_config=${device_config_dir}/dsp.ini"
18fi
19if [ -f /etc/cras/get_internal_ucm_suffix ]; then
20  internal_ucm_suffix="$(sh /etc/cras/get_internal_ucm_suffix)"
21  INTERNAL_UCM_SUFFIX="--internal_ucm_suffix=${internal_ucm_suffix}"
22fi
23exec minijail0 -u cras -g cras -G -- /usr/bin/cras \
24    ${DSP_CONFIG} ${DEVICE_CONFIG_DIR} ${DISABLE_PROFILE} \
25    ${INTERNAL_UCM_SUFFIX}
26