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

Commit be03c7a4 authored by Jiabin Huang's avatar Jiabin Huang Committed by Automerger Merge Worker
Browse files

Merge "AS: use dock device for volume when dock device is selected." into...

Merge "AS: use dock device for volume when dock device is selected." into udc-dev am: 4e942f08 am: 59acaa9e

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



Change-Id: I061837437a758ea9bdf35f25b2c0b0fd05dd3453
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 03acb96b 59acaa9e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -7051,13 +7051,16 @@ public class AudioService extends IAudioService.Stub
            return deviceSet.iterator().next();
        } else {
            // Multiple device selection is either:
            //  - dock + one other device: give priority to dock in this case.
            //  - speaker + one other device: give priority to speaker in this case.
            //  - one A2DP device + another device: happens with duplicated output. In this case
            // retain the device on the A2DP output as the other must not correspond to an active
            // selection if not the speaker.
            //  - HDMI-CEC system audio mode only output: give priority to available item in order.
            if (deviceSet.contains(AudioSystem.DEVICE_OUT_SPEAKER)) {
            if (deviceSet.contains(AudioSystem.DEVICE_OUT_DGTL_DOCK_HEADSET)) {
                return AudioSystem.DEVICE_OUT_DGTL_DOCK_HEADSET;
            } else if (deviceSet.contains(AudioSystem.DEVICE_OUT_SPEAKER)) {
                return AudioSystem.DEVICE_OUT_SPEAKER;
            } else if (deviceSet.contains(AudioSystem.DEVICE_OUT_SPEAKER_SAFE)) {
                // Note: DEVICE_OUT_SPEAKER_SAFE not present in getDeviceSetForStreamDirect