Merge "Fix showSoftInput crashing when no IME is enabled" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
00dcf266fb
@@ -54,13 +54,11 @@ public final class ImeFocusController {
|
||||
|
||||
@NonNull
|
||||
private InputMethodManagerDelegate getImmDelegate() {
|
||||
InputMethodManagerDelegate delegate = mDelegate;
|
||||
if (delegate != null) {
|
||||
return delegate;
|
||||
if (mDelegate == null) {
|
||||
mDelegate = mViewRootImpl.mContext.getSystemService(
|
||||
InputMethodManager.class).getDelegate();
|
||||
}
|
||||
delegate = mViewRootImpl.mContext.getSystemService(InputMethodManager.class).getDelegate();
|
||||
mDelegate = delegate;
|
||||
return delegate;
|
||||
return mDelegate;
|
||||
}
|
||||
|
||||
/** Called when the view root is moved to a different display. */
|
||||
|
||||
@@ -408,6 +408,11 @@ final class InputMethodBindingController {
|
||||
@GuardedBy("ImfLock.class")
|
||||
@NonNull
|
||||
InputBindResult bindCurrentMethod() {
|
||||
if (mSelectedMethodId == null) {
|
||||
Slog.e(TAG, "mSelectedMethodId is null!");
|
||||
return InputBindResult.NO_IME;
|
||||
}
|
||||
|
||||
InputMethodInfo info = mMethodMap.get(mSelectedMethodId);
|
||||
if (info == null) {
|
||||
throw new IllegalArgumentException("Unknown id: " + mSelectedMethodId);
|
||||
|
||||
Reference in New Issue
Block a user