summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorlpeter <lpeter@google.com>2020-03-05 20:32:16 +0800
committerlpeter <lpeter@google.com>2020-03-20 12:16:44 +0800
commit133fce01713ddd03fdcb36bc40fa01ccddb02dc0 (patch)
tree83581bffdbf64fea8813fe17c4b7b64e15c95ef3 /core/java/android
parent3fe090f73747cd78a61a60c1588deae9b9350e9e (diff)
Move the logic of transferTouchFocusToImeWindow to IMMS.
It would better move logic of transferTouchFocusToImeWindow from WindowManagerService to InputMethodManagerService. Bug: 149574510 Test: atest CtsAutoFillServiceTestCases Test: atest CtsInputMethodTestCases Change-Id: I268b09781e5eb7c77c4912efdc8fd5d6936ada27
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/hardware/input/InputManagerInternal.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/core/java/android/hardware/input/InputManagerInternal.java b/core/java/android/hardware/input/InputManagerInternal.java
index d8da548d9bd3..f6cd726dda4a 100644
--- a/core/java/android/hardware/input/InputManagerInternal.java
+++ b/core/java/android/hardware/input/InputManagerInternal.java
@@ -16,7 +16,9 @@
package android.hardware.input;
+import android.annotation.NonNull;
import android.hardware.display.DisplayViewport;
+import android.os.IBinder;
import android.view.InputEvent;
import java.util.List;
@@ -59,4 +61,21 @@ public abstract class InputManagerInternal {
* Set whether the input stack should deliver pulse gesture events when the device is asleep.
*/
public abstract void setPulseGestureEnabled(boolean enabled);
+
+ /**
+ * Atomically transfers touch focus from one window to another as identified by
+ * their input channels. It is possible for multiple windows to have
+ * touch focus if they support split touch dispatch
+ * {@link android.view.WindowManager.LayoutParams#FLAG_SPLIT_TOUCH} but this
+ * method only transfers touch focus of the specified window without affecting
+ * other windows that may also have touch focus at the same time.
+ *
+ * @param fromChannelToken The channel token of a window that currently has touch focus.
+ * @param toChannelToken The channel token of the window that should receive touch focus in
+ * place of the first.
+ * @return {@code true} if the transfer was successful. {@code false} if the window with the
+ * specified channel did not actually have touch focus at the time of the request.
+ */
+ public abstract boolean transferTouchFocus(@NonNull IBinder fromChannelToken,
+ @NonNull IBinder toChannelToken);
}