Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java +1 −0 Original line number Diff line number Diff line Loading @@ -379,6 +379,7 @@ public class NotificationMediaManager implements Dumpable { } } @Nullable public String getMediaNotificationKey() { return mMediaNotificationKey; } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java +8 −6 Original line number Diff line number Diff line Loading @@ -20,8 +20,6 @@ import static android.service.notification.NotificationListenerService.REASON_ER import static com.android.systemui.statusbar.notification.collection.NotifCollection.REASON_UNKNOWN; import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.InflationCallback; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.Notification; import android.os.RemoteException; import android.os.SystemClock; Loading @@ -33,6 +31,9 @@ import android.util.ArrayMap; import android.util.ArraySet; import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; Loading Loading @@ -123,8 +124,8 @@ public class NotificationEntryManager implements * filtered out if for instance they are not for the current user */ private final ArrayMap<String, NotificationEntry> mActiveNotifications = new ArrayMap<>(); @VisibleForTesting /** This is the list of "active notifications for this user in this context" */ @VisibleForTesting protected final ArrayList<NotificationEntry> mSortedAndFiltered = new ArrayList<>(); private final List<NotificationEntry> mReadOnlyNotifications = Collections.unmodifiableList(mSortedAndFiltered); Loading Loading @@ -899,7 +900,7 @@ public class NotificationEntryManager implements } /** Calls to NotificationRankingManager and updates mSortedAndFiltered */ private void updateRankingAndSort(@NonNull RankingMap rankingMap, String reason) { private void updateRankingAndSort(RankingMap rankingMap, String reason) { if (mNotifPipelineFlags.isNewPipelineEnabled()) { mLogger.logUseWhileNewPipelineActive("updateRankingAndSort", reason); return; Loading Loading @@ -961,6 +962,7 @@ public class NotificationEntryManager implements * Returns a collections containing ALL notifications we know about, including ones that are * hidden or for other users. See {@link CommonNotifCollection#getAllNotifs()}. */ @NonNull @Override public Collection<NotificationEntry> getAllNotifs() { mNotifPipelineFlags.checkLegacyPipelineEnabled(); Loading @@ -969,7 +971,7 @@ public class NotificationEntryManager implements @Nullable @Override public NotificationEntry getEntry(String key) { public NotificationEntry getEntry(@NonNull String key) { mNotifPipelineFlags.checkLegacyPipelineEnabled(); return getPendingOrActiveNotif(key); } Loading @@ -989,7 +991,7 @@ public class NotificationEntryManager implements } @Override public void addCollectionListener(NotifCollectionListener listener) { public void addCollectionListener(@NonNull NotifCollectionListener listener) { mNotifCollectionListeners.add(listener); } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java +3 −2 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ import static java.util.Objects.requireNonNull; import android.annotation.IntDef; import android.annotation.MainThread; import android.annotation.Nullable; import android.annotation.UserIdInt; import android.app.Notification; import android.os.Handler; Loading @@ -59,6 +58,7 @@ import android.util.ArrayMap; import android.util.Pair; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.internal.statusbar.IStatusBarService; import com.android.systemui.Dumpable; Loading Loading @@ -193,7 +193,8 @@ public class NotifCollection implements Dumpable { } /** @see NotifPipeline#getEntry(String) () */ NotificationEntry getEntry(String key) { @Nullable NotificationEntry getEntry(@NonNull String key) { return mNotificationSet.get(key); } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/notifcollection/CommonNotifCollection.java +4 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.notification.collection.notifcollection; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.systemui.statusbar.notification.NotificationEntryManager; Loading @@ -37,7 +38,7 @@ public interface CommonNotifCollection { * Registers a listener to be informed when notifications are created, added, updated, removed, * or deleted. */ void addCollectionListener(NotifCollectionListener listener); void addCollectionListener(@NonNull NotifCollectionListener listener); /** * Returns the list of all known notifications, i.e. the notifications that are currently posted Loading @@ -46,11 +47,11 @@ public interface CommonNotifCollection { * * The returned collection is read-only, unsorted, unfiltered, and ungrouped. */ Collection<NotificationEntry> getAllNotifs(); @NonNull Collection<NotificationEntry> getAllNotifs(); /** * Returns the notification entry for the given notification key; * the returned entry (if present) may be in any state. */ @Nullable NotificationEntry getEntry(String key); @Nullable NotificationEntry getEntry(@NonNull String key); } packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/BypassHeadsUpNotifier.kt +5 −5 Original line number Diff line number Diff line Loading @@ -77,11 +77,11 @@ class BypassHeadsUpNotifier @Inject constructor( override fun onPrimaryMetadataOrStateChanged(metadata: MediaMetadata?, state: Int) { val previous = currentMediaEntry var newEntry = commonNotifCollection.getEntry(mediaManager.mediaNotificationKey) if (!NotificationMediaManager.isPlayingState(state)) { newEntry = null } currentMediaEntry = newEntry val mediaNotificationKey = mediaManager.mediaNotificationKey currentMediaEntry = if (mediaNotificationKey != null && NotificationMediaManager.isPlayingState(state)) commonNotifCollection.getEntry(mediaNotificationKey) else null updateAutoHeadsUp(previous) updateAutoHeadsUp(currentMediaEntry) } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java +1 −0 Original line number Diff line number Diff line Loading @@ -379,6 +379,7 @@ public class NotificationMediaManager implements Dumpable { } } @Nullable public String getMediaNotificationKey() { return mMediaNotificationKey; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java +8 −6 Original line number Diff line number Diff line Loading @@ -20,8 +20,6 @@ import static android.service.notification.NotificationListenerService.REASON_ER import static com.android.systemui.statusbar.notification.collection.NotifCollection.REASON_UNKNOWN; import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.InflationCallback; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.Notification; import android.os.RemoteException; import android.os.SystemClock; Loading @@ -33,6 +31,9 @@ import android.util.ArrayMap; import android.util.ArraySet; import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; Loading Loading @@ -123,8 +124,8 @@ public class NotificationEntryManager implements * filtered out if for instance they are not for the current user */ private final ArrayMap<String, NotificationEntry> mActiveNotifications = new ArrayMap<>(); @VisibleForTesting /** This is the list of "active notifications for this user in this context" */ @VisibleForTesting protected final ArrayList<NotificationEntry> mSortedAndFiltered = new ArrayList<>(); private final List<NotificationEntry> mReadOnlyNotifications = Collections.unmodifiableList(mSortedAndFiltered); Loading Loading @@ -899,7 +900,7 @@ public class NotificationEntryManager implements } /** Calls to NotificationRankingManager and updates mSortedAndFiltered */ private void updateRankingAndSort(@NonNull RankingMap rankingMap, String reason) { private void updateRankingAndSort(RankingMap rankingMap, String reason) { if (mNotifPipelineFlags.isNewPipelineEnabled()) { mLogger.logUseWhileNewPipelineActive("updateRankingAndSort", reason); return; Loading Loading @@ -961,6 +962,7 @@ public class NotificationEntryManager implements * Returns a collections containing ALL notifications we know about, including ones that are * hidden or for other users. See {@link CommonNotifCollection#getAllNotifs()}. */ @NonNull @Override public Collection<NotificationEntry> getAllNotifs() { mNotifPipelineFlags.checkLegacyPipelineEnabled(); Loading @@ -969,7 +971,7 @@ public class NotificationEntryManager implements @Nullable @Override public NotificationEntry getEntry(String key) { public NotificationEntry getEntry(@NonNull String key) { mNotifPipelineFlags.checkLegacyPipelineEnabled(); return getPendingOrActiveNotif(key); } Loading @@ -989,7 +991,7 @@ public class NotificationEntryManager implements } @Override public void addCollectionListener(NotifCollectionListener listener) { public void addCollectionListener(@NonNull NotifCollectionListener listener) { mNotifCollectionListeners.add(listener); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java +3 −2 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ import static java.util.Objects.requireNonNull; import android.annotation.IntDef; import android.annotation.MainThread; import android.annotation.Nullable; import android.annotation.UserIdInt; import android.app.Notification; import android.os.Handler; Loading @@ -59,6 +58,7 @@ import android.util.ArrayMap; import android.util.Pair; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.internal.statusbar.IStatusBarService; import com.android.systemui.Dumpable; Loading Loading @@ -193,7 +193,8 @@ public class NotifCollection implements Dumpable { } /** @see NotifPipeline#getEntry(String) () */ NotificationEntry getEntry(String key) { @Nullable NotificationEntry getEntry(@NonNull String key) { return mNotificationSet.get(key); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/notifcollection/CommonNotifCollection.java +4 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.notification.collection.notifcollection; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.systemui.statusbar.notification.NotificationEntryManager; Loading @@ -37,7 +38,7 @@ public interface CommonNotifCollection { * Registers a listener to be informed when notifications are created, added, updated, removed, * or deleted. */ void addCollectionListener(NotifCollectionListener listener); void addCollectionListener(@NonNull NotifCollectionListener listener); /** * Returns the list of all known notifications, i.e. the notifications that are currently posted Loading @@ -46,11 +47,11 @@ public interface CommonNotifCollection { * * The returned collection is read-only, unsorted, unfiltered, and ungrouped. */ Collection<NotificationEntry> getAllNotifs(); @NonNull Collection<NotificationEntry> getAllNotifs(); /** * Returns the notification entry for the given notification key; * the returned entry (if present) may be in any state. */ @Nullable NotificationEntry getEntry(String key); @Nullable NotificationEntry getEntry(@NonNull String key); }
packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/BypassHeadsUpNotifier.kt +5 −5 Original line number Diff line number Diff line Loading @@ -77,11 +77,11 @@ class BypassHeadsUpNotifier @Inject constructor( override fun onPrimaryMetadataOrStateChanged(metadata: MediaMetadata?, state: Int) { val previous = currentMediaEntry var newEntry = commonNotifCollection.getEntry(mediaManager.mediaNotificationKey) if (!NotificationMediaManager.isPlayingState(state)) { newEntry = null } currentMediaEntry = newEntry val mediaNotificationKey = mediaManager.mediaNotificationKey currentMediaEntry = if (mediaNotificationKey != null && NotificationMediaManager.isPlayingState(state)) commonNotifCollection.getEntry(mediaNotificationKey) else null updateAutoHeadsUp(previous) updateAutoHeadsUp(currentMediaEntry) } Loading