summaryrefslogtreecommitdiff
path: root/core/java/android/inputmethodservice/MultiClientInputMethodServiceDelegate.java
diff options
context:
space:
mode:
authorTarandeep Singh <tarandeep@google.com>2019-04-11 15:55:28 -0700
committerTarandeep Singh <tarandeep@google.com>2019-04-11 15:55:28 -0700
commite1921a7b4d58c97570277fe83dbe9206f2db496d (patch)
tree0f3c87424162dee8a91f71ae685aaa25b1ce470e /core/java/android/inputmethodservice/MultiClientInputMethodServiceDelegate.java
parent08ccf9bba46f597b71fa791c677938ace49eb3fb (diff)
Allow MSIME to set inactive when window loses focus.
MSIME doesn't work when existing InputConnection is restored. The fix is to allow MSIME to activate connection when window gains focus and set inactive when window loses focus. This mimics single session IME. Bug: 128751901 Test: Manually tested using steps in bug. Change-Id: I22cef6c1dacb0ca402840da94a2bf02b989da447
Diffstat (limited to 'core/java/android/inputmethodservice/MultiClientInputMethodServiceDelegate.java')
-rw-r--r--core/java/android/inputmethodservice/MultiClientInputMethodServiceDelegate.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/inputmethodservice/MultiClientInputMethodServiceDelegate.java b/core/java/android/inputmethodservice/MultiClientInputMethodServiceDelegate.java
index 0604f6a69d00..4b02085726f1 100644
--- a/core/java/android/inputmethodservice/MultiClientInputMethodServiceDelegate.java
+++ b/core/java/android/inputmethodservice/MultiClientInputMethodServiceDelegate.java
@@ -374,4 +374,15 @@ public final class MultiClientInputMethodServiceDelegate {
public boolean isUidAllowedOnDisplay(int displayId, int uid) {
return mImpl.isUidAllowedOnDisplay(displayId, uid);
}
+
+ /**
+ * Can be called by MSIME to activate/deactivate a client when it is gaining/losing focus
+ * respectively.
+ *
+ * @param clientId client ID to activate/deactivate.
+ * @param active {@code true} to activate a client.
+ */
+ public void setActive(int clientId, boolean active) {
+ mImpl.setActive(clientId, active);
+ }
}