Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +17 −83 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import static com.android.systemui.statusbar.notification.stack.NotificationStac import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.ROWS_GENTLE; import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.ROWS_HIGH_PRIORITY; import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.SelectedRows; import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.canChildBeCleared; import static com.android.systemui.statusbar.phone.NotificationIconAreaController.HIGH_PRIORITY; import android.content.res.Configuration; Loading @@ -38,12 +37,10 @@ import android.graphics.PointF; import android.os.Trace; import android.os.UserHandle; import android.provider.Settings; import android.service.notification.NotificationListenerService; import android.service.notification.StatusBarNotification; import android.util.Log; import android.util.Pair; import android.view.Display; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; Loading @@ -53,20 +50,17 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.colorextraction.ColorExtractor; import com.android.internal.jank.InteractionJankMonitor; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.UiEvent; import com.android.internal.logging.UiEventLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.internal.statusbar.IStatusBarService; import com.android.systemui.ExpandHelper; import com.android.systemui.Gefingerpoken; import com.android.systemui.R; import com.android.systemui.SwipeHelper; import com.android.systemui.classifier.Classifier; import com.android.systemui.classifier.FalsingCollector; import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.dump.DumpManager; import com.android.systemui.media.KeyguardMediaController; Loading @@ -85,9 +79,7 @@ import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.notification.DynamicPrivacyController; import com.android.systemui.statusbar.notification.LaunchAnimationParameters; import com.android.systemui.statusbar.notification.NotifPipelineFlags; import com.android.systemui.statusbar.notification.NotificationActivityStarter; import com.android.systemui.statusbar.notification.NotificationEntryListener; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotifCollection; import com.android.systemui.statusbar.notification.collection.NotifPipeline; Loading Loading @@ -163,13 +155,10 @@ public class NotificationStackScrollLayoutController { private final Resources mResources; private final NotificationSwipeHelper.Builder mNotificationSwipeHelperBuilder; private final ScrimController mScrimController; private final NotifPipelineFlags mNotifPipelineFlags; private final NotifPipeline mNotifPipeline; private final NotifCollection mNotifCollection; private final NotificationEntryManager mNotificationEntryManager; private final IStatusBarService mIStatusBarService; private final UiEventLogger mUiEventLogger; private final LayoutInflater mLayoutInflater; private final NotificationRemoteInputManager mRemoteInputManager; private final VisualStabilityManager mVisualStabilityManager; private final ShadeController mShadeController; Loading Loading @@ -206,8 +195,6 @@ public class NotificationStackScrollLayoutController { @Nullable private NotificationActivityStarter mNotificationActivityStarter; private ColorExtractor.OnColorsChangedListener mOnColorsChangedListener; @VisibleForTesting final View.OnAttachStateChangeListener mOnAttachStateChangeListener = new View.OnAttachStateChangeListener() { Loading Loading @@ -256,10 +243,7 @@ public class NotificationStackScrollLayoutController { mView.setAnimateBottomOnLayout(true); } // Let's update the footer once the notifications have been updated (in the next frame) mView.post(() -> { updateFooter(); updateSectionBoundaries("dynamic privacy changed"); }); mView.post(this::updateFooter); }; @VisibleForTesting Loading Loading @@ -634,7 +618,6 @@ public class NotificationStackScrollLayoutController { KeyguardMediaController keyguardMediaController, KeyguardBypassController keyguardBypassController, ZenModeController zenModeController, SysuiColorExtractor colorExtractor, NotificationLockscreenUserManager lockscreenUserManager, MetricsLogger metricsLogger, DumpManager dumpManager, Loading @@ -647,15 +630,12 @@ public class NotificationStackScrollLayoutController { NotificationGroupManagerLegacy legacyGroupManager, GroupExpansionManager groupManager, @SilentHeader SectionHeaderController silentHeaderController, NotifPipelineFlags notifPipelineFlags, NotifPipeline notifPipeline, NotifCollection notifCollection, NotificationEntryManager notificationEntryManager, LockscreenShadeTransitionController lockscreenShadeTransitionController, ShadeTransitionController shadeTransitionController, IStatusBarService iStatusBarService, UiEventLogger uiEventLogger, LayoutInflater layoutInflater, NotificationRemoteInputManager remoteInputManager, VisualStabilityManager visualStabilityManager, ShadeController shadeController, Loading Loading @@ -698,14 +678,11 @@ public class NotificationStackScrollLayoutController { mCentralSurfaces.requestNotificationUpdate("onGroupsChanged"); } }); mNotifPipelineFlags = notifPipelineFlags; mSilentHeaderController = silentHeaderController; mNotifPipeline = notifPipeline; mNotifCollection = notifCollection; mNotificationEntryManager = notificationEntryManager; mIStatusBarService = iStatusBarService; mUiEventLogger = uiEventLogger; mLayoutInflater = layoutInflater; mRemoteInputManager = remoteInputManager; mVisualStabilityManager = visualStabilityManager; mShadeController = shadeController; Loading Loading @@ -745,21 +722,12 @@ public class NotificationStackScrollLayoutController { .setOnMenuEventListener(mMenuEventListener) .build(); if (mNotifPipelineFlags.isNewPipelineEnabled()) { mNotifPipeline.addCollectionListener(new NotifCollectionListener() { @Override public void onEntryUpdated(NotificationEntry entry) { mView.onEntryUpdated(entry); } }); } else { mNotificationEntryManager.addNotificationEntryListener(new NotificationEntryListener() { @Override public void onPreEntryUpdated(NotificationEntry entry) { mView.onEntryUpdated(entry); } }); } mView.initView(mView.getContext(), mSwipeHelper, mNotificationStackSizeCalculator); mView.setKeyguardBypassEnabled(mKeyguardBypassController.getBypassEnabled()); Loading Loading @@ -1231,10 +1199,6 @@ public class NotificationStackScrollLayoutController { Trace.endSection(); } public boolean areNotificationsHiddenInShade() { return mZenModeController.areNotificationsHiddenInShade(); } public boolean isShowingEmptyShadeView() { return mShowEmptyShadeView; } Loading Loading @@ -1339,15 +1303,6 @@ public class NotificationStackScrollLayoutController { }; } public void updateSectionBoundaries(String reason) { if (mNotifPipelineFlags.isNewPipelineEnabled()) { return; } Trace.beginSection("NSSLC.updateSectionBoundaries"); mView.updateSectionBoundaries(reason); Trace.endSection(); } public void updateFooter() { Trace.beginSection("NSSLC.updateFooter"); mView.updateFooter(); Loading Loading @@ -1463,7 +1418,6 @@ public class NotificationStackScrollLayoutController { private void onAnimationEnd(List<ExpandableNotificationRow> viewsToRemove, @SelectedRows int selectedRows) { if (mNotifPipelineFlags.isNewPipelineEnabled()) { if (selectedRows == ROWS_ALL) { mNotifCollection.dismissAllNotifications( mLockscreenUserManager.getCurrentUserId()); Loading @@ -1477,26 +1431,6 @@ public class NotificationStackScrollLayoutController { } mNotifCollection.dismissNotifications(entriesWithRowsDismissedFromShade); } } else { for (ExpandableNotificationRow rowToRemove : viewsToRemove) { if (canChildBeCleared(rowToRemove)) { mNotificationEntryManager.performRemoveNotification( rowToRemove.getEntry().getSbn(), getDismissedByUserStats(rowToRemove.getEntry()), NotificationListenerService.REASON_CANCEL_ALL); } else { rowToRemove.resetTranslation(); } } if (selectedRows == ROWS_ALL) { try { // TODO(b/169585328): Do not clear media player notifications mIStatusBarService.onClearAllNotifications( mLockscreenUserManager.getCurrentUserId()); } catch (Exception ignored) { } } } } /** Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +0 −1 Original line number Diff line number Diff line Loading @@ -3918,7 +3918,6 @@ public final class NotificationPanelViewController extends PanelViewController { * {@link ShadeViewManager}. */ public void updateNotificationViews(String reason) { mNotificationStackScrollLayoutController.updateSectionBoundaries(reason); mNotificationStackScrollLayoutController.updateFooter(); mNotificationIconAreaController.updateNotificationIcons(createVisibleEntriesList()); Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java +0 −5 Original line number Diff line number Diff line Loading @@ -150,7 +150,6 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { MockitoAnnotations.initMocks(this); when(mNotificationSwipeHelperBuilder.build()).thenReturn(mNotificationSwipeHelper); when(mNotifPipelineFlags.isNewPipelineEnabled()).thenReturn(false); mController = new NotificationStackScrollLayoutController( true, Loading @@ -166,7 +165,6 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { mKeyguardMediaController, mKeyguardBypassController, mZenModeController, mColorExtractor, mNotificationLockscreenUserManager, mMetricsLogger, mDumpManager, Loading @@ -179,15 +177,12 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { mLegacyGroupManager, mLegacyGroupManager, mSilentHeaderController, mNotifPipelineFlags, mNotifPipeline, mNotifCollection, mEntryManager, mLockscreenShadeTransitionController, mShadeTransitionController, mIStatusBarService, mUiEventLogger, mLayoutInflater, mRemoteInputManager, mVisualStabilityManager, mShadeController, Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +17 −83 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import static com.android.systemui.statusbar.notification.stack.NotificationStac import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.ROWS_GENTLE; import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.ROWS_HIGH_PRIORITY; import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.SelectedRows; import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.canChildBeCleared; import static com.android.systemui.statusbar.phone.NotificationIconAreaController.HIGH_PRIORITY; import android.content.res.Configuration; Loading @@ -38,12 +37,10 @@ import android.graphics.PointF; import android.os.Trace; import android.os.UserHandle; import android.provider.Settings; import android.service.notification.NotificationListenerService; import android.service.notification.StatusBarNotification; import android.util.Log; import android.util.Pair; import android.view.Display; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; Loading @@ -53,20 +50,17 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.colorextraction.ColorExtractor; import com.android.internal.jank.InteractionJankMonitor; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.UiEvent; import com.android.internal.logging.UiEventLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.internal.statusbar.IStatusBarService; import com.android.systemui.ExpandHelper; import com.android.systemui.Gefingerpoken; import com.android.systemui.R; import com.android.systemui.SwipeHelper; import com.android.systemui.classifier.Classifier; import com.android.systemui.classifier.FalsingCollector; import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.dump.DumpManager; import com.android.systemui.media.KeyguardMediaController; Loading @@ -85,9 +79,7 @@ import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.notification.DynamicPrivacyController; import com.android.systemui.statusbar.notification.LaunchAnimationParameters; import com.android.systemui.statusbar.notification.NotifPipelineFlags; import com.android.systemui.statusbar.notification.NotificationActivityStarter; import com.android.systemui.statusbar.notification.NotificationEntryListener; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotifCollection; import com.android.systemui.statusbar.notification.collection.NotifPipeline; Loading Loading @@ -163,13 +155,10 @@ public class NotificationStackScrollLayoutController { private final Resources mResources; private final NotificationSwipeHelper.Builder mNotificationSwipeHelperBuilder; private final ScrimController mScrimController; private final NotifPipelineFlags mNotifPipelineFlags; private final NotifPipeline mNotifPipeline; private final NotifCollection mNotifCollection; private final NotificationEntryManager mNotificationEntryManager; private final IStatusBarService mIStatusBarService; private final UiEventLogger mUiEventLogger; private final LayoutInflater mLayoutInflater; private final NotificationRemoteInputManager mRemoteInputManager; private final VisualStabilityManager mVisualStabilityManager; private final ShadeController mShadeController; Loading Loading @@ -206,8 +195,6 @@ public class NotificationStackScrollLayoutController { @Nullable private NotificationActivityStarter mNotificationActivityStarter; private ColorExtractor.OnColorsChangedListener mOnColorsChangedListener; @VisibleForTesting final View.OnAttachStateChangeListener mOnAttachStateChangeListener = new View.OnAttachStateChangeListener() { Loading Loading @@ -256,10 +243,7 @@ public class NotificationStackScrollLayoutController { mView.setAnimateBottomOnLayout(true); } // Let's update the footer once the notifications have been updated (in the next frame) mView.post(() -> { updateFooter(); updateSectionBoundaries("dynamic privacy changed"); }); mView.post(this::updateFooter); }; @VisibleForTesting Loading Loading @@ -634,7 +618,6 @@ public class NotificationStackScrollLayoutController { KeyguardMediaController keyguardMediaController, KeyguardBypassController keyguardBypassController, ZenModeController zenModeController, SysuiColorExtractor colorExtractor, NotificationLockscreenUserManager lockscreenUserManager, MetricsLogger metricsLogger, DumpManager dumpManager, Loading @@ -647,15 +630,12 @@ public class NotificationStackScrollLayoutController { NotificationGroupManagerLegacy legacyGroupManager, GroupExpansionManager groupManager, @SilentHeader SectionHeaderController silentHeaderController, NotifPipelineFlags notifPipelineFlags, NotifPipeline notifPipeline, NotifCollection notifCollection, NotificationEntryManager notificationEntryManager, LockscreenShadeTransitionController lockscreenShadeTransitionController, ShadeTransitionController shadeTransitionController, IStatusBarService iStatusBarService, UiEventLogger uiEventLogger, LayoutInflater layoutInflater, NotificationRemoteInputManager remoteInputManager, VisualStabilityManager visualStabilityManager, ShadeController shadeController, Loading Loading @@ -698,14 +678,11 @@ public class NotificationStackScrollLayoutController { mCentralSurfaces.requestNotificationUpdate("onGroupsChanged"); } }); mNotifPipelineFlags = notifPipelineFlags; mSilentHeaderController = silentHeaderController; mNotifPipeline = notifPipeline; mNotifCollection = notifCollection; mNotificationEntryManager = notificationEntryManager; mIStatusBarService = iStatusBarService; mUiEventLogger = uiEventLogger; mLayoutInflater = layoutInflater; mRemoteInputManager = remoteInputManager; mVisualStabilityManager = visualStabilityManager; mShadeController = shadeController; Loading Loading @@ -745,21 +722,12 @@ public class NotificationStackScrollLayoutController { .setOnMenuEventListener(mMenuEventListener) .build(); if (mNotifPipelineFlags.isNewPipelineEnabled()) { mNotifPipeline.addCollectionListener(new NotifCollectionListener() { @Override public void onEntryUpdated(NotificationEntry entry) { mView.onEntryUpdated(entry); } }); } else { mNotificationEntryManager.addNotificationEntryListener(new NotificationEntryListener() { @Override public void onPreEntryUpdated(NotificationEntry entry) { mView.onEntryUpdated(entry); } }); } mView.initView(mView.getContext(), mSwipeHelper, mNotificationStackSizeCalculator); mView.setKeyguardBypassEnabled(mKeyguardBypassController.getBypassEnabled()); Loading Loading @@ -1231,10 +1199,6 @@ public class NotificationStackScrollLayoutController { Trace.endSection(); } public boolean areNotificationsHiddenInShade() { return mZenModeController.areNotificationsHiddenInShade(); } public boolean isShowingEmptyShadeView() { return mShowEmptyShadeView; } Loading Loading @@ -1339,15 +1303,6 @@ public class NotificationStackScrollLayoutController { }; } public void updateSectionBoundaries(String reason) { if (mNotifPipelineFlags.isNewPipelineEnabled()) { return; } Trace.beginSection("NSSLC.updateSectionBoundaries"); mView.updateSectionBoundaries(reason); Trace.endSection(); } public void updateFooter() { Trace.beginSection("NSSLC.updateFooter"); mView.updateFooter(); Loading Loading @@ -1463,7 +1418,6 @@ public class NotificationStackScrollLayoutController { private void onAnimationEnd(List<ExpandableNotificationRow> viewsToRemove, @SelectedRows int selectedRows) { if (mNotifPipelineFlags.isNewPipelineEnabled()) { if (selectedRows == ROWS_ALL) { mNotifCollection.dismissAllNotifications( mLockscreenUserManager.getCurrentUserId()); Loading @@ -1477,26 +1431,6 @@ public class NotificationStackScrollLayoutController { } mNotifCollection.dismissNotifications(entriesWithRowsDismissedFromShade); } } else { for (ExpandableNotificationRow rowToRemove : viewsToRemove) { if (canChildBeCleared(rowToRemove)) { mNotificationEntryManager.performRemoveNotification( rowToRemove.getEntry().getSbn(), getDismissedByUserStats(rowToRemove.getEntry()), NotificationListenerService.REASON_CANCEL_ALL); } else { rowToRemove.resetTranslation(); } } if (selectedRows == ROWS_ALL) { try { // TODO(b/169585328): Do not clear media player notifications mIStatusBarService.onClearAllNotifications( mLockscreenUserManager.getCurrentUserId()); } catch (Exception ignored) { } } } } /** Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +0 −1 Original line number Diff line number Diff line Loading @@ -3918,7 +3918,6 @@ public final class NotificationPanelViewController extends PanelViewController { * {@link ShadeViewManager}. */ public void updateNotificationViews(String reason) { mNotificationStackScrollLayoutController.updateSectionBoundaries(reason); mNotificationStackScrollLayoutController.updateFooter(); mNotificationIconAreaController.updateNotificationIcons(createVisibleEntriesList()); Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java +0 −5 Original line number Diff line number Diff line Loading @@ -150,7 +150,6 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { MockitoAnnotations.initMocks(this); when(mNotificationSwipeHelperBuilder.build()).thenReturn(mNotificationSwipeHelper); when(mNotifPipelineFlags.isNewPipelineEnabled()).thenReturn(false); mController = new NotificationStackScrollLayoutController( true, Loading @@ -166,7 +165,6 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { mKeyguardMediaController, mKeyguardBypassController, mZenModeController, mColorExtractor, mNotificationLockscreenUserManager, mMetricsLogger, mDumpManager, Loading @@ -179,15 +177,12 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { mLegacyGroupManager, mLegacyGroupManager, mSilentHeaderController, mNotifPipelineFlags, mNotifPipeline, mNotifCollection, mEntryManager, mLockscreenShadeTransitionController, mShadeTransitionController, mIStatusBarService, mUiEventLogger, mLayoutInflater, mRemoteInputManager, mVisualStabilityManager, mShadeController, Loading