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

Commit 00afde12 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

Favor dock over speaker combination for SONIFICATION

When routing for STRATEGY_SONIFICATION, always favor
AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET over SPEAKER

Bug: 265727455
Test: play alarm when device is docked
Change-Id: Ia251bf5e2ca4a10319bcee6a874d108dc4a8ec7b
parent 0e50045c
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -291,7 +291,9 @@ DeviceVector Engine::getDevicesForStrategyInt(legacy_strategy strategy,

        if ((strategy == STRATEGY_SONIFICATION) ||
                (getForceUse(AUDIO_POLICY_FORCE_FOR_SYSTEM) == AUDIO_POLICY_FORCE_SYSTEM_ENFORCED)) {
            devices = availableOutputDevices.getDevicesFromType(AUDIO_DEVICE_OUT_SPEAKER);
            // favor dock over speaker when available
            devices = availableOutputDevices.getFirstDevicesFromTypes({
                    AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET, AUDIO_DEVICE_OUT_SPEAKER});
        }

        // if SCO headset is connected and we are told to use it, play ringtone over