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

Commit f4de36d1 authored by yucliu's avatar yucliu Committed by Yuchen Liu
Browse files

Invalidate stream when unregistering audio policy mix

Invalidate the stream if the audio policy mix on the client is removed,
so that the client can reconnect to another output stream.

Bug: 167605686
Test: Unregister audio policy by killing the app. Audio resumes.
Change-Id: I9a00311142613df8c019206c9b7c873ec8f42b88
parent a7f98a1e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -113,6 +113,9 @@ public:
    const sp<AudioPolicyMix> getPrimaryMix() const {
        return mPrimaryMix.promote();
    };
    bool hasLostPrimaryMix() const {
        return mPrimaryMix.unsafe_get() && !mPrimaryMix.promote();
    }

    void setActive(bool active) override
    {
+1 −1
Original line number Diff line number Diff line
@@ -5354,7 +5354,7 @@ void AudioPolicyManager::checkOutputForAttributes(const audio_attributes_t &attr
            if (status != OK) {
                continue;
            }
            if (client->getPrimaryMix() != primaryMix) {
            if (client->getPrimaryMix() != primaryMix || client->hasLostPrimaryMix()) {
                invalidate = true;
                if (desc->isStrategyActive(psId)) {
                    maxLatency = desc->latency();