Remove all handler messages when controller is released
Issue: androidx/media#74 PiperOrigin-RevId: 448205908
This commit is contained in:
parent
efb49f285e
commit
9b07d71f66
@ -89,6 +89,8 @@
|
||||
([#59](https://github.com/androidx/media/pull/59))
|
||||
* Update session position info on timeline
|
||||
change([#51](https://github.com/androidx/media/issues/51))
|
||||
* Fix NPE in MediaControllerImplBase after releasing controller
|
||||
([#74](https://github.com/androidx/media/issues/74))
|
||||
|
||||
* Data sources:
|
||||
|
||||
|
@ -309,6 +309,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
serviceConnection = null;
|
||||
}
|
||||
connectedToken = null;
|
||||
flushCommandQueueHandler.removeCallbacksAndMessages(/* token= */ null);
|
||||
this.iSession = null;
|
||||
controllerStub.destroy();
|
||||
if (iSession != null) {
|
||||
@ -3046,9 +3047,9 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
}
|
||||
|
||||
public void sendFlushCommandQueueMessage() {
|
||||
// Send message to notify the end of the transaction. It will be handled when the current
|
||||
// looper iteration is over.
|
||||
if (!hasMessages(MSG_FLUSH_COMMAND_QUEUE)) {
|
||||
if (iSession != null && !hasMessages(MSG_FLUSH_COMMAND_QUEUE)) {
|
||||
// Send message to notify the end of the transaction. It will be handled when the current
|
||||
// looper iteration is over.
|
||||
sendEmptyMessage(MSG_FLUSH_COMMAND_QUEUE);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user