Loading packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java +5 −1 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ import com.android.systemui.statusbar.notification.collection.NotifPipeline; import com.android.systemui.statusbar.notification.collection.inflation.NotificationRowBinder; import com.android.systemui.statusbar.notification.collection.inflation.NotificationRowBinderImpl; import com.android.systemui.statusbar.notification.collection.legacy.NotificationGroupManagerLegacy; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.statusbar.notification.interruption.NotificationInterruptStateProvider; import com.android.systemui.statusbar.notification.people.PeopleHubModule; import com.android.systemui.statusbar.notification.row.dagger.ExpandableNotificationRowComponent; Loading Loading @@ -204,7 +205,9 @@ public abstract class SystemUIModule { NotificationShadeWindowController notificationShadeWindowController, StatusBarStateController statusBarStateController, ShadeController shadeController, ConfigurationController configurationController, @Nullable IStatusBarService statusBarService, INotificationManager notificationManager, @Nullable IStatusBarService statusBarService, INotificationManager notificationManager, NotificationVisibilityProvider visibilityProvider, NotificationInterruptStateProvider interruptionStateProvider, ZenModeController zenModeController, NotificationLockscreenUserManager notifUserManager, NotificationGroupManagerLegacy groupManager, NotificationEntryManager entryManager, Loading @@ -213,6 +216,7 @@ public abstract class SystemUIModule { return Optional.ofNullable(BubblesManager.create(context, bubblesOptional, notificationShadeWindowController, statusBarStateController, shadeController, configurationController, statusBarService, notificationManager, visibilityProvider, interruptionStateProvider, zenModeController, notifUserManager, groupManager, entryManager, notifPipeline, sysUiState, featureFlags, dumpManager, sysuiMainExecutor)); Loading packages/SystemUI/src/com/android/systemui/people/widget/LaunchConversationActivity.java +18 −14 Original line number Diff line number Diff line Loading @@ -36,8 +36,9 @@ import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import com.android.systemui.people.PeopleSpaceUtils; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.wmshell.BubblesManager; import com.android.wm.shell.bubbles.Bubble; Loading @@ -50,7 +51,8 @@ public class LaunchConversationActivity extends Activity { private static final String TAG = "PeopleSpaceLaunchConv"; private static final boolean DEBUG = PeopleSpaceUtils.DEBUG; private UiEventLogger mUiEventLogger = new UiEventLoggerImpl(); private NotificationEntryManager mNotificationEntryManager; private NotificationVisibilityProvider mVisibilityProvider; private CommonNotifCollection mCommonNotifCollection; private final Optional<BubblesManager> mBubblesManagerOptional; private final UserManager mUserManager; private boolean mIsForTesting; Loading @@ -60,11 +62,16 @@ public class LaunchConversationActivity extends Activity { private NotificationEntry mEntryToBubble; @Inject public LaunchConversationActivity(NotificationEntryManager notificationEntryManager, Optional<BubblesManager> bubblesManagerOptional, UserManager userManager, CommandQueue commandQueue) { public LaunchConversationActivity( NotificationVisibilityProvider visibilityProvider, CommonNotifCollection commonNotifCollection, Optional<BubblesManager> bubblesManagerOptional, UserManager userManager, CommandQueue commandQueue ) { super(); mNotificationEntryManager = notificationEntryManager; mVisibilityProvider = visibilityProvider; mCommonNotifCollection = commonNotifCollection; mBubblesManagerOptional = bubblesManagerOptional; mUserManager = userManager; mCommandQueue = commandQueue; Loading Loading @@ -128,8 +135,7 @@ public class LaunchConversationActivity extends Activity { // shortcutId, fallback to notificationKey if it exists. if (mBubblesManagerOptional.isPresent()) { mBubble = mBubblesManagerOptional.get().getBubbleWithShortcutId(tileId); NotificationEntry entry = mNotificationEntryManager.getPendingOrActiveNotif( notificationKey); NotificationEntry entry = mCommonNotifCollection.getEntry(notificationKey); if (mBubble != null || (entry != null && entry.canBubble())) { mEntryToBubble = entry; if (DEBUG) { Loading Loading @@ -167,14 +173,14 @@ public class LaunchConversationActivity extends Activity { } try { if (mIStatusBarService == null || mNotificationEntryManager == null) { if (mIStatusBarService == null || mCommonNotifCollection == null) { if (DEBUG) { Log.d(TAG, "Skipping clear notification: null services, key: " + notifKey); } return; } NotificationEntry entry = mNotificationEntryManager.getPendingOrActiveNotif(notifKey); NotificationEntry entry = mCommonNotifCollection.getEntry(notifKey); if (entry == null || entry.getRanking() == null) { if (DEBUG) { Log.d(TAG, "Skipping clear notification: NotificationEntry or its Ranking" Loading @@ -183,10 +189,8 @@ public class LaunchConversationActivity extends Activity { return; } int count = mNotificationEntryManager.getActiveNotificationsCount(); int rank = entry.getRanking().getRank(); NotificationVisibility notifVisibility = NotificationVisibility.obtain(notifKey, rank, count, true); NotificationVisibility notifVisibility = mVisibilityProvider.obtain(entry, true); int rank = notifVisibility.rank; if (DEBUG) Log.d(TAG, "Clearing notification, key: " + notifKey + ", rank: " + rank); mIStatusBarService.onNotificationClear( Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java +18 −10 Original line number Diff line number Diff line Loading @@ -51,12 +51,13 @@ import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FeatureFlags; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener; import com.android.systemui.recents.OverviewProxyService; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.logging.NotificationLogger; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.KeyguardStateController; Loading @@ -67,6 +68,8 @@ import java.util.List; import javax.inject.Inject; import dagger.Lazy; /** * Handles keeping track of the current user, profiles, and various things related to hiding * contents, redacting notifications, and the lockscreen. Loading @@ -86,6 +89,8 @@ public class NotificationLockscreenUserManagerImpl implements // Lazy private NotificationEntryManager mEntryManager; private final FeatureFlags mFeatureFlags; private final Lazy<NotificationVisibilityProvider> mVisibilityProviderLazy; private final DevicePolicyManager mDevicePolicyManager; private final SparseBooleanArray mLockscreenPublicMode = new SparseBooleanArray(); private final SparseBooleanArray mUsersWithSeperateWorkChallenge = new SparseBooleanArray(); Loading Loading @@ -162,15 +167,8 @@ public class NotificationLockscreenUserManagerImpl implements } } if (notificationKey != null) { NotificationEntry entry = getEntryManager().getActiveNotificationUnfiltered(notificationKey); final int count = getEntryManager().getActiveNotificationsCount(); final int rank = entry != null ? entry.getRanking().getRank() : 0; NotificationVisibility.NotificationLocation location = NotificationLogger.getNotificationLocation(entry); final NotificationVisibility nv = NotificationVisibility.obtain( notificationKey, rank, count, true, location); final NotificationVisibility nv = mVisibilityProviderLazy.get() .obtain(notificationKey, true); mClickNotifier.onNotificationClick(notificationKey, nv); } break; Loading @@ -197,9 +195,11 @@ public class NotificationLockscreenUserManagerImpl implements @Inject public NotificationLockscreenUserManagerImpl(Context context, FeatureFlags featureFlags, BroadcastDispatcher broadcastDispatcher, DevicePolicyManager devicePolicyManager, UserManager userManager, Lazy<NotificationVisibilityProvider> visibilityProviderLazy, NotificationClickNotifier clickNotifier, KeyguardManager keyguardManager, StatusBarStateController statusBarStateController, Loading @@ -208,10 +208,12 @@ public class NotificationLockscreenUserManagerImpl implements KeyguardStateController keyguardStateController, DumpManager dumpManager) { mContext = context; mFeatureFlags = featureFlags; mMainHandler = mainHandler; mDevicePolicyManager = devicePolicyManager; mUserManager = userManager; mCurrentUserId = ActivityManager.getCurrentUser(); mVisibilityProviderLazy = visibilityProviderLazy; mClickNotifier = clickNotifier; statusBarStateController.addCallback(this); mLockPatternUtils = new LockPatternUtils(context); Loading Loading @@ -337,6 +339,8 @@ public class NotificationLockscreenUserManagerImpl implements * package-specific override. */ public boolean shouldHideNotifications(String key) { // TODO(b/204764178): support new pipeline mFeatureFlags.checkLegacyPipelineEnabled(); if (getEntryManager() == null) { Log.wtf(TAG, "mEntryManager was null!", new Throwable()); return true; Loading @@ -347,6 +351,8 @@ public class NotificationLockscreenUserManagerImpl implements } public boolean shouldShowOnKeyguard(NotificationEntry entry) { // TODO(b/204764178): support new pipeline mFeatureFlags.checkLegacyPipelineEnabled(); if (getEntryManager() == null) { Log.wtf(TAG, "mEntryManager was null!", new Throwable()); return false; Loading Loading @@ -520,6 +526,8 @@ public class NotificationLockscreenUserManagerImpl implements } private boolean packageHasVisibilityOverride(String key) { // TODO(b/204764178): support new pipeline mFeatureFlags.checkLegacyPipelineEnabled(); if (getEntryManager() == null) { Log.wtf(TAG, "mEntryManager was null!", new Throwable()); return true; Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java +6 −17 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ import com.android.systemui.statusbar.notification.collection.NotifPipeline; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.notifcollection.DismissedByUserStats; import com.android.systemui.statusbar.notification.collection.notifcollection.NotifCollectionListener; import com.android.systemui.statusbar.notification.logging.NotificationLogger; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.statusbar.phone.BiometricUnlockController; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.LockscreenWallpaper; Loading Loading @@ -113,6 +113,7 @@ public class NotificationMediaManager implements Dumpable { PAUSED_MEDIA_STATES.add(PlaybackState.STATE_CONNECTING); } private final NotificationVisibilityProvider mVisibilityProvider; private final NotificationEntryManager mEntryManager; private final MediaDataManager mMediaDataManager; private final NotifPipeline mNotifPipeline; Loading Loading @@ -181,6 +182,7 @@ public class NotificationMediaManager implements Dumpable { Context context, Lazy<Optional<StatusBar>> statusBarOptionalLazy, Lazy<NotificationShadeWindowController> notificationShadeWindowController, NotificationVisibilityProvider visibilityProvider, NotificationEntryManager notificationEntryManager, MediaArtworkProcessor mediaArtworkProcessor, KeyguardBypassController keyguardBypassController, Loading @@ -201,6 +203,7 @@ public class NotificationMediaManager implements Dumpable { // TODO: use KeyguardStateController#isOccluded to remove this dependency mStatusBarOptionalLazy = statusBarOptionalLazy; mNotificationShadeWindowController = notificationShadeWindowController; mVisibilityProvider = visibilityProvider; mEntryManager = notificationEntryManager; mMainExecutor = mainExecutor; mMediaDataManager = mediaDataManager; Loading Loading @@ -351,21 +354,10 @@ public class NotificationMediaManager implements Dumpable { } private DismissedByUserStats getDismissedByUserStats(NotificationEntry entry) { final int activeNotificationsCount; if (mUsingNotifPipeline) { activeNotificationsCount = mNotifPipeline.getShadeListCount(); } else { activeNotificationsCount = mEntryManager.getActiveNotificationsCount(); } return new DismissedByUserStats( NotificationStats.DISMISSAL_SHADE, // Add DISMISSAL_MEDIA? NotificationStats.DISMISS_SENTIMENT_NEUTRAL, NotificationVisibility.obtain( entry.getKey(), entry.getRanking().getRank(), activeNotificationsCount, /* visible= */ true, NotificationLogger.getNotificationLocation(entry))); mVisibilityProvider.obtain(entry, /* visible= */ true)); } private void removeEntry(NotificationEntry entry) { Loading Loading @@ -406,10 +398,7 @@ public class NotificationMediaManager implements Dumpable { return null; } if (mUsingNotifPipeline) { // TODO(b/169655596): Either add O(1) lookup, or cache this icon? return mNotifPipeline.getAllNotifs().stream() .filter(entry -> Objects.equals(entry.getKey(), mMediaNotificationKey)) .findAny() return Optional.ofNullable(mNotifPipeline.getEntry(mMediaNotificationKey)) .map(entry -> entry.getIcons().getShelfIcon()) .map(StatusBarIconView::getSourceIcon) .orElse(null); Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java +5 −8 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ 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.NotificationEntry.EditedSuggestionInfo; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.statusbar.notification.logging.NotificationLogger; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.phone.StatusBar; Loading Loading @@ -95,6 +96,7 @@ public class NotificationRemoteInputManager implements Dumpable { // Dependencies: private final NotificationLockscreenUserManager mLockscreenUserManager; private final SmartReplyController mSmartReplyController; private final NotificationVisibilityProvider mVisibilityProvider; private final NotificationEntryManager mEntryManager; private final Handler mMainHandler; private final ActionClickLogger mLogger; Loading Loading @@ -202,14 +204,7 @@ public class NotificationRemoteInputManager implements Dumpable { ViewGroup actionGroup = (ViewGroup) parent; buttonIndex = actionGroup.indexOfChild(view); } // TODO(b/204183781): get this from the current pipeline final int count = mEntryManager.getActiveNotificationsCount(); final int rank = entry.getRanking().getRank(); NotificationVisibility.NotificationLocation location = NotificationLogger.getNotificationLocation(entry); final NotificationVisibility nv = NotificationVisibility.obtain(key, rank, count, true, location); final NotificationVisibility nv = mVisibilityProvider.obtain(entry, true); mClickNotifier.onNotificationActionClick(key, buttonIndex, action, nv, false); } Loading Loading @@ -263,6 +258,7 @@ public class NotificationRemoteInputManager implements Dumpable { FeatureFlags featureFlags, NotificationLockscreenUserManager lockscreenUserManager, SmartReplyController smartReplyController, NotificationVisibilityProvider visibilityProvider, NotificationEntryManager notificationEntryManager, RemoteInputNotificationRebuilder rebuilder, Lazy<Optional<StatusBar>> statusBarOptionalLazy, Loading @@ -276,6 +272,7 @@ public class NotificationRemoteInputManager implements Dumpable { mFeatureFlags = featureFlags; mLockscreenUserManager = lockscreenUserManager; mSmartReplyController = smartReplyController; mVisibilityProvider = visibilityProvider; mEntryManager = notificationEntryManager; mStatusBarOptionalLazy = statusBarOptionalLazy; mMainHandler = mainHandler; Loading Loading
packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java +5 −1 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ import com.android.systemui.statusbar.notification.collection.NotifPipeline; import com.android.systemui.statusbar.notification.collection.inflation.NotificationRowBinder; import com.android.systemui.statusbar.notification.collection.inflation.NotificationRowBinderImpl; import com.android.systemui.statusbar.notification.collection.legacy.NotificationGroupManagerLegacy; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.statusbar.notification.interruption.NotificationInterruptStateProvider; import com.android.systemui.statusbar.notification.people.PeopleHubModule; import com.android.systemui.statusbar.notification.row.dagger.ExpandableNotificationRowComponent; Loading Loading @@ -204,7 +205,9 @@ public abstract class SystemUIModule { NotificationShadeWindowController notificationShadeWindowController, StatusBarStateController statusBarStateController, ShadeController shadeController, ConfigurationController configurationController, @Nullable IStatusBarService statusBarService, INotificationManager notificationManager, @Nullable IStatusBarService statusBarService, INotificationManager notificationManager, NotificationVisibilityProvider visibilityProvider, NotificationInterruptStateProvider interruptionStateProvider, ZenModeController zenModeController, NotificationLockscreenUserManager notifUserManager, NotificationGroupManagerLegacy groupManager, NotificationEntryManager entryManager, Loading @@ -213,6 +216,7 @@ public abstract class SystemUIModule { return Optional.ofNullable(BubblesManager.create(context, bubblesOptional, notificationShadeWindowController, statusBarStateController, shadeController, configurationController, statusBarService, notificationManager, visibilityProvider, interruptionStateProvider, zenModeController, notifUserManager, groupManager, entryManager, notifPipeline, sysUiState, featureFlags, dumpManager, sysuiMainExecutor)); Loading
packages/SystemUI/src/com/android/systemui/people/widget/LaunchConversationActivity.java +18 −14 Original line number Diff line number Diff line Loading @@ -36,8 +36,9 @@ import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import com.android.systemui.people.PeopleSpaceUtils; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.wmshell.BubblesManager; import com.android.wm.shell.bubbles.Bubble; Loading @@ -50,7 +51,8 @@ public class LaunchConversationActivity extends Activity { private static final String TAG = "PeopleSpaceLaunchConv"; private static final boolean DEBUG = PeopleSpaceUtils.DEBUG; private UiEventLogger mUiEventLogger = new UiEventLoggerImpl(); private NotificationEntryManager mNotificationEntryManager; private NotificationVisibilityProvider mVisibilityProvider; private CommonNotifCollection mCommonNotifCollection; private final Optional<BubblesManager> mBubblesManagerOptional; private final UserManager mUserManager; private boolean mIsForTesting; Loading @@ -60,11 +62,16 @@ public class LaunchConversationActivity extends Activity { private NotificationEntry mEntryToBubble; @Inject public LaunchConversationActivity(NotificationEntryManager notificationEntryManager, Optional<BubblesManager> bubblesManagerOptional, UserManager userManager, CommandQueue commandQueue) { public LaunchConversationActivity( NotificationVisibilityProvider visibilityProvider, CommonNotifCollection commonNotifCollection, Optional<BubblesManager> bubblesManagerOptional, UserManager userManager, CommandQueue commandQueue ) { super(); mNotificationEntryManager = notificationEntryManager; mVisibilityProvider = visibilityProvider; mCommonNotifCollection = commonNotifCollection; mBubblesManagerOptional = bubblesManagerOptional; mUserManager = userManager; mCommandQueue = commandQueue; Loading Loading @@ -128,8 +135,7 @@ public class LaunchConversationActivity extends Activity { // shortcutId, fallback to notificationKey if it exists. if (mBubblesManagerOptional.isPresent()) { mBubble = mBubblesManagerOptional.get().getBubbleWithShortcutId(tileId); NotificationEntry entry = mNotificationEntryManager.getPendingOrActiveNotif( notificationKey); NotificationEntry entry = mCommonNotifCollection.getEntry(notificationKey); if (mBubble != null || (entry != null && entry.canBubble())) { mEntryToBubble = entry; if (DEBUG) { Loading Loading @@ -167,14 +173,14 @@ public class LaunchConversationActivity extends Activity { } try { if (mIStatusBarService == null || mNotificationEntryManager == null) { if (mIStatusBarService == null || mCommonNotifCollection == null) { if (DEBUG) { Log.d(TAG, "Skipping clear notification: null services, key: " + notifKey); } return; } NotificationEntry entry = mNotificationEntryManager.getPendingOrActiveNotif(notifKey); NotificationEntry entry = mCommonNotifCollection.getEntry(notifKey); if (entry == null || entry.getRanking() == null) { if (DEBUG) { Log.d(TAG, "Skipping clear notification: NotificationEntry or its Ranking" Loading @@ -183,10 +189,8 @@ public class LaunchConversationActivity extends Activity { return; } int count = mNotificationEntryManager.getActiveNotificationsCount(); int rank = entry.getRanking().getRank(); NotificationVisibility notifVisibility = NotificationVisibility.obtain(notifKey, rank, count, true); NotificationVisibility notifVisibility = mVisibilityProvider.obtain(entry, true); int rank = notifVisibility.rank; if (DEBUG) Log.d(TAG, "Clearing notification, key: " + notifKey + ", rank: " + rank); mIStatusBarService.onNotificationClear( Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java +18 −10 Original line number Diff line number Diff line Loading @@ -51,12 +51,13 @@ import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FeatureFlags; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener; import com.android.systemui.recents.OverviewProxyService; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.logging.NotificationLogger; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.KeyguardStateController; Loading @@ -67,6 +68,8 @@ import java.util.List; import javax.inject.Inject; import dagger.Lazy; /** * Handles keeping track of the current user, profiles, and various things related to hiding * contents, redacting notifications, and the lockscreen. Loading @@ -86,6 +89,8 @@ public class NotificationLockscreenUserManagerImpl implements // Lazy private NotificationEntryManager mEntryManager; private final FeatureFlags mFeatureFlags; private final Lazy<NotificationVisibilityProvider> mVisibilityProviderLazy; private final DevicePolicyManager mDevicePolicyManager; private final SparseBooleanArray mLockscreenPublicMode = new SparseBooleanArray(); private final SparseBooleanArray mUsersWithSeperateWorkChallenge = new SparseBooleanArray(); Loading Loading @@ -162,15 +167,8 @@ public class NotificationLockscreenUserManagerImpl implements } } if (notificationKey != null) { NotificationEntry entry = getEntryManager().getActiveNotificationUnfiltered(notificationKey); final int count = getEntryManager().getActiveNotificationsCount(); final int rank = entry != null ? entry.getRanking().getRank() : 0; NotificationVisibility.NotificationLocation location = NotificationLogger.getNotificationLocation(entry); final NotificationVisibility nv = NotificationVisibility.obtain( notificationKey, rank, count, true, location); final NotificationVisibility nv = mVisibilityProviderLazy.get() .obtain(notificationKey, true); mClickNotifier.onNotificationClick(notificationKey, nv); } break; Loading @@ -197,9 +195,11 @@ public class NotificationLockscreenUserManagerImpl implements @Inject public NotificationLockscreenUserManagerImpl(Context context, FeatureFlags featureFlags, BroadcastDispatcher broadcastDispatcher, DevicePolicyManager devicePolicyManager, UserManager userManager, Lazy<NotificationVisibilityProvider> visibilityProviderLazy, NotificationClickNotifier clickNotifier, KeyguardManager keyguardManager, StatusBarStateController statusBarStateController, Loading @@ -208,10 +208,12 @@ public class NotificationLockscreenUserManagerImpl implements KeyguardStateController keyguardStateController, DumpManager dumpManager) { mContext = context; mFeatureFlags = featureFlags; mMainHandler = mainHandler; mDevicePolicyManager = devicePolicyManager; mUserManager = userManager; mCurrentUserId = ActivityManager.getCurrentUser(); mVisibilityProviderLazy = visibilityProviderLazy; mClickNotifier = clickNotifier; statusBarStateController.addCallback(this); mLockPatternUtils = new LockPatternUtils(context); Loading Loading @@ -337,6 +339,8 @@ public class NotificationLockscreenUserManagerImpl implements * package-specific override. */ public boolean shouldHideNotifications(String key) { // TODO(b/204764178): support new pipeline mFeatureFlags.checkLegacyPipelineEnabled(); if (getEntryManager() == null) { Log.wtf(TAG, "mEntryManager was null!", new Throwable()); return true; Loading @@ -347,6 +351,8 @@ public class NotificationLockscreenUserManagerImpl implements } public boolean shouldShowOnKeyguard(NotificationEntry entry) { // TODO(b/204764178): support new pipeline mFeatureFlags.checkLegacyPipelineEnabled(); if (getEntryManager() == null) { Log.wtf(TAG, "mEntryManager was null!", new Throwable()); return false; Loading Loading @@ -520,6 +526,8 @@ public class NotificationLockscreenUserManagerImpl implements } private boolean packageHasVisibilityOverride(String key) { // TODO(b/204764178): support new pipeline mFeatureFlags.checkLegacyPipelineEnabled(); if (getEntryManager() == null) { Log.wtf(TAG, "mEntryManager was null!", new Throwable()); return true; Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java +6 −17 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ import com.android.systemui.statusbar.notification.collection.NotifPipeline; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.notifcollection.DismissedByUserStats; import com.android.systemui.statusbar.notification.collection.notifcollection.NotifCollectionListener; import com.android.systemui.statusbar.notification.logging.NotificationLogger; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.statusbar.phone.BiometricUnlockController; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.LockscreenWallpaper; Loading Loading @@ -113,6 +113,7 @@ public class NotificationMediaManager implements Dumpable { PAUSED_MEDIA_STATES.add(PlaybackState.STATE_CONNECTING); } private final NotificationVisibilityProvider mVisibilityProvider; private final NotificationEntryManager mEntryManager; private final MediaDataManager mMediaDataManager; private final NotifPipeline mNotifPipeline; Loading Loading @@ -181,6 +182,7 @@ public class NotificationMediaManager implements Dumpable { Context context, Lazy<Optional<StatusBar>> statusBarOptionalLazy, Lazy<NotificationShadeWindowController> notificationShadeWindowController, NotificationVisibilityProvider visibilityProvider, NotificationEntryManager notificationEntryManager, MediaArtworkProcessor mediaArtworkProcessor, KeyguardBypassController keyguardBypassController, Loading @@ -201,6 +203,7 @@ public class NotificationMediaManager implements Dumpable { // TODO: use KeyguardStateController#isOccluded to remove this dependency mStatusBarOptionalLazy = statusBarOptionalLazy; mNotificationShadeWindowController = notificationShadeWindowController; mVisibilityProvider = visibilityProvider; mEntryManager = notificationEntryManager; mMainExecutor = mainExecutor; mMediaDataManager = mediaDataManager; Loading Loading @@ -351,21 +354,10 @@ public class NotificationMediaManager implements Dumpable { } private DismissedByUserStats getDismissedByUserStats(NotificationEntry entry) { final int activeNotificationsCount; if (mUsingNotifPipeline) { activeNotificationsCount = mNotifPipeline.getShadeListCount(); } else { activeNotificationsCount = mEntryManager.getActiveNotificationsCount(); } return new DismissedByUserStats( NotificationStats.DISMISSAL_SHADE, // Add DISMISSAL_MEDIA? NotificationStats.DISMISS_SENTIMENT_NEUTRAL, NotificationVisibility.obtain( entry.getKey(), entry.getRanking().getRank(), activeNotificationsCount, /* visible= */ true, NotificationLogger.getNotificationLocation(entry))); mVisibilityProvider.obtain(entry, /* visible= */ true)); } private void removeEntry(NotificationEntry entry) { Loading Loading @@ -406,10 +398,7 @@ public class NotificationMediaManager implements Dumpable { return null; } if (mUsingNotifPipeline) { // TODO(b/169655596): Either add O(1) lookup, or cache this icon? return mNotifPipeline.getAllNotifs().stream() .filter(entry -> Objects.equals(entry.getKey(), mMediaNotificationKey)) .findAny() return Optional.ofNullable(mNotifPipeline.getEntry(mMediaNotificationKey)) .map(entry -> entry.getIcons().getShelfIcon()) .map(StatusBarIconView::getSourceIcon) .orElse(null); Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java +5 −8 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ 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.NotificationEntry.EditedSuggestionInfo; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.statusbar.notification.logging.NotificationLogger; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.phone.StatusBar; Loading Loading @@ -95,6 +96,7 @@ public class NotificationRemoteInputManager implements Dumpable { // Dependencies: private final NotificationLockscreenUserManager mLockscreenUserManager; private final SmartReplyController mSmartReplyController; private final NotificationVisibilityProvider mVisibilityProvider; private final NotificationEntryManager mEntryManager; private final Handler mMainHandler; private final ActionClickLogger mLogger; Loading Loading @@ -202,14 +204,7 @@ public class NotificationRemoteInputManager implements Dumpable { ViewGroup actionGroup = (ViewGroup) parent; buttonIndex = actionGroup.indexOfChild(view); } // TODO(b/204183781): get this from the current pipeline final int count = mEntryManager.getActiveNotificationsCount(); final int rank = entry.getRanking().getRank(); NotificationVisibility.NotificationLocation location = NotificationLogger.getNotificationLocation(entry); final NotificationVisibility nv = NotificationVisibility.obtain(key, rank, count, true, location); final NotificationVisibility nv = mVisibilityProvider.obtain(entry, true); mClickNotifier.onNotificationActionClick(key, buttonIndex, action, nv, false); } Loading Loading @@ -263,6 +258,7 @@ public class NotificationRemoteInputManager implements Dumpable { FeatureFlags featureFlags, NotificationLockscreenUserManager lockscreenUserManager, SmartReplyController smartReplyController, NotificationVisibilityProvider visibilityProvider, NotificationEntryManager notificationEntryManager, RemoteInputNotificationRebuilder rebuilder, Lazy<Optional<StatusBar>> statusBarOptionalLazy, Loading @@ -276,6 +272,7 @@ public class NotificationRemoteInputManager implements Dumpable { mFeatureFlags = featureFlags; mLockscreenUserManager = lockscreenUserManager; mSmartReplyController = smartReplyController; mVisibilityProvider = visibilityProvider; mEntryManager = notificationEntryManager; mStatusBarOptionalLazy = statusBarOptionalLazy; mMainHandler = mainHandler; Loading