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

Commit b4d7e462 authored by Carter Hsu's avatar Carter Hsu Committed by Automerger Merge Worker
Browse files

Merge "audio: replace speaker to speaker safe if ring is active" into sc-dev...

Merge "audio: replace speaker to speaker safe if ring is active" into sc-dev am: 34891dbf am: 99a69930

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

Change-Id: I57f9000589288126503111f23c29a3c3de8bfcc5
parents b49b11c3 99a69930
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -393,12 +393,14 @@ DeviceVector Engine::getDevicesForStrategyInt(legacy_strategy strategy,
                || outputs.isActiveLocally(
                    toVolumeSource(AUDIO_STREAM_ACCESSIBILITY),
                    SONIFICATION_RESPECTFUL_AFTER_MUSIC_DELAY);
        // - for STRATEGY_SONIFICATION:

        bool ringActiveLocally = outputs.isActiveLocally(toVolumeSource(AUDIO_STREAM_RING), 0);
        // - for STRATEGY_SONIFICATION and ringtone active:
        // if SPEAKER was selected, and SPEAKER_SAFE is available, use SPEAKER_SAFE instead
        // - for STRATEGY_SONIFICATION_RESPECTFUL:
        // if no media is playing on the device, check for mandatory use of "safe" speaker
        // when media would have played on speaker, and the safe speaker path is available
        if (strategy == STRATEGY_SONIFICATION
        if (strategy == STRATEGY_SONIFICATION || ringActiveLocally
            || (strategy == STRATEGY_SONIFICATION_RESPECTFUL && !mediaActiveLocally)) {
            devices.replaceDevicesByType(
                    AUDIO_DEVICE_OUT_SPEAKER,