From 524bc0a22c83c03d981c40f2939a9b443a6f909e Mon Sep 17 00:00:00 2001 From: Ben Lin Date: Wed, 16 Jun 2021 12:37:37 -0700 Subject: [PATCH] PiP: Update menu bounds before showing the menu. It is possible that sometimes when PiP menu is not showing, it is not updated correctly. Bug: 190210447 Test: Enter PiP Change-Id: I87639a6d568e96e26d4b79ba68a6349ec0ae29e1 --- .../android/wm/shell/pip/phone/PhonePipMenuController.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java index f6b5889dda280..bc8e1e72b830c 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java @@ -278,6 +278,10 @@ public class PhonePipMenuController implements PipMenuController { return; } + // Sync the menu bounds before showing it in case it is out of sync. + movePipMenu(null /* pipLeash */, null /* transaction */, stackBounds); + updateMenuBounds(stackBounds); + mPipMenuView.showMenu(menuState, stackBounds, allowMenuTimeout, willResizeMenu, withDelay, showResizeHandle); }