From 1965456d5b0020f82c08b1828b378cc4337e5b4a Mon Sep 17 00:00:00 2001 From: "jorgegil@google.com" Date: Wed, 31 Mar 2021 11:39:42 -0700 Subject: [PATCH] Account for OHM offset before possibly hiding the PIP menu Menu actions were not clickable because the drag corner resize handler did not take into account the OHM offset when comparing the touch location to the PIP bounds, wrongly causing the menu to be hidden on ACTION_DOWN and thus the menu actions never got their click listeners fired on ACTION_UP. Bug: 172839150 Test: Enter PIP with YT, enter OHM, play/pause/expand work fine Change-Id: I8d1539cef46a5d7c0afe88e80638175cb3994db3 --- .../com/android/wm/shell/pip/phone/PipResizeGestureHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java index 7b6e4776ea659..588571f7171e5 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java @@ -441,7 +441,7 @@ public class PipResizeGestureHandler { mDownPoint.set(x, y); mDownBounds.set(mPipBoundsState.getBounds()); } - if (!currentPipBounds.contains((int) ev.getX(), (int) ev.getY()) + if (!currentPipBounds.contains((int) x, (int) y) && mPhonePipMenuController.isMenuVisible()) { mPhonePipMenuController.hideMenu(); }