mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
solve nullness check warnings with asserts
PiperOrigin-RevId: 229755532
This commit is contained in:
parent
f2139d1b71
commit
76baa5724c
1 changed files with 4 additions and 3 deletions
|
|
@ -896,12 +896,14 @@ public class PlayerNotificationManager {
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private Notification startOrUpdateNotification() {
|
private Notification startOrUpdateNotification() {
|
||||||
return player != null ? startOrUpdateNotification(/* bitmap= */ null) : null;
|
Assertions.checkNotNull(this.player);
|
||||||
|
return startOrUpdateNotification(/* bitmap= */ null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresNonNull("player")
|
@RequiresNonNull("player")
|
||||||
@Nullable
|
@Nullable
|
||||||
private Notification startOrUpdateNotification(@Nullable Bitmap bitmap) {
|
private Notification startOrUpdateNotification(@Nullable Bitmap bitmap) {
|
||||||
|
Player player = this.player;
|
||||||
Notification notification = createNotification(player, bitmap);
|
Notification notification = createNotification(player, bitmap);
|
||||||
if (notification == null) {
|
if (notification == null) {
|
||||||
stopNotification(/* dismissedByUser= */ false);
|
stopNotification(/* dismissedByUser= */ false);
|
||||||
|
|
@ -916,8 +918,7 @@ public class PlayerNotificationManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NotificationListener listener = notificationListener;
|
NotificationListener listener = notificationListener;
|
||||||
Player player = this.player;
|
if (listener != null) {
|
||||||
if (listener != null && player != null) {
|
|
||||||
boolean isPlayerActive =
|
boolean isPlayerActive =
|
||||||
player.getPlayWhenReady() && player.getPlaybackState() != Player.STATE_IDLE;
|
player.getPlayWhenReady() && player.getPlaybackState() != Player.STATE_IDLE;
|
||||||
listener.onNotificationPosted(notificationId, notification, isPlayerActive);
|
listener.onNotificationPosted(notificationId, notification, isPlayerActive);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue