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

Commit 9de4d24f authored by Riley Jones's avatar Riley Jones
Browse files

Configure a11yMenu snackbars to have a polite live region

Test: install apk
Flag: aconfig a11y_menu_snackbar_live_region ENABLED
Bug: 338351484
Change-Id: Ie5aca08a690a0ed3b2d2699e2b020e127d166ed3
parent 4b4b620a
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -9,3 +9,13 @@ flag {
    description: "Hides the AccessibilityMenuService UI before taking action instead of after."
    bug: "292020123"
}

flag {
    name: "a11y_menu_snackbar_live_region"
    namespace: "accessibility"
    description: "configures live region on snackbar so its contents are announced when it appears."
    bug: "338351484"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.accessibility.accessibilitymenu.view;

import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.View.ACCESSIBILITY_LIVE_REGION_POLITE;
import static android.view.WindowManager.LayoutParams.TYPE_ACCESSIBILITY_OVERLAY;

import static java.lang.Math.max;
@@ -321,7 +322,14 @@ public class A11yMenuOverlayLayout {
                AccessibilityManager.FLAG_CONTENT_TEXT);

        final TextView snackbar = mLayout.findViewById(R.id.snackbar);
        if (snackbar == null) {
            return;
        }
        snackbar.setText(text);
        if (com.android.systemui.accessibility.accessibilitymenu
                .Flags.a11yMenuSnackbarLiveRegion()) {
            snackbar.setAccessibilityLiveRegion(ACCESSIBILITY_LIVE_REGION_POLITE);
        }

        // Remove any existing fade-out animation before starting any new animations.
        mHandler.removeCallbacksAndMessages(null);