From 53f489d7b0584e3185f23895866f9ee930ba9d6f Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Fri, 10 Sep 2021 20:10:11 +0000 Subject: [PATCH] Remove dismiss-rtl setters because dismiss is bidirectional Fixes: 204127880 Test: dismiss notifs; change RTL; dismiss more Merged-In: Ia3e0c80a1bfb81f039c6409718d5fbeced455939 Change-Id: Ia3e0c80a1bfb81f039c6409718d5fbeced455939 --- .../plugins/statusbar/NotificationMenuRowPlugin.java | 6 ------ .../notification/row/ExpandableNotificationRow.java | 7 ------- .../notification/row/NotificationMenuRow.java | 9 --------- .../stack/NotificationStackScrollLayout.java | 12 ------------ .../NotificationStackScrollLayoutController.java | 4 ---- 5 files changed, 38 deletions(-) diff --git a/packages/SystemUI/plugin/src/com/android/systemui/plugins/statusbar/NotificationMenuRowPlugin.java b/packages/SystemUI/plugin/src/com/android/systemui/plugins/statusbar/NotificationMenuRowPlugin.java index 883f4de1149cc..94fdbae832533 100644 --- a/packages/SystemUI/plugin/src/com/android/systemui/plugins/statusbar/NotificationMenuRowPlugin.java +++ b/packages/SystemUI/plugin/src/com/android/systemui/plugins/statusbar/NotificationMenuRowPlugin.java @@ -182,12 +182,6 @@ public interface NotificationMenuRowPlugin extends Plugin { */ public boolean canBeDismissed(); - /** - * Informs the menu whether dismiss gestures are left-to-right or right-to-left. - */ - default void setDismissRtl(boolean dismissRtl) { - } - /** * Determines whether the menu should remain open given its current state, or snap closed. * @return true if the menu should remain open, false otherwise. 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 0d8e850946464..e956046abd042 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 @@ -3201,13 +3201,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView } } - /** Sets whether dismiss gestures are right-to-left (instead of left-to-right). */ - public void setDismissRtl(boolean dismissRtl) { - if (mMenuRow != null) { - mMenuRow.setDismissRtl(dismissRtl); - } - } - private static class NotificationViewState extends ExpandableViewState { @Override 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 d59318e45e7e4..3a37fb44b33a7 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 @@ -85,7 +85,6 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl private ArrayList mRightMenuItems; private final Map mMenuItemsByView = new ArrayMap<>(); private OnMenuEventListener mMenuListener; - private boolean mDismissRtl; private ValueAnimator mFadeAnimator; private boolean mAnimating; @@ -790,14 +789,6 @@ public class NotificationMenuRow implements NotificationMenuRowPlugin, View.OnCl return getParent().canViewBeDismissed(); } - @Override - public void setDismissRtl(boolean dismissRtl) { - mDismissRtl = dismissRtl; - if (mMenuContainer != null) { - createMenuViews(true); - } - } - public static class NotificationMenuItem implements MenuItem { View mMenuView; GutsContent mGutsContent; 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 58e44792571c0..1f764255914b0 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 @@ -161,7 +161,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable private final Paint mBackgroundPaint = new Paint(); private final boolean mShouldDrawNotificationBackground; private boolean mHighPriorityBeforeSpeedBump; - private boolean mDismissRtl; private float mExpandedHeight; private int mOwnScrollY; @@ -613,16 +612,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable addView(mFgsSectionView, -1); } - void updateDismissRtlSetting(boolean dismissRtl) { - mDismissRtl = dismissRtl; - for (int i = 0; i < getChildCount(); i++) { - View child = getChildAt(i); - if (child instanceof ExpandableNotificationRow) { - ((ExpandableNotificationRow) child).setDismissRtl(dismissRtl); - } - } - } - /** * Set the overexpansion of the panel to be applied to the view. */ @@ -2915,7 +2904,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable updateChronometerForChild(child); if (child instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) child; - row.setDismissRtl(mDismissRtl); row.setDismissUsingRowTranslationX(mDismissUsingRowTranslationX); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java index 9923faeb8b5c2..b4d96421e2c29 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java @@ -783,9 +783,6 @@ public class NotificationStackScrollLayoutController { mTunerService.addTunable( (key, newValue) -> { switch (key) { - case Settings.Secure.NOTIFICATION_DISMISS_RTL: - mView.updateDismissRtlSetting("1".equals(newValue)); - break; case Settings.Secure.NOTIFICATION_HISTORY_ENABLED: updateFooter(); break; @@ -795,7 +792,6 @@ public class NotificationStackScrollLayoutController { } }, HIGH_PRIORITY, - Settings.Secure.NOTIFICATION_DISMISS_RTL, Settings.Secure.NOTIFICATION_HISTORY_ENABLED); mKeyguardMediaController.setVisibilityChangedListener(visible -> {