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

Commit 820d3a39 authored by Jiabin Huang's avatar Jiabin Huang Committed by Android (Google) Code Review
Browse files

Merge "APM: use dock device for volume when dock device is selected." into udc-dev

parents c4b5507f a35a040f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -218,12 +218,15 @@ static inline audio_devices_t apm_extract_one_audio_device(
        return *(deviceTypes.begin());
    } 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 (deviceTypes.count(AUDIO_DEVICE_OUT_SPEAKER) != 0) {
        if (deviceTypes.count(AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET) != 0) {
            return AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET;
        } else if (deviceTypes.count(AUDIO_DEVICE_OUT_SPEAKER) != 0) {
            return AUDIO_DEVICE_OUT_SPEAKER;
        } else if (deviceTypes.count(AUDIO_DEVICE_OUT_SPEAKER_SAFE) != 0) {
            return AUDIO_DEVICE_OUT_SPEAKER_SAFE;