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

Commit f323763d authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android Git Automerger
Browse files

am ddf573d6: am 2d243bc6: Merge "Fix issue #5680541: onStartInputView called...

am ddf573d6: am 2d243bc6: Merge "Fix issue #5680541: onStartInputView called upon focus loss" into jb-dev

* commit 'ddf573d6':
  Fix issue #5680541: onStartInputView called upon focus loss
parents e2d5b980 ddf573d6
Loading
Loading
Loading
Loading
+18 −21
Original line number Original line Diff line number Diff line
@@ -139,6 +139,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub


    static final int MSG_UNBIND_METHOD = 3000;
    static final int MSG_UNBIND_METHOD = 3000;
    static final int MSG_BIND_METHOD = 3010;
    static final int MSG_BIND_METHOD = 3010;
    static final int MSG_SET_ACTIVE = 3020;


    static final int MSG_HARD_KEYBOARD_SWITCH_CHANGED = 4000;
    static final int MSG_HARD_KEYBOARD_SWITCH_CHANGED = 4000;


@@ -413,13 +414,9 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            }
            }


            // Inform the current client of the change in active status
            // Inform the current client of the change in active status
            try {
            if (mCurClient != null && mCurClient.client != null) {
            if (mCurClient != null && mCurClient.client != null) {
                    mCurClient.client.setActive(mScreenOn);
                executeOrSendMessage(mCurClient.client, mCaller.obtainMessageIO(
                }
                        MSG_SET_ACTIVE, mScreenOn ? 1 : 0, mCurClient));
            } catch (RemoteException e) {
                Slog.w(TAG, "Got RemoteException sending 'screen on/off' notification to pid "
                        + mCurClient.pid + " uid " + mCurClient.uid);
            }
            }
        }
        }
    }
    }
@@ -882,17 +879,12 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
                            MSG_UNBIND_INPUT, mCurMethod));
                            MSG_UNBIND_INPUT, mCurMethod));
                }
                }
            }
            }

            executeOrSendMessage(mCurClient.client, mCaller.obtainMessageIO(
                    MSG_SET_ACTIVE, 0, mCurClient));
            executeOrSendMessage(mCurClient.client, mCaller.obtainMessageIO(
            executeOrSendMessage(mCurClient.client, mCaller.obtainMessageIO(
                    MSG_UNBIND_METHOD, mCurSeq, mCurClient.client));
                    MSG_UNBIND_METHOD, mCurSeq, mCurClient.client));
            mCurClient.sessionRequested = false;
            mCurClient.sessionRequested = false;

            // Call setActive(false) on the old client
            try {
                mCurClient.client.setActive(false);
            } catch (RemoteException e) {
                Slog.w(TAG, "Got RemoteException sending setActive(false) notification to pid "
                        + mCurClient.pid + " uid " + mCurClient.uid);
            }
            mCurClient = null;
            mCurClient = null;


            hideInputMethodMenuLocked();
            hideInputMethodMenuLocked();
@@ -987,12 +979,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub


            // If the screen is on, inform the new client it is active
            // If the screen is on, inform the new client it is active
            if (mScreenOn) {
            if (mScreenOn) {
                try {
                executeOrSendMessage(cs.client, mCaller.obtainMessageIO(
                    cs.client.setActive(mScreenOn);
                        MSG_SET_ACTIVE, mScreenOn ? 1 : 0, cs));
                } catch (RemoteException e) {
                    Slog.w(TAG, "Got RemoteException sending setActive notification to pid "
                            + cs.pid + " uid " + cs.uid);
                }
            }
            }
        }
        }


@@ -2140,6 +2128,15 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
                    Slog.w(TAG, "Client died receiving input method " + args.arg2);
                    Slog.w(TAG, "Client died receiving input method " + args.arg2);
                }
                }
                return true;
                return true;
            case MSG_SET_ACTIVE:
                try {
                    ((ClientState)msg.obj).client.setActive(msg.arg1 != 0);
                } catch (RemoteException e) {
                    Slog.w(TAG, "Got RemoteException sending setActive(false) notification to pid "
                            + ((ClientState)msg.obj).pid + " uid "
                            + ((ClientState)msg.obj).uid);
                }
                return true;


            // --------------------------------------------------------------
            // --------------------------------------------------------------
            case MSG_HARD_KEYBOARD_SWITCH_CHANGED:
            case MSG_HARD_KEYBOARD_SWITCH_CHANGED: