Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java +18 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static com.android.systemui.statusbar.phone.StatusBar.ENABLE_LOCKSCREEN_W import static com.android.systemui.statusbar.phone.StatusBar.SHOW_LOCKSCREEN_MEDIA_ARTWORK; import android.annotation.MainThread; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.Notification; import android.content.Context; Loading Loading @@ -57,6 +58,7 @@ import com.android.systemui.statusbar.dagger.StatusBarModule; import com.android.systemui.statusbar.notification.NotificationEntryListener; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.notifcollection.NotifCollectionListener; import com.android.systemui.statusbar.phone.BiometricUnlockController; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.LockscreenWallpaper; Loading Loading @@ -233,8 +235,17 @@ public class NotificationMediaManager implements Dumpable { NotificationVisibility visibility, boolean removedByUser, int reason) { onNotificationRemoved(entry.getKey()); mediaDataManager.onNotificationRemoved(entry.getKey()); removeEntry(entry); } }); // Pending entries are never inflated, and will never generate a call to onEntryRemoved(). // This can happen when notifications are added and canceled before inflation. Add this // separate listener for cleanup, since media inflation occurs onPendingEntryAdded(). notificationEntryManager.addCollectionListener(new NotifCollectionListener() { @Override public void onEntryCleanUp(@NonNull NotificationEntry entry) { removeEntry(entry); } }); Loading @@ -247,6 +258,11 @@ public class NotificationMediaManager implements Dumpable { mPropertiesChangedListener); } private void removeEntry(NotificationEntry entry) { onNotificationRemoved(entry.getKey()); mMediaDataManager.onNotificationRemoved(entry.getKey()); } /** * Check if a state should be considered actively playing * @param state a PlaybackState Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java +18 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static com.android.systemui.statusbar.phone.StatusBar.ENABLE_LOCKSCREEN_W import static com.android.systemui.statusbar.phone.StatusBar.SHOW_LOCKSCREEN_MEDIA_ARTWORK; import android.annotation.MainThread; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.Notification; import android.content.Context; Loading Loading @@ -57,6 +58,7 @@ import com.android.systemui.statusbar.dagger.StatusBarModule; import com.android.systemui.statusbar.notification.NotificationEntryListener; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.notifcollection.NotifCollectionListener; import com.android.systemui.statusbar.phone.BiometricUnlockController; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.LockscreenWallpaper; Loading Loading @@ -233,8 +235,17 @@ public class NotificationMediaManager implements Dumpable { NotificationVisibility visibility, boolean removedByUser, int reason) { onNotificationRemoved(entry.getKey()); mediaDataManager.onNotificationRemoved(entry.getKey()); removeEntry(entry); } }); // Pending entries are never inflated, and will never generate a call to onEntryRemoved(). // This can happen when notifications are added and canceled before inflation. Add this // separate listener for cleanup, since media inflation occurs onPendingEntryAdded(). notificationEntryManager.addCollectionListener(new NotifCollectionListener() { @Override public void onEntryCleanUp(@NonNull NotificationEntry entry) { removeEntry(entry); } }); Loading @@ -247,6 +258,11 @@ public class NotificationMediaManager implements Dumpable { mPropertiesChangedListener); } private void removeEntry(NotificationEntry entry) { onNotificationRemoved(entry.getKey()); mMediaDataManager.onNotificationRemoved(entry.getKey()); } /** * Check if a state should be considered actively playing * @param state a PlaybackState Loading