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

Commit 2dbcb570 authored by Rohan Shah's avatar Rohan Shah
Browse files

[QS] Disallow TYPE_VIEW_SELECTED events

QS is announcing all of its items due to setSelected being called on the
TilePage.

Fixed by disable a11y on the page until setSelected is done. This will
cover all fringe cases of setSelected being passed along down the
hierarchy and additional a11y events being sent on child views.

Test: Manually verified that labels aren't announced
Change-Id: I76757b1fb797ba646e8e57ef389f78593aad0f18
Fixes: 80003207
parent 56cc567d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -184,9 +184,15 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
            return;
        }
        boolean selected = mLastExpansion == 1f;

        // Disable accessibility temporarily while we update selected state purely for the
        // marquee. This will ensure that accessibility doesn't announce the TYPE_VIEW_SELECTED
        // event on any of the children.
        setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
        for (int i = 0; i < mPages.size(); i++) {
            mPages.get(i).setSelected(i == getCurrentItem() ? selected : false);
        }
        setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_AUTO);
    }

    public void setPageListener(PageListener listener) {