Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5d5c79f6 authored by András Kurucz's avatar András Kurucz
Browse files

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
parent e373c68b
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -1909,6 +1909,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
     * @param isEnabled whether the content views should be enabled for accessibility
     * @param isEnabled whether the content views should be enabled for accessibility
     */
     */
    private void updateContentAccessibilityImportanceForGuts(boolean isEnabled) {
    private void updateContentAccessibilityImportanceForGuts(boolean isEnabled) {
        updateAccessibilityImportance(isEnabled);

        if (mChildrenContainer != null) {
        if (mChildrenContainer != null) {
            updateChildAccessibilityImportance(mChildrenContainer, isEnabled);
            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
     * Updates whether the given childView is important for accessibility based on
     * {@code isEnabled}.
     * {@code isEnabled}.