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

Commit 2930bb2d authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

Fix monkey bug 2586534 java.util.ConcurrentModificationException

Unlike the other audio focus and media button stack handling
methods, abandonAudioFocus() and unregisterAudioFocusClient() were
not synchronized around their focus stack. This CL corrects this.

Change-Id: I5ada574e4e163fa95da9dad2fefe610b48303320
parent c58b4232
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -2090,15 +2090,19 @@ public class AudioService extends IAudioService.Stub {
        Log.i(TAG, " AudioFocus  abandonAudioFocus() from " + clientId);

        // this will take care of notifying the new focus owner if needed
        synchronized(mFocusStack) {
            removeFocusStackEntry(clientId, true);
        }

        return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
    }


    public void unregisterAudioFocusClient(String clientId) {
        synchronized(mFocusStack) {
            removeFocusStackEntry(clientId, false);
        }
    }


    //==========================================================================================