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

Commit ee4b2c9b authored by Eric Laurent's avatar Eric Laurent Committed by android-build-merger
Browse files

audio policy: fix media volume after ringtone am: 57de36cc am: f3ef8248

am: 809acee9

Change-Id: I69beb8361d17fb215cf1d3d04faa97b25e78d371
parents 616445ea 809acee9
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -1329,6 +1329,7 @@ status_t AudioPolicyManager::stopSource(const sp<AudioOutputDescriptor>& outputD


            // force restoring the device selection on other active outputs if it differs from the
            // force restoring the device selection on other active outputs if it differs from the
            // one being selected for this output
            // one being selected for this output
            uint32_t delayMs = outputDesc->latency()*2;
            for (size_t i = 0; i < mOutputs.size(); i++) {
            for (size_t i = 0; i < mOutputs.size(); i++) {
                sp<AudioOutputDescriptor> desc = mOutputs.valueAt(i);
                sp<AudioOutputDescriptor> desc = mOutputs.valueAt(i);
                if (desc != outputDesc &&
                if (desc != outputDesc &&
@@ -1340,7 +1341,11 @@ status_t AudioPolicyManager::stopSource(const sp<AudioOutputDescriptor>& outputD
                    setOutputDevice(desc,
                    setOutputDevice(desc,
                                    newDevice2,
                                    newDevice2,
                                    force,
                                    force,
                                    outputDesc->latency()*2);
                                    delayMs);
                    // re-apply device specific volume if not done by setOutputDevice()
                    if (!force) {
                        applyStreamVolumes(desc, newDevice2, delayMs);
                    }
                }
                }
            }
            }
            // update the outputs if stopping one with a stream that can affect notification routing
            // update the outputs if stopping one with a stream that can affect notification routing