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

Commit b62d78b7 authored by Tomoharu Kasahara's avatar Tomoharu Kasahara Committed by Jean-Michel Trivi
Browse files

The sonification sound is muted during a shutter sound

In order to fulfill requirements from some operators the
shutter sound must be heard clearly when playing a ringtone.
The new policy is that STRATEGY_SONIFICATION will be muted
on an output if FORCE_SYSTEM_ENFORCED is set.

Bug: 72295489
Test: Check if ringtone is muted when playing shutter sound.
Change-Id: I10a9ee91eed747fa526260738636b7506bc1f7a5
parent 33727281
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1266,6 +1266,11 @@ status_t AudioPolicyManager::startSource(const sp<AudioOutputDescriptor>& output
        // We do not introduce additional delay here.
    }

    if (stream == AUDIO_STREAM_ENFORCED_AUDIBLE &&
            mEngine->getForceUse(AUDIO_POLICY_FORCE_FOR_SYSTEM) == AUDIO_POLICY_FORCE_SYSTEM_ENFORCED) {
        setStrategyMute(STRATEGY_SONIFICATION, true, outputDesc);
    }

    return NO_ERROR;
}

@@ -1366,6 +1371,12 @@ status_t AudioPolicyManager::stopSource(const sp<AudioOutputDescriptor>& outputD
            // update the outputs if stopping one with a stream that can affect notification routing
            handleNotificationRoutingForStream(stream);
        }

        if (stream == AUDIO_STREAM_ENFORCED_AUDIBLE &&
                mEngine->getForceUse(AUDIO_POLICY_FORCE_FOR_SYSTEM) == AUDIO_POLICY_FORCE_SYSTEM_ENFORCED) {
            setStrategyMute(STRATEGY_SONIFICATION, false, outputDesc);
        }

        if (stream == AUDIO_STREAM_MUSIC) {
            selectOutputForMusicEffects();
        }