Merge "Fix session race due to pending user-switch task" into rvc-dev am: 243ac3d355

Change-Id: I366cf4d8c55df4553abb5d835516d14361e0fd64
This commit is contained in:
Automerger Merge Worker
2020-03-06 01:17:20 +00:00

View File

@@ -2480,6 +2480,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
void onSessionCreated(IInputMethod method, IInputMethodSession session,
InputChannel channel) {
synchronized (mMethodMap) {
if (mUserSwitchHandlerTask != null) {
// We have a pending user-switching task so it's better to just ignore this session.
channel.dispose();
return;
}
if (mCurMethod != null && method != null
&& mCurMethod.asBinder() == method.asBinder()) {
if (mCurClient != null) {