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

Commit 802ad1d3 authored by Eric Laurent's avatar Eric Laurent
Browse files

audio policy: fix speakerphone mode for digital dock

When connected to a digital dock, ignore the device speaker for
phone strategy: whether speakerphone mode is on or off, only the
dock should be used for call audio.

Bug: 233690682
Test: make

Change-Id: Ie0d5e14eedb86d12ad5874bb94b4a75b9fb65410
parent aa71142c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -195,6 +195,12 @@ void Engine::filterOutputDevicesForStrategy(legacy_strategy strategy,
                    AUDIO_DEVICE_OUT_BLUETOOTH_A2DP, AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES,
                    AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER, }));
        }
        // If connected to a dock, never use the device speaker for calls
        if (!availableOutputDevices.getDevicesFromTypes({AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET})
                .isEmpty()) {
            availableOutputDevices.remove(
                    availableOutputDevices.getDevicesFromTypes({AUDIO_DEVICE_OUT_SPEAKER}));
        }
        } break;
    case STRATEGY_ACCESSIBILITY: {
        // do not route accessibility prompts to a digital output currently configured with a