From b1549341be7383def94dd3d9c1388732141cc822 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 11 Jul 2017 09:59:56 -0700 Subject: Fix z-order issue with text cursors and PiP. - When an activity is in PiP, its windows are top most and always computed incorrectly as the IME target. As a result, the popup windows for the cursors don't find the right parent and are not promoted to be above the IME. Bug: 63546389 Test: Enter PiP, open app with bottom anchored input, and select some text. Ensure that the cursors are top-most. Test: go/wm-smoke Change-Id: I1267504e10544b0a075bbf73e41e001d07a5f74c --- services/core/java/com/android/server/wm/WindowState.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 1ec8e54cad36..1bfc1a0047c3 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -1970,6 +1970,12 @@ class WindowState extends WindowContainer implements WindowManagerP return false; } + final boolean windowsAreFocusable = mAppToken != null && mAppToken.windowsAreFocusable(); + if (!windowsAreFocusable) { + // This window can't be an IME target if the app's windows should not be focusable. + return false; + } + final int fl = mAttrs.flags & (FLAG_NOT_FOCUSABLE | FLAG_ALT_FOCUSABLE_IM); final int type = mAttrs.type; -- cgit v1.2.3-59-g8ed1b