Skip to content

Commit 528e382

Browse files
jmtriviAndroid (Google) Code Review
authored andcommitted
Merge "Fix 5242200 only update RemoteControlDisplay when a client is present"
2 parents ac73e4b + 3387945 commit 528e382

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

media/java/android/media/AudioService.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3193,7 +3193,7 @@ private void clearRemoteControlDisplay_syncRcs() {
31933193
/**
31943194
* Helper function:
31953195
* Called synchronized on mRCStack
3196-
* mRCStack.empty() is false
3196+
* mRCStack.isEmpty() is false
31973197
*/
31983198
private void updateRemoteControlDisplay_syncRcs(int infoChangedFlags) {
31993199
RemoteControlStackEntry rcse = mRCStack.peek();
@@ -3247,6 +3247,7 @@ private void checkUpdateRemoteControlDisplay_syncRcs(int infoChangedFlags) {
32473247
return;
32483248
}
32493249
// refresh conditions were verified: update the remote controls
3250+
// ok to call, mRCStack is not empty
32503251
updateRemoteControlDisplay_syncRcs(infoChangedFlags);
32513252
}
32523253

@@ -3460,8 +3461,10 @@ public void registerRemoteControlDisplay(IRemoteControlDisplay rcd) {
34603461
}
34613462
}
34623463

3463-
// we have a new display, of which all the clients are now aware: have it be updated
3464-
updateRemoteControlDisplay_syncRcs(RC_INFO_ALL);
3464+
if (!mRCStack.isEmpty()) {
3465+
// we have a new display, of which all the clients are now aware: have it be updated
3466+
updateRemoteControlDisplay_syncRcs(RC_INFO_ALL);
3467+
}
34653468
}
34663469
}
34673470

0 commit comments

Comments
 (0)