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

Commit 5aff4813 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "AudioService: fix deadlock between readSettings() and VSS.setAllIndexes()"

parents f74e56af ad37c2c4
Loading
Loading
Loading
Loading
+19 −16
Original line number Original line Diff line number Diff line
@@ -4526,6 +4526,7 @@ public class AudioService extends IAudioService.Stub
            if (mStreamType == srcStream.mStreamType) {
            if (mStreamType == srcStream.mStreamType) {
                return;
                return;
            }
            }
            synchronized (mSettingsLock) {
                synchronized (VolumeStreamState.class) {
                synchronized (VolumeStreamState.class) {
                    int srcStreamType = srcStream.getStreamType();
                    int srcStreamType = srcStream.getStreamType();
                    // apply default device volume from source stream to all devices first in case
                    // apply default device volume from source stream to all devices first in case
@@ -4546,7 +4547,9 @@ public class AudioService extends IAudioService.Stub
                    }
                    }
                }
                }
            }
            }
        }


        @GuardedBy("mSettingsLock")
        public void setAllIndexesToMax() {
        public void setAllIndexesToMax() {
            synchronized (VolumeStreamState.class) {
            synchronized (VolumeStreamState.class) {
                for (int i = 0; i < mIndexMap.size(); i++) {
                for (int i = 0; i < mIndexMap.size(); i++) {