From 5d5c79f698c3b7240559951ea7c01c78ab3c0dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Kurucz?= Date: Mon, 25 Jul 2022 11:15:08 +0000 Subject: [PATCH] remove accessibility label from ExpandableNotificationRow when snoozed The snoozed notifications had an extra accessibility label when accessing it from "Voice Access" and the "Switch Access" found it twice as well. The issue can be solved by setting the parent view as it is not important for accessibility. Test: ExpandableNotificationRowTest Bug: 182127168 Bug: 182236319 Change-Id: I32ce84fafa0372516aaf75b714a21c076a670dd5 --- .../notification/row/ExpandableNotificationRow.java | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 94341ba4bb19b..3c018022085d9 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 @@ -1909,6 +1909,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView * @param isEnabled whether the content views should be enabled for accessibility */ private void updateContentAccessibilityImportanceForGuts(boolean isEnabled) { + updateAccessibilityImportance(isEnabled); + if (mChildrenContainer != null) { updateChildAccessibilityImportance(mChildrenContainer, isEnabled); } @@ -1923,6 +1925,15 @@ public class ExpandableNotificationRow extends ActivatableNotificationView } } + /** + * Updates whether this view is important for accessibility based on {@code isEnabled}. + */ + private void updateAccessibilityImportance(boolean isEnabled) { + setImportantForAccessibility(isEnabled + ? View.IMPORTANT_FOR_ACCESSIBILITY_AUTO + : View.IMPORTANT_FOR_ACCESSIBILITY_NO); + } + /** * Updates whether the given childView is important for accessibility based on * {@code isEnabled}.