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

Commit 6e064d04 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Simplify IMMS#hideSoftInput() with canInteractWithImeLocked()

This is a mechanical refacotring.  There should be no user observable
behavior difference.

Bug: 234882948
Test: presubmit
Change-Id: I8409dadd484739c1daae2237f3222d589baab347
parent 7e29c3b0
Loading
Loading
Loading
Loading
+2 −15
Original line number Diff line number Diff line
@@ -3500,22 +3500,9 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
            final long ident = Binder.clearCallingIdentity();
            try {
                Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "IMMS.hideSoftInput");
                if (mCurClient == null || client == null
                        || mCurClient.client.asBinder() != client.asBinder()) {
                    // We need to check if this is the current client with
                    // focus in the window manager, to allow this call to
                    // be made before input is started in it.
                    final ClientState cs = mClients.get(client.asBinder());
                    if (cs == null) {
                        throw new IllegalArgumentException("unknown client " + client.asBinder());
                    }
                    if (!isImeClientFocused(windowToken, cs)) {
                        if (DEBUG) {
                            Slog.w(TAG, "Ignoring hideSoftInput of uid " + uid + ": " + client);
                        }
                if (!canInteractWithImeLocked(uid, client, "hideSoftInput")) {
                    return false;
                }
                }

                if (DEBUG) Slog.v(TAG, "Client requesting input be hidden");
                return InputMethodManagerService.this.hideCurrentInputLocked(windowToken,