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

Commit 5fa0aed3 authored by juyuchen's avatar juyuchen Committed by Juyu Chen
Browse files

audio policy: choose bt-sco and speaker-safe path.



Choose speaker-safe-and-bt-sco path instead of speaker-and-bt-sco when
device is in ringtone mode.

Bug: 78257659
Test: manual audio test on B1/C1.

Signed-off-by: default avatarjuyuchen <juyuchen@google.com>
parent 88af67ed
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -453,6 +453,12 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy,
            }
            // Use both Bluetooth SCO and phone default output when ringing in normal mode
            if (mForceUse[AUDIO_POLICY_FORCE_FOR_COMMUNICATION] == AUDIO_POLICY_FORCE_BT_SCO) {
                if ((strategy == STRATEGY_SONIFICATION) &&
                        (device & AUDIO_DEVICE_OUT_SPEAKER) &&
                        (availableOutputDevicesType & AUDIO_DEVICE_OUT_SPEAKER_SAFE)) {
                    device |= AUDIO_DEVICE_OUT_SPEAKER_SAFE;
                    device &= ~AUDIO_DEVICE_OUT_SPEAKER;
                }
                if (device2 != AUDIO_DEVICE_NONE) {
                    device |= device2;
                    break;