Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 40dba2d3 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

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

Change-Id: I366cf4d8c55df4553abb5d835516d14361e0fd64
parents 3e1b654d 243ac3d3
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -2480,6 +2480,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
    void onSessionCreated(IInputMethod method, IInputMethodSession session,
    void onSessionCreated(IInputMethod method, IInputMethodSession session,
            InputChannel channel) {
            InputChannel channel) {
        synchronized (mMethodMap) {
        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
            if (mCurMethod != null && method != null
                    && mCurMethod.asBinder() == method.asBinder()) {
                    && mCurMethod.asBinder() == method.asBinder()) {
                if (mCurClient != null) {
                if (mCurClient != null) {