diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2016-03-11 00:02:24 -0800 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2016-03-11 00:02:24 -0800 |
commit | 78ff96b6544913d5e23c6a1d71631e703b1d2421 (patch) | |
tree | b9f43d1c09ae2d86905b6616985e120d0a3748a6 | |
parent | 78ed00683b1ebac7b4f04c0ed07321640b13de2b (diff) | |
parent | 869f20135122f5da46e4982387737d76fa5f29cb (diff) | |
download | android_hardware_qcom_audio-78ff96b6544913d5e23c6a1d71631e703b1d2421.tar.gz android_hardware_qcom_audio-78ff96b6544913d5e23c6a1d71631e703b1d2421.tar.bz2 android_hardware_qcom_audio-78ff96b6544913d5e23c6a1d71631e703b1d2421.zip |
Promotion of av-userspace.lnx.1.0-00048.
CRs Change ID Subject
--------------------------------------------------------------------------------------------------------------
903528 978534 I607e96f1fecdcf37d8865af2aa9b4cbd4450aca6 audiopolicy: fix notification tone during call not stopp
980341 I1a01e64322f64c60cf15b6d29472023ff4dfb7ac hal: force device switch only for headset and headphone
Change-Id: I209ae0ad715491316a2f9a6aeda5134cf80cf607
CRs-Fixed: 978534, 980341, 903528
-rw-r--r-- | hal/audio_hw.c | 4 | ||||
-rw-r--r-- | policy_hal/AudioPolicyManager.cpp | 7 |
2 files changed, 8 insertions, 3 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)){ diff --git a/policy_hal/AudioPolicyManager.cpp b/policy_hal/AudioPolicyManager.cpp index dee4e8ba..f5fc3f24 100644 --- a/policy_hal/AudioPolicyManager.cpp +++ b/policy_hal/AudioPolicyManager.cpp @@ -656,7 +656,7 @@ void AudioPolicyManagerCustom::setPhoneState(audio_mode_t state) /// Opens: can these line be executed after the switch of volume curves??? // if leaving call state, handle special case of active streams // pertaining to sonification strategy see handleIncallSonification() - if (isInCall()) { + if (isStateInCall(oldState)) { ALOGV("setPhoneState() in call state management: new state is %d", state); for (size_t j = 0; j < mOutputs.size(); j++) { audio_io_handle_t curOutput = mOutputs.keyAt(j); @@ -668,7 +668,7 @@ void AudioPolicyManagerCustom::setPhoneState(audio_mode_t state) } } - // force reevaluating accessibility routing when call starts + // force reevaluating accessibility routing when call stops mpClientInterface->invalidateStream(AUDIO_STREAM_ACCESSIBILITY); } @@ -944,6 +944,9 @@ void AudioPolicyManagerCustom::setPhoneState(audio_mode_t state) handleIncallSonification((audio_stream_type_t)stream, true, true, curOutput); } } + + // force reevaluating accessibility routing when call starts + mpClientInterface->invalidateStream(AUDIO_STREAM_ACCESSIBILITY); } // Flag that ringtone volume must be limited to music volume until we exit MODE_RINGTONE |