From 7cee6c53394ec991e9e35af588202f2cd680c2d6 Mon Sep 17 00:00:00 2001 From: Lyn Han Date: Fri, 13 Nov 2020 18:58:52 -0600 Subject: [PATCH] Fix bug where longpress stops working For shelfless dismissal, create NotificationMenuRow as empty menu instead of leaving it null (which skips longpress guts open) Fixes: 173252412 Bug: 172289783 Test: visual - longpress works for hun/min/expanded notifs, in shade/home/lockscreen, with flag disabled and enabled Change-Id: I6d2254da6545bcf1278cc3c90e2fb18d30b81b74 --- .../notification/row/ExpandableNotificationRow.java | 4 +--- .../statusbar/notification/row/NotificationMenuRow.java | 5 +++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java index 2253b2ba26f20..3e23a939630c5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java @@ -1163,9 +1163,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView */ @Nullable public NotificationMenuRowPlugin createMenu() { - final boolean removeShelf = Settings.Global.getInt(mContext.getContentResolver(), - Settings.Global.SHOW_NEW_NOTIF_DISMISS, 0 /* show shelf by default */) == 1; - if (mMenuRow == null || removeShelf) { + if (mMenuRow == null) { return null; } if (mMenuRow.getMenuView() == null) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationMenuRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationMenuRow.java index 65a72cc0b76b4..447fa43ef8242 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationMenuRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationMenuRow.java @@ -294,6 +294,11 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl } else { mMenuContainer = new FrameLayout(mContext); } + final boolean newFlowHideShelf = Settings.Global.getInt(mContext.getContentResolver(), + Settings.Global.SHOW_NEW_NOTIF_DISMISS, 0) == 1; + if (newFlowHideShelf) { + return; + } List menuItems = mOnLeft ? mLeftMenuItems : mRightMenuItems; for (int i = 0; i < menuItems.size(); i++) { addMenuView(menuItems.get(i), mMenuContainer);