From 29711b922d2b14cf89819af06a0a4dc2561bec7d Mon Sep 17 00:00:00 2001 From: olly Date: Mon, 21 Jan 2019 21:06:03 +0000 Subject: [PATCH] Cancel notification on dismiss This doesn't happen automatically after all on older devices PiperOrigin-RevId: 230251258 --- .../android/exoplayer2/ui/PlayerNotificationManager.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java b/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java index c01aabc9f2..97e36a17b3 100644 --- a/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java +++ b/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java @@ -928,10 +928,8 @@ public class PlayerNotificationManager { private void stopNotification(boolean dismissedByUser) { if (isNotificationStarted) { - if (!dismissedByUser) { - notificationManager.cancel(notificationId); - } isNotificationStarted = false; + notificationManager.cancel(notificationId); context.unregisterReceiver(notificationBroadcastReceiver); if (notificationListener != null) { notificationListener.onNotificationCancelled(notificationId, dismissedByUser);