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

Commit 11a6929c authored by Hongwei Wang's avatar Hongwei Wang
Browse files

Fix A11y on PipMenuView

Ensure the shell root accessibility window is set to null when PiP menu
state is NONE (invisible).

Bug: 208880253
Test: manual, ensure SwitchAccess and TalkBack can access PiP menu
Change-Id: I404ea74069ca9052f165198a8d7f9abdd55dbdb2
parent 54fed092
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -191,6 +191,7 @@ public class PhonePipMenuController implements PipMenuController {
        mSystemWindows.addView(mPipMenuView,
                getPipMenuLayoutParams(MENU_WINDOW_TITLE, 0 /* width */, 0 /* height */),
                0, SHELL_ROOT_LAYER_PIP);
        setShellRootAccessibilityWindow();
    }

    private void detachPipMenuView() {
@@ -546,6 +547,10 @@ public class PhonePipMenuController implements PipMenuController {
            mListeners.forEach(l -> l.onPipMenuStateChangeFinish(menuState));
        }
        mMenuState = menuState;
        setShellRootAccessibilityWindow();
    }

    private void setShellRootAccessibilityWindow() {
        switch (mMenuState) {
            case MENU_STATE_NONE:
                mSystemWindows.setShellRootAccessibilityWindow(0, SHELL_ROOT_LAYER_PIP, null);