Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1010f423 authored by Andy Hung's avatar Andy Hung Committed by Automerger Merge Worker
Browse files

Merge "AudioService: Unify multiple device volume selection with APM" into tm-dev am: a52caf03

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17038305

Change-Id: Ia874639c512a08ccc527c82ce2dfd812c53085f1
parents 5a5f2387 a52caf03
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -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;
                    }
                }