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

Commit 379b9ab4 authored by Winson Chung's avatar Winson Chung
Browse files

Catching additional case where menu would disappear in accessibility.

- When showing the menu via accessibility it will stay on screen until
  the user focuses away, but exploring via talkback still sends
  onUserInteraction() callbacks which would post it anew.  We need to
  save the timeout state whenever the menu is shown and check it there
  as well.

Bug: 36103023
Test: Enter PIP with talk back, touch button but don't do anything for
      the timeout (~4s), verify menu does not close.

Change-Id: I03ce14531fcde84440122bfb0fc70899f5178d5b
parent 78e8ac9c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ public class PipMenuActivity extends Activity {
    private static final float DISABLED_ACTION_ALPHA = 0.54f;

    private boolean mMenuVisible;
    private boolean mAllowMenuTimeout = true;
    private final List<RemoteAction> mActions = new ArrayList<>();
    private View mViewRoot;
    private Drawable mBackgroundDrawable;
@@ -190,8 +191,10 @@ public class PipMenuActivity extends Activity {

    @Override
    public void onUserInteraction() {
        if (mAllowMenuTimeout) {
            repostDelayedFinish(POST_INTERACTION_DISMISS_DELAY);
        }
    }

    @Override
    protected void onUserLeaveHint() {
@@ -255,6 +258,7 @@ public class PipMenuActivity extends Activity {
    }

    private void showMenu(Rect stackBounds, Rect movementBounds, boolean allowMenuTimeout) {
        mAllowMenuTimeout = allowMenuTimeout;
        if (!mMenuVisible) {
            updateActionViews(stackBounds);
            if (mMenuContainerAnimator != null) {