diff options
| -rw-r--r-- | services/core/java/com/android/server/InputMethodManagerService.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java index c1b341e7dc67..898d5b73b8d6 100644 --- a/services/core/java/com/android/server/InputMethodManagerService.java +++ b/services/core/java/com/android/server/InputMethodManagerService.java @@ -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, |