diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2011-04-18 10:18:37 -0700 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2011-04-18 10:21:27 -0700 |
commit | 72843377d50a8f95cceaf33d316ab68d9b47f2eb (patch) | |
tree | 963feb38b052019038db4836a7d6622cdeeff193 /media/java | |
parent | d589fea865e90859324f00d21765fa7d7759e465 (diff) | |
download | frameworks_base-72843377d50a8f95cceaf33d316ab68d9b47f2eb.zip frameworks_base-72843377d50a8f95cceaf33d316ab68d9b47f2eb.tar.gz frameworks_base-72843377d50a8f95cceaf33d316ab68d9b47f2eb.tar.bz2 |
Fix bug 2659754 ConcurrentModificationException in audio focus changes
While iterating over the audio focus stack or the media button
receiver stacks, do not modify the stack other than through the
iterator object.
Change-Id: Ice8827e7d29afed72b40c93edf7401cd54ba4b0c
Diffstat (limited to 'media/java')
-rw-r--r-- | media/java/android/media/AudioService.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index e1edf82..504cfde 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -2496,7 +2496,7 @@ public class AudioService extends IAudioService.Stub { if(fse.mClientId.equals(clientToRemove)) { Log.i(TAG, " AudioFocus abandonAudioFocus(): removing entry for " + fse.mClientId); - mFocusStack.remove(fse); + stackIterator.remove(); } } } @@ -2516,7 +2516,7 @@ public class AudioService extends IAudioService.Stub { if(fse.mSourceRef.equals(cb)) { Log.i(TAG, " AudioFocus abandonAudioFocus(): removing entry for " + fse.mClientId); - mFocusStack.remove(fse); + stackIterator.remove(); } } if (isTopOfStackForClientToRemove) { @@ -2789,7 +2789,7 @@ public class AudioService extends IAudioService.Stub { while(stackIterator.hasNext()) { RemoteControlStackEntry rcse = (RemoteControlStackEntry)stackIterator.next(); if(rcse.mReceiverComponent.equals(newReceiver)) { - mRCStack.remove(rcse); + stackIterator.remove(); break; } } @@ -2809,7 +2809,7 @@ public class AudioService extends IAudioService.Stub { while(stackIterator.hasNext()) { RemoteControlStackEntry rcse = (RemoteControlStackEntry)stackIterator.next(); if(rcse.mReceiverComponent.equals(newReceiver)) { - mRCStack.remove(rcse); + stackIterator.remove(); break; } } |