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

Commit 98890fab authored by Dhanalakshmi Siddani's avatar Dhanalakshmi Siddani Committed by Linux Build Service Account
Browse files

audio: primary desc check for sonification_respectful

Ringtone will be played on combo device and touch tone is routed to
headset which results in device switch during ringtone playback. As
a result, audio glitches are audible.
If sonfication_respectful strategy is used by primary desc, we will
treat all non music streams with the same stragey which will avoid
device switch.

Change-Id: I5d7aef3b29791823c277452e71e0cd43f91b2ddd
parent 4e868717
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -4445,7 +4445,9 @@ audio_devices_t AudioPolicyManager::getNewOutputDevice(audio_io_handle_t output,
                (primaryOutputDesc->isStrategyActive(STRATEGY_SONIFICATION)
                && (!primaryOutputDesc->isStrategyActive(STRATEGY_MEDIA)))) {
        device = getDeviceForStrategy(STRATEGY_SONIFICATION, fromCache);
    } else if (outputDesc->isStrategyActive(STRATEGY_SONIFICATION_RESPECTFUL)) {
    } else if (outputDesc->isStrategyActive(STRATEGY_SONIFICATION_RESPECTFUL) ||
                (primaryOutputDesc->isStrategyActive(STRATEGY_SONIFICATION_RESPECTFUL)
                && (!primaryOutputDesc->isStrategyActive(STRATEGY_MEDIA)))) {
        device = getDeviceForStrategy(STRATEGY_SONIFICATION_RESPECTFUL, fromCache);
    } else if (outputDesc->isStrategyActive(STRATEGY_MEDIA)) {
        device = getDeviceForStrategy(STRATEGY_MEDIA, fromCache);