diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2011-08-31 11:42:17 -0700 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2011-08-31 11:52:16 -0700 |
commit | 338794576667745b060ac269b2c2b36e0c6964f2 (patch) | |
tree | b992e663dd4ec34c8bed2eaed65bad6de3eab34e | |
parent | 49fb943db85c748fc7dd4f5ee4a461d7489fb1b0 (diff) | |
download | frameworks_base-338794576667745b060ac269b2c2b36e0c6964f2.zip frameworks_base-338794576667745b060ac269b2c2b36e0c6964f2.tar.gz frameworks_base-338794576667745b060ac269b2c2b36e0c6964f2.tar.bz2 |
Fix 5242200 only update RemoteControlDisplay when a client is present
A precondition for updateRemoteControlDisplay_syncRcs() is that
mRCStack is not null. This condition was not verified when
registering a RemoteControlDisplay.
Change-Id: I0b152410e57c590114b387e9ab83f0c4d15d060d
-rw-r--r-- | media/java/android/media/AudioService.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index bfc6b5d..de94ebd 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -3193,7 +3193,7 @@ public class AudioService extends IAudioService.Stub { /** * Helper function: * Called synchronized on mRCStack - * mRCStack.empty() is false + * mRCStack.isEmpty() is false */ private void updateRemoteControlDisplay_syncRcs(int infoChangedFlags) { RemoteControlStackEntry rcse = mRCStack.peek(); @@ -3247,6 +3247,7 @@ public class AudioService extends IAudioService.Stub { return; } // refresh conditions were verified: update the remote controls + // ok to call, mRCStack is not empty updateRemoteControlDisplay_syncRcs(infoChangedFlags); } @@ -3460,8 +3461,10 @@ public class AudioService extends IAudioService.Stub { } } - // we have a new display, of which all the clients are now aware: have it be updated - updateRemoteControlDisplay_syncRcs(RC_INFO_ALL); + if (!mRCStack.isEmpty()) { + // we have a new display, of which all the clients are now aware: have it be updated + updateRemoteControlDisplay_syncRcs(RC_INFO_ALL); + } } } |