From ff6c25e775bca0e2a488a38c8bfd04e81cf847cf Mon Sep 17 00:00:00 2001 From: Steve Elliott Date: Thu, 30 May 2019 17:38:52 -0400 Subject: [PATCH] Dismiss all snoozed notifications upon swiping another Fixes: 123873134 Test: manual Change-Id: I5d7f16a5578c51581b0d075996b3680075c8f2a2 --- .../stack/NotificationStackScrollLayout.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index a517e760c8b4f..6b28789dd8af4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -477,8 +477,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd private float mHorizontalPanelTranslation; private final NotificationLockscreenUserManager mLockscreenUserManager = Dependency.get(NotificationLockscreenUserManager.class); - protected final NotificationGutsManager mGutsManager = - Dependency.get(NotificationGutsManager.class); private final Rect mTmpRect = new Rect(); private final NotificationEntryManager mEntryManager = Dependency.get(NotificationEntryManager.class); @@ -625,7 +623,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd inflateFooterView(); mVisualStabilityManager.setVisibilityLocationProvider(this::isInVisibleLocation); if (mAllowLongPress) { - setLongPressListener(mGutsManager::openGuts); + setLongPressListener(mNotificationGutsManager::openGuts); } } @@ -6152,6 +6150,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd .setType(MetricsEvent.TYPE_ACTION)); mHeadsUpManager.setMenuShown(notificationRow.getEntry(), true); mSwipeHelper.onMenuShown(row); + mNotificationGutsManager.closeAndSaveGuts(true /* removeLeavebehind */, + false /* force */, false /* removeControls */, -1 /* x */, -1 /* y */, + false /* resetMenu */); // Check to see if we want to go directly to the notfication guts NotificationMenuRowPlugin provider = notificationRow.getProvider(); @@ -6159,7 +6160,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd MenuItem item = provider.menuItemToExposeOnSnap(); if (item != null) { Point origin = provider.getRevealAnimationOrigin(); - mGutsManager.openGuts(row, origin.x, origin.y, item); + mNotificationGutsManager.openGuts(row, origin.x, origin.y, item); } else { Log.e(TAG, "Provider has shouldShowGutsOnSnapOpen, but provided no " + "menu item in menuItemtoExposeOnSnap. Skipping.");