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

Commit 4e523000 authored by Yohei Yukawa's avatar Yohei Yukawa Committed by android-build-merger
Browse files

Merge "Explicitly handle null rather than relying on NPE." into nyc-dev

am: 9e31f4d8

* commit '9e31f4d8':
  Explicitly handle null rather than relying on NPE.
parents a9f06080 9e31f4d8
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -1318,8 +1318,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            /* @InputMethodClient.StartInputReason */ final int startInputReason,
            IInputMethodClient client, IInputContext inputContext,
            /* @InputConnectionInspector.missingMethods */ final int missingMethods,
            EditorInfo attribute,
            int controlFlags) {
            @Nullable EditorInfo attribute, int controlFlags) {
        // If no method is currently selected, do nothing.
        if (mCurMethodId == null) {
            return mNoBinding;
@@ -1331,6 +1330,12 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
                    + client.asBinder());
        }

        if (attribute == null) {
            Slog.w(TAG, "Ignoring startInput with null EditorInfo."
                    + " uid=" + cs.uid + " pid=" + cs.pid);
            return null;
        }

        try {
            if (!mIWindowManager.inputMethodClientHasFocus(cs.client)) {
                // Check with the window manager to make sure this client actually
@@ -1476,7 +1481,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            /* @InputMethodClient.StartInputReason */ final int startInputReason,
            IInputMethodClient client, IInputContext inputContext,
            /* @InputConnectionInspector.missingMethods */ final int missingMethods,
            EditorInfo attribute, int controlFlags) {
            @Nullable EditorInfo attribute, int controlFlags) {
        if (!calledFromValidUser()) {
            return null;
        }
@@ -2208,7 +2213,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
    public InputBindResult startInputOrWindowGainedFocus(
            /* @InputMethodClient.StartInputReason */ final int startInputReason,
            IInputMethodClient client, IBinder windowToken, int controlFlags, int softInputMode,
            int windowFlags, EditorInfo attribute, IInputContext inputContext,
            int windowFlags, @Nullable EditorInfo attribute, IInputContext inputContext,
            /* @InputConnectionInspector.missingMethods */ final int missingMethods) {
        if (windowToken != null) {
            return windowGainedFocus(startInputReason, client, windowToken, controlFlags,