From 379b9ab42c82102cbad2337cc8d25aa5a1cfd8c7 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 4 Apr 2017 11:57:36 -0700 Subject: 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 --- .../src/com/android/systemui/pip/phone/PipMenuActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java index bcf1957109de..fbd9f0c54725 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java +++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java @@ -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 mActions = new ArrayList<>(); private View mViewRoot; private Drawable mBackgroundDrawable; @@ -190,7 +191,9 @@ public class PipMenuActivity extends Activity { @Override public void onUserInteraction() { - repostDelayedFinish(POST_INTERACTION_DISMISS_DELAY); + if (mAllowMenuTimeout) { + repostDelayedFinish(POST_INTERACTION_DISMISS_DELAY); + } } @Override @@ -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) { -- cgit v1.2.3-59-g8ed1b