summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Winson Chung <winsonc@google.com> 2017-04-04 11:57:36 -0700
committer Winson Chung <winsonc@google.com> 2017-04-04 19:03:54 +0000
commit379b9ab42c82102cbad2337cc8d25aa5a1cfd8c7 (patch)
treed20ef6b1a30965b2211fe1ee833599b7ec519327
parent78e8ac9c141ca2b3fb99520dc627919bc2f97ba4 (diff)
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
-rw-r--r--packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java6
1 files changed, 5 insertions, 1 deletions
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<RemoteAction> 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) {