commit | f4fb66b3fd8f5274e4a7692ed31afbf70f39394e | [log] [tgz] |
---|---|---|
author | Eric Laurent <elaurent@google.com> | Fri May 14 07:48:06 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Fri May 14 07:48:06 2021 +0000 |
tree | bcaf03cdf309ef14a83cd9ab46c37d70096dfa41 | |
parent | 8f9389274b5f317f2a39d8c149a6345ef8896913 [diff] | |
parent | fddb5604a3497fa87c9c606392719d563dacd3b0 [diff] |
Merge "audio policy: fix wrong ring volume after music stops." into sc-dev am: fddb5604a3 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/14519322 Change-Id: I887a68dda3aff0dbe26638bec47fa60299b3a4d1
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp index 485188a..7185435 100644 --- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp +++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -6439,8 +6439,9 @@ volumeDb = minVolDb; ALOGV("computeVolume limiting volume to %f musicVol %f", minVolDb, musicVolDb); } - if (!Intersection(deviceTypes, {AUDIO_DEVICE_OUT_BLUETOOTH_A2DP, - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES}).empty()) { + if (Volume::getDeviceForVolume(deviceTypes) != AUDIO_DEVICE_OUT_SPEAKER + && !Intersection(deviceTypes, {AUDIO_DEVICE_OUT_BLUETOOTH_A2DP, + AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES}).empty()) { // on A2DP, also ensure notification volume is not too low compared to media when // intended to be played if ((volumeDb > -96.0f) &&