diff options
author | Xiaojun Sang <xsang@codeaurora.org> | 2016-02-23 16:33:07 +0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-03-07 01:24:58 -0800 |
commit | 869f20135122f5da46e4982387737d76fa5f29cb (patch) | |
tree | b9f43d1c09ae2d86905b6616985e120d0a3748a6 | |
parent | 388560404ef1c8a47d292dd5589b65a8e7c33a8a (diff) | |
download | android_hardware_qcom_audio-869f20135122f5da46e4982387737d76fa5f29cb.tar.gz android_hardware_qcom_audio-869f20135122f5da46e4982387737d76fa5f29cb.tar.bz2 android_hardware_qcom_audio-869f20135122f5da46e4982387737d76fa5f29cb.zip |
hal: force device switch only for headset and headphone
As native 44.1k is only valid for headset and headphone,
force_device_switch just happens for them.
CRs-Fixed: 980341
Change-Id: I1a01e64322f64c60cf15b6d29472023ff4dfb7ac
-rw-r--r-- | hal/audio_hw.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c index 0526e9ba..36982940 100644 --- a/hal/audio_hw.c +++ b/hal/audio_hw.c @@ -913,7 +913,9 @@ static bool force_device_switch(struct audio_usecase *usecase) if (is_offload_usecase(usecase->id) && (usecase->stream.out) && - (usecase->stream.out->sample_rate == OUTPUT_SAMPLING_RATE_44100)) { + (usecase->stream.out->sample_rate == OUTPUT_SAMPLING_RATE_44100) && + (usecase->stream.out->devices == AUDIO_DEVICE_OUT_WIRED_HEADSET || + usecase->stream.out->devices == AUDIO_DEVICE_OUT_WIRED_HEADPHONE)) { is_it_true_mode = (NATIVE_AUDIO_MODE_TRUE_44_1 == platform_get_native_support()? true : false); if ((is_it_true_mode && !adev->native_playback_enabled) || (!is_it_true_mode && adev->native_playback_enabled)){ |