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

Commit a52caf03 authored by Andy Hung's avatar Andy Hung Committed by Android (Google) Code Review
Browse files

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

parents da1c40fd d4439a06
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;
                    }
                }