summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--media/java/android/media/AudioService.java9
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);
+ }
}
}