summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-04-17 23:31:17 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-04-17 23:31:17 +0000
commitdab3e9e5b622cdc26d79ce64e68bfeefdd8a18d6 (patch)
tree1231f34cda7d1c9d6ae0cd58c2453d4b369f6b1a
parentceb366f2844bd8e56edca410f4d2861b1cbd769f (diff)
parent19c49814739ff214f1a7b3900e02d027a21d6d1b (diff)
downloaddevelopment-dab3e9e5b622cdc26d79ce64e68bfeefdd8a18d6.tar.gz
Snap for 5476925 from 19c49814739ff214f1a7b3900e02d027a21d6d1b to qt-aml-release
Change-Id: Ib866628c1dce5cf0f6f036dbea337a8547951f92
-rw-r--r--samples/MultiClientInputMethod/src/com/example/android/multiclientinputmethod/ClientCallbackImpl.java9
-rw-r--r--samples/MultiClientInputMethod/src/com/example/android/multiclientinputmethod/MultiClientInputMethod.java1
2 files changed, 9 insertions, 1 deletions
diff --git a/samples/MultiClientInputMethod/src/com/example/android/multiclientinputmethod/ClientCallbackImpl.java b/samples/MultiClientInputMethod/src/com/example/android/multiclientinputmethod/ClientCallbackImpl.java
index 45b4e56f6..0b7e7acd1 100644
--- a/samples/MultiClientInputMethod/src/com/example/android/multiclientinputmethod/ClientCallbackImpl.java
+++ b/samples/MultiClientInputMethod/src/com/example/android/multiclientinputmethod/ClientCallbackImpl.java
@@ -152,8 +152,11 @@ final class ClientCallbackImpl implements MultiClientInputMethodServiceDelegate.
mDelegate.reportImeWindowTarget(
mClientId, targetWindowHandle, window.getWindow().getAttributes().token);
}
-
if (inputConnection == null || editorInfo == null) {
+ // deactivate previous client.
+ if (MultiClientInputMethod.sLastClientId != mClientId) {
+ mDelegate.setActive(MultiClientInputMethod.sLastClientId, false /* active */);
+ }
// Dummy InputConnection case.
if (window.getClientId() == mClientId) {
// Special hack for temporary focus changes (e.g. notification shade).
@@ -163,6 +166,9 @@ final class ClientCallbackImpl implements MultiClientInputMethodServiceDelegate.
window.onDummyStartInput(mClientId, targetWindowHandle);
}
} else {
+ if (MultiClientInputMethod.sLastClientId != mClientId) {
+ mDelegate.setActive(mClientId, true /* active */);
+ }
window.onStartInput(mClientId, targetWindowHandle, inputConnection);
}
@@ -184,6 +190,7 @@ final class ClientCallbackImpl implements MultiClientInputMethodServiceDelegate.
window.hide();
break;
}
+ MultiClientInputMethod.sLastClientId = mClientId;
}
@Override
diff --git a/samples/MultiClientInputMethod/src/com/example/android/multiclientinputmethod/MultiClientInputMethod.java b/samples/MultiClientInputMethod/src/com/example/android/multiclientinputmethod/MultiClientInputMethod.java
index 150c21d04..bf468e262 100644
--- a/samples/MultiClientInputMethod/src/com/example/android/multiclientinputmethod/MultiClientInputMethod.java
+++ b/samples/MultiClientInputMethod/src/com/example/android/multiclientinputmethod/MultiClientInputMethod.java
@@ -28,6 +28,7 @@ import android.util.Log;
public final class MultiClientInputMethod extends Service {
private static final String TAG = "MultiClientInputMethod";
private static final boolean DEBUG = false;
+ static int sLastClientId = MultiClientInputMethodServiceDelegate.INVALID_CLIENT_ID;
SoftInputWindowManager mSoftInputWindowManager;
MultiClientInputMethodServiceDelegate mDelegate;