diff options
2 files changed, 17 insertions, 26 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java index 5f4854aeeb7b..5112d37c830c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java @@ -1096,9 +1096,19 @@ public class ExpandableNotificationRow extends ActivatableNotificationView return mGroupParentWhenDismissed; } - public void performDismiss() { - if (mOnDismissRunnable != null) { - mOnDismissRunnable.run(); + public void performDismiss(boolean fromAccessibility) { + if (mGroupManager.isOnlyChildInGroup(getStatusBarNotification())) { + ExpandableNotificationRow groupSummary = + mGroupManager.getLogicalGroupSummary(getStatusBarNotification()); + if (groupSummary.isClearable()) { + groupSummary.performDismiss(fromAccessibility); + } + } + setDismissed(true, fromAccessibility); + if (isClearable()) { + if (mOnDismissRunnable != null) { + mOnDismissRunnable.run(); + } } } @@ -2328,8 +2338,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView } switch (action) { case AccessibilityNodeInfo.ACTION_DISMISS: - NotificationStackScrollLayout.performDismiss(this, mGroupManager, - true /* fromAccessibility */); + performDismiss(true /* fromAccessibility */); return true; case AccessibilityNodeInfo.ACTION_COLLAPSE: case AccessibilityNodeInfo.ACTION_EXPAND: diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index af3d64be0fd0..53e470938f3f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -1019,7 +1019,9 @@ public class NotificationStackScrollLayout extends ViewGroup mHeadsUpManager.addSwipedOutNotification(row.getStatusBarNotification().getKey()); } } - performDismiss(v, mGroupManager, false /* fromAccessibility */); + if (v instanceof ExpandableNotificationRow) { + ((ExpandableNotificationRow) v).performDismiss(false /* fromAccessibility */); + } mFalsingManager.onNotificationDismissed(); if (mFalsingManager.shouldEnforceBouncer()) { @@ -1028,26 +1030,6 @@ public class NotificationStackScrollLayout extends ViewGroup } } - public static void performDismiss(View v, NotificationGroupManager groupManager, - boolean fromAccessibility) { - if (!(v instanceof ExpandableNotificationRow)) { - return; - } - ExpandableNotificationRow row = (ExpandableNotificationRow) v; - if (groupManager.isOnlyChildInGroup(row.getStatusBarNotification())) { - ExpandableNotificationRow groupSummary = - groupManager.getLogicalGroupSummary(row.getStatusBarNotification()); - if (groupSummary.isClearable()) { - performDismiss(groupSummary, groupManager, fromAccessibility); - } - } - row.setDismissed(true, fromAccessibility); - if (row.isClearable()) { - row.performDismiss(); - } - if (DEBUG) Log.v(TAG, "onChildDismissed: " + v); - } - @Override public void onChildSnappedBack(View animView, float targetLeft) { mAmbientState.onDragFinished(animView); |