Loading media/java/android/media/AudioService.java +41 −39 Original line number Diff line number Diff line Loading @@ -3072,7 +3072,7 @@ public class AudioService extends IAudioService.Stub { /** * Update the remote control displays with the new "focused" client generation */ private void setNewRcClientOnDisplays_syncRcStack(int newClientGeneration, private void setNewRcClientOnDisplays_syncAfRcsCurrc(int newClientGeneration, ComponentName newClientEventReceiver, boolean clearing) { // NOTE: Only one IRemoteControlDisplay supported in this implementation if (mRcDisplay != null) { Loading @@ -3091,7 +3091,7 @@ public class AudioService extends IAudioService.Stub { /** * Update the remote control clients with the new "focused" client generation */ private void setNewRcClientGenerationOnClients_syncRcStack(int newClientGeneration) { private void setNewRcClientGenerationOnClients_syncAfRcsCurrc(int newClientGeneration) { Iterator<RemoteControlStackEntry> stackIterator = mRCStack.iterator(); while(stackIterator.hasNext()) { RemoteControlStackEntry se = stackIterator.next(); Loading @@ -3115,15 +3115,13 @@ public class AudioService extends IAudioService.Stub { * @param clearing true if the new client generation value maps to a remote control update * where the display should be cleared. */ private void setNewRcClient(int newClientGeneration, ComponentName newClientEventReceiver, boolean clearing) { synchronized(mRCStack) { private void setNewRcClient_syncAfRcsCurrc(int newClientGeneration, ComponentName newClientEventReceiver, boolean clearing) { // send the new valid client generation ID to all displays setNewRcClientOnDisplays_syncRcStack(newClientGeneration, newClientEventReceiver, setNewRcClientOnDisplays_syncAfRcsCurrc(newClientGeneration, newClientEventReceiver, clearing); // send the new valid client generation ID to all clients setNewRcClientGenerationOnClients_syncRcStack(newClientGeneration); } setNewRcClientGenerationOnClients_syncAfRcsCurrc(newClientGeneration); } /** Loading @@ -3133,11 +3131,13 @@ public class AudioService extends IAudioService.Stub { // TODO remove log before release Log.i(TAG, "Clear remote control display"); synchronized(mRCStack) { synchronized(mCurrentRcLock) { mCurrentRcClientGen++; // synchronously update the displays and clients with the new client generation setNewRcClient(mCurrentRcClientGen, null /*event receiver*/, true /*clearing*/); setNewRcClient_syncAfRcsCurrc(mCurrentRcClientGen, null /*event receiver*/, true /*clearing*/); } } } Loading @@ -3145,15 +3145,16 @@ public class AudioService extends IAudioService.Stub { * Called when processing MSG_RCDISPLAY_UPDATE event */ private void onRcDisplayUpdate(RemoteControlStackEntry rcse, int flags /* USED ?*/) { synchronized(mRCStack) { synchronized(mCurrentRcLock) { if ((mCurrentRcClient != null) && (mCurrentRcClient.equals(rcse.mRcClient))) { // TODO remove log before release Log.i(TAG, "Display/update remote control "); mCurrentRcClientGen++; // synchronously update the displays and clients with the new client generation setNewRcClient(mCurrentRcClientGen, // synchronously update the displays and clients with // the new client generation setNewRcClient_syncAfRcsCurrc(mCurrentRcClientGen, rcse.mReceiverComponent /*event receiver*/, false /*clearing*/); Loading @@ -3172,6 +3173,7 @@ public class AudioService extends IAudioService.Stub { } } } } /** Loading Loading
media/java/android/media/AudioService.java +41 −39 Original line number Diff line number Diff line Loading @@ -3072,7 +3072,7 @@ public class AudioService extends IAudioService.Stub { /** * Update the remote control displays with the new "focused" client generation */ private void setNewRcClientOnDisplays_syncRcStack(int newClientGeneration, private void setNewRcClientOnDisplays_syncAfRcsCurrc(int newClientGeneration, ComponentName newClientEventReceiver, boolean clearing) { // NOTE: Only one IRemoteControlDisplay supported in this implementation if (mRcDisplay != null) { Loading @@ -3091,7 +3091,7 @@ public class AudioService extends IAudioService.Stub { /** * Update the remote control clients with the new "focused" client generation */ private void setNewRcClientGenerationOnClients_syncRcStack(int newClientGeneration) { private void setNewRcClientGenerationOnClients_syncAfRcsCurrc(int newClientGeneration) { Iterator<RemoteControlStackEntry> stackIterator = mRCStack.iterator(); while(stackIterator.hasNext()) { RemoteControlStackEntry se = stackIterator.next(); Loading @@ -3115,15 +3115,13 @@ public class AudioService extends IAudioService.Stub { * @param clearing true if the new client generation value maps to a remote control update * where the display should be cleared. */ private void setNewRcClient(int newClientGeneration, ComponentName newClientEventReceiver, boolean clearing) { synchronized(mRCStack) { private void setNewRcClient_syncAfRcsCurrc(int newClientGeneration, ComponentName newClientEventReceiver, boolean clearing) { // send the new valid client generation ID to all displays setNewRcClientOnDisplays_syncRcStack(newClientGeneration, newClientEventReceiver, setNewRcClientOnDisplays_syncAfRcsCurrc(newClientGeneration, newClientEventReceiver, clearing); // send the new valid client generation ID to all clients setNewRcClientGenerationOnClients_syncRcStack(newClientGeneration); } setNewRcClientGenerationOnClients_syncAfRcsCurrc(newClientGeneration); } /** Loading @@ -3133,11 +3131,13 @@ public class AudioService extends IAudioService.Stub { // TODO remove log before release Log.i(TAG, "Clear remote control display"); synchronized(mRCStack) { synchronized(mCurrentRcLock) { mCurrentRcClientGen++; // synchronously update the displays and clients with the new client generation setNewRcClient(mCurrentRcClientGen, null /*event receiver*/, true /*clearing*/); setNewRcClient_syncAfRcsCurrc(mCurrentRcClientGen, null /*event receiver*/, true /*clearing*/); } } } Loading @@ -3145,15 +3145,16 @@ public class AudioService extends IAudioService.Stub { * Called when processing MSG_RCDISPLAY_UPDATE event */ private void onRcDisplayUpdate(RemoteControlStackEntry rcse, int flags /* USED ?*/) { synchronized(mRCStack) { synchronized(mCurrentRcLock) { if ((mCurrentRcClient != null) && (mCurrentRcClient.equals(rcse.mRcClient))) { // TODO remove log before release Log.i(TAG, "Display/update remote control "); mCurrentRcClientGen++; // synchronously update the displays and clients with the new client generation setNewRcClient(mCurrentRcClientGen, // synchronously update the displays and clients with // the new client generation setNewRcClient_syncAfRcsCurrc(mCurrentRcClientGen, rcse.mReceiverComponent /*event receiver*/, false /*clearing*/); Loading @@ -3172,6 +3173,7 @@ public class AudioService extends IAudioService.Stub { } } } } /** Loading