summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ben Lin <linben@google.com> 2020-06-05 18:01:09 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-06-05 18:01:09 +0000
commit4757e8927746e5a576212d9364bfaa8276088b01 (patch)
tree6cc791dba38b7f3038d2f7f75afc21c5b2af013b
parentdde268202921bc9aeb671d552dc7059d2fb6d834 (diff)
parent9be3e7878d67c6f006e536a5d79caabf4fbfe0b1 (diff)
Merge "PiP: Potentially hide menu immediately after it appears." into rvc-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
index c274ee96b170..7a9dcdebb18e 100644
--- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
+++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
@@ -161,6 +161,7 @@ public class PipTouchHandler {
private float mSavedSnapFraction = -1f;
private boolean mSendingHoverAccessibilityEvents;
private boolean mMovementWithinDismiss;
+ private boolean mHideMenuAfterShown = false;
private PipAccessibilityInteractionConnection mConnection;
// Touch state
@@ -677,6 +678,7 @@ public class PipTouchHandler {
break;
}
case MotionEvent.ACTION_HOVER_EXIT: {
+ mHideMenuAfterShown = true;
// If Touch Exploration is enabled, some a11y services (e.g. Talkback) is probably
// on and changing MotionEvents into HoverEvents.
// Let's not enable menu show/hide for a11y services.
@@ -767,6 +769,9 @@ public class PipTouchHandler {
mSavedSnapFraction = mMotionHelper.animateToExpandedState(expandedBounds,
mMovementBounds, mExpandedMovementBounds, callback);
}
+ if (mHideMenuAfterShown) {
+ mMenuController.hideMenu();
+ }
} else if (menuState == MENU_STATE_NONE && mMenuState == MENU_STATE_FULL) {
// Try and restore the PiP to the closest edge, using the saved snap fraction
// if possible
@@ -804,6 +809,7 @@ public class PipTouchHandler {
}
}
mMenuState = menuState;
+ mHideMenuAfterShown = false;
updateMovementBounds();
// If pip menu has dismissed, we should register the A11y ActionReplacingConnection for pip
// as well, or it can't handle a11y focus and pip menu can't perform any action.