From 6af502fdb8e802f735661576decedec118979229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Ciche=C5=84ski?= Date: Wed, 26 Oct 2022 15:45:01 +0000 Subject: [PATCH] Skip moving PiP for IME/shelf change if user is dragging. Tapping on the PiP will already make isUserInteracting equal to true. However, user might have simply tapped it to open the menu. Defer the movement only if user is actively dragging PiP (aka changing the position of PiP while using another touch point to e.g. open IME). This also will make PiP move above IME anyways, when user finishes the drag. Bug: 255689034 Test: open PiP, tap it to show PiP menu, open IME, pip moves away Test: open PiP, while dragging open IME with another finger, pip stays Change-Id: If5830ed783cf969d4eba8a91f235e008a6e13680 --- .../src/com/android/wm/shell/pip/phone/PipTouchHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java index 975d4bba276e2..a9a97beb91804 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java @@ -427,7 +427,7 @@ public class PipTouchHandler { // If this is from an IME or shelf adjustment, then we should move the PiP so that it is not // occluded by the IME or shelf. if (fromImeAdjustment || fromShelfAdjustment) { - if (mTouchState.isUserInteracting()) { + if (mTouchState.isUserInteracting() && mTouchState.isDragging()) { // Defer the update of the current movement bounds until after the user finishes // touching the screen } else if (ENABLE_PIP_KEEP_CLEAR_ALGORITHM) {