summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Taran Singh <tarandeep@google.com> 2020-02-26 18:18:51 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-02-26 18:18:51 +0000
commitadbd87e55bbd1933cbee8ef3295f5d7a1c2e5d64 (patch)
treea8af08536da13fcdb4b2319ecd6586b34e5d676c
parent0c9978cdce0739dd4c2b0a39837db7d6ed78e243 (diff)
parentf5816e7d30a9fcfed19814ddb4af6719d4686386 (diff)
Merge "Fix FLAG_NOT_FOCUSABLE ime target" into rvc-dev
-rw-r--r--services/core/java/com/android/server/wm/WindowState.java6
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java2
2 files changed, 5 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 37597fbc7c45..bc8c2c951e6a 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -2256,9 +2256,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
return false;
}
- if (PixelFormat.formatHasAlpha(mAttrs.format)) {
- // Support legacy use cases where transparent windows can still be ime target with
- // FLAG_NOT_FOCUSABLE and ALT_FOCUSABLE_IM set.
+ if (PixelFormat.formatHasAlpha(mAttrs.format) && mAttrs.alpha == 0) {
+ // Support legacy use cases where completely transparent windows can still be ime target
+ // with FLAG_NOT_FOCUSABLE and ALT_FOCUSABLE_IM set.
// Certain apps listen for IME insets using transparent windows and ADJUST_NOTHING to
// manually synchronize app content to IME animation b/144619551.
// TODO(b/145812508): remove this once new focus management is complete b/141738570
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java b/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java
index 2c68cc7a19bf..b35d38bf17e5 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java
@@ -251,9 +251,11 @@ public class WindowStateTests extends WindowTestsBase {
// b/145812508: special legacy use-case for transparent/translucent windows.
appWindow.mAttrs.format = PixelFormat.TRANSPARENT;
+ appWindow.mAttrs.alpha = 0;
assertTrue(appWindow.canBeImeTarget());
appWindow.mAttrs.format = PixelFormat.OPAQUE;
+ appWindow.mAttrs.alpha = 1;
appWindow.mAttrs.flags &= ~FLAG_ALT_FOCUSABLE_IM;
assertFalse(appWindow.canBeImeTarget());
appWindow.mAttrs.flags &= ~FLAG_NOT_FOCUSABLE;