summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-07-02 13:28:33 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-07-02 13:28:33 +0000
commit0ef33bcb35a60a18e89e08e6b37979b268026617 (patch)
treed27ccab8275fc43fcc4e4e73cfa29ce3dcdd002d /core/java
parent5d717b85a1a30ec8970d95ea9bcb2d6cadd15bc9 (diff)
parent69947c067109b6c9b92a2bdd792e5a74d598611a (diff)
Merge "Revert new logic around FLAG_ALT_FOCUSABLE_IM" into rvc-dev
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/view/WindowManager.java28
1 files changed, 19 insertions, 9 deletions
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index 76071278edf8..5c6269421a1f 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -1454,11 +1454,22 @@ public interface WindowManager extends ViewManager {
@Deprecated
public static final int FLAG_LAYOUT_INSET_DECOR = 0x00010000;
- /** Window flag: When set, input method can't interact with the focusable window
- * and can be placed to use more space and cover the input method.
- * Note: When combined with {@link #FLAG_NOT_FOCUSABLE}, this flag has no
- * effect since input method cannot interact with windows having {@link #FLAG_NOT_FOCUSABLE}
- * flag set.
+ /** Window flag: when set, inverts the input method focusability of the window.
+ *
+ * The effect of setting this flag depends on whether {@link #FLAG_NOT_FOCUSABLE} is set:
+ * <p>
+ * If {@link #FLAG_NOT_FOCUSABLE} is <em>not</em> set, i.e. when the window is focusable,
+ * setting this flag prevents this window from becoming the target of the input method.
+ * Consequently, it will <em>not</em> be able to interact with the input method,
+ * and will be layered above the input method (unless there is another input method
+ * target above it).
+ *
+ * <p>
+ * If {@link #FLAG_NOT_FOCUSABLE} <em>is</em> set, setting this flag requests for the window
+ * to be the input method target even though the window is <em>not</em> focusable.
+ * Consequently, it will be layered below the input method.
+ * Note: Windows that set {@link #FLAG_NOT_FOCUSABLE} cannot interact with the input method,
+ * regardless of this flag.
*/
public static final int FLAG_ALT_FOCUSABLE_IM = 0x00020000;
@@ -2142,13 +2153,12 @@ public interface WindowManager extends ViewManager {
* focus. In particular, this checks the
* {@link #FLAG_NOT_FOCUSABLE} and {@link #FLAG_ALT_FOCUSABLE_IM}
* flags and returns true if the combination of the two corresponds
- * to a window that needs to be behind the input method so that the
- * user can type into it.
+ * to a window that can use the input method.
*
* @param flags The current window manager flags.
*
- * @return Returns {@code true} if such a window should be behind/interact
- * with an input method, {@code false} if not.
+ * @return Returns {@code true} if a window with the given flags would be able to
+ * use the input method, {@code false} if not.
*/
public static boolean mayUseInputMethod(int flags) {
return (flags & FLAG_NOT_FOCUSABLE) != FLAG_NOT_FOCUSABLE