Commit 76baa572 by bachinger Committed by Oliver Woodman

solve nullness check warnings with asserts

PiperOrigin-RevId: 229755532
parent f2139d1b
......@@ -896,12 +896,14 @@ public class PlayerNotificationManager {
@Nullable
private Notification startOrUpdateNotification() {
return player != null ? startOrUpdateNotification(/* bitmap= */ null) : null;
Assertions.checkNotNull(this.player);
return startOrUpdateNotification(/* bitmap= */ null);
}
@RequiresNonNull("player")
@Nullable
private Notification startOrUpdateNotification(@Nullable Bitmap bitmap) {
Player player = this.player;
Notification notification = createNotification(player, bitmap);
if (notification == null) {
stopNotification(/* dismissedByUser= */ false);
......@@ -916,8 +918,7 @@ public class PlayerNotificationManager {
}
}
NotificationListener listener = notificationListener;
Player player = this.player;
if (listener != null && player != null) {
if (listener != null) {
boolean isPlayerActive =
player.getPlayWhenReady() && player.getPlaybackState() != Player.STATE_IDLE;
listener.onNotificationPosted(notificationId, notification, isPlayerActive);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment