Fix style and add comment about null player
This commit is contained in:
parent
4bc8e09271
commit
1b7a4c5b86
1 changed files with 2 additions and 5 deletions
|
|
@ -319,11 +319,8 @@ public final class PlayerService extends MediaBrowserServiceCompat {
|
||||||
public void setPlayerListener(@Nullable final Consumer<Player> listener) {
|
public void setPlayerListener(@Nullable final Consumer<Player> listener) {
|
||||||
this.onPlayerStartedOrStopped = listener;
|
this.onPlayerStartedOrStopped = listener;
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
if (player == null) {
|
// if there is no player, then `null` will be sent here, to ensure the state is synced
|
||||||
listener.accept(null);
|
listener.accept(player);
|
||||||
} else {
|
|
||||||
listener.accept(player);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//endregion
|
//endregion
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue