Merge "AudioService: Unify multiple device volume selection with APM" into tm-dev am: a52caf0317
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17038305 Change-Id: Ia874639c512a08ccc527c82ce2dfd812c53085f1
This commit is contained in:
@@ -6297,13 +6297,16 @@ public class AudioService extends IAudioService.Stub
|
||||
return AudioSystem.DEVICE_OUT_HDMI_ARC;
|
||||
} else if (deviceSet.contains(AudioSystem.DEVICE_OUT_HDMI_EARC)) {
|
||||
return AudioSystem.DEVICE_OUT_HDMI_EARC;
|
||||
} else if (deviceSet.contains(AudioSystem.DEVICE_OUT_SPDIF)) {
|
||||
return AudioSystem.DEVICE_OUT_SPDIF;
|
||||
} else if (deviceSet.contains(AudioSystem.DEVICE_OUT_AUX_LINE)) {
|
||||
return AudioSystem.DEVICE_OUT_AUX_LINE;
|
||||
} else if (deviceSet.contains(AudioSystem.DEVICE_OUT_SPDIF)) {
|
||||
return AudioSystem.DEVICE_OUT_SPDIF;
|
||||
} else {
|
||||
for (int deviceType : AudioSystem.DEVICE_OUT_ALL_A2DP_SET) {
|
||||
if (deviceSet.contains(deviceType)) {
|
||||
// At this point, deviceSet should contain exactly one A2DP device;
|
||||
// regardless, return the first A2DP device in numeric order.
|
||||
// If there is no A2DP device, this falls through to log an error.
|
||||
for (int deviceType : deviceSet) {
|
||||
if (AudioSystem.DEVICE_OUT_ALL_A2DP_SET.contains(deviceType)) {
|
||||
return deviceType;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user