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

Commit 1af08411 authored by Satoshi Kataoka's avatar Satoshi Kataoka Committed by Android (Google) Code Review
Browse files

Merge "Hide current soft input when a background user gains window focus." into jb-mr1.1-dev

parents de0bf8bc 8d03305b
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -1824,9 +1824,9 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
    public InputBindResult windowGainedFocus(IInputMethodClient client, IBinder windowToken,
            int controlFlags, int softInputMode, int windowFlags,
            EditorInfo attribute, IInputContext inputContext) {
        if (!calledFromValidUser()) {
            return null;
        }
        // Needs to check the validity before clearing calling identity
        final boolean calledFromValidUser = calledFromValidUser();

        InputBindResult res = null;
        long ident = Binder.clearCallingIdentity();
        try {
@@ -1856,6 +1856,14 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
                } catch (RemoteException e) {
                }

                if (!calledFromValidUser) {
                    Slog.w(TAG, "A background user is requesting window. Hiding IME.");
                    Slog.w(TAG, "If you want to interect with IME, you need "
                            + "android.permission.INTERACT_ACROSS_USERS_FULL");
                    hideCurrentInputLocked(0, null);
                    return null;
                }

                if (mCurFocusedWindow == windowToken) {
                    Slog.w(TAG, "Window already focused, ignoring focus gain of: " + client
                            + " attribute=" + attribute + ", token = " + windowToken);