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
|
@NonNull
|
||||||
private InputMethodManagerDelegate getImmDelegate() {
|
private InputMethodManagerDelegate getImmDelegate() {
|
||||||
InputMethodManagerDelegate delegate = mDelegate;
|
if (mDelegate == null) {
|
||||||
if (delegate != null) {
|
mDelegate = mViewRootImpl.mContext.getSystemService(
|
||||||
return delegate;
|
InputMethodManager.class).getDelegate();
|
||||||
}
|
}
|
||||||
delegate = mViewRootImpl.mContext.getSystemService(InputMethodManager.class).getDelegate();
|
return mDelegate;
|
||||||
mDelegate = delegate;
|
|
||||||
return delegate;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Called when the view root is moved to a different display. */
|
/** Called when the view root is moved to a different display. */
|
||||||
|
|||||||
@@ -408,6 +408,11 @@ final class InputMethodBindingController {
|
|||||||
@GuardedBy("ImfLock.class")
|
@GuardedBy("ImfLock.class")
|
||||||
@NonNull
|
@NonNull
|
||||||
InputBindResult bindCurrentMethod() {
|
InputBindResult bindCurrentMethod() {
|
||||||
|
if (mSelectedMethodId == null) {
|
||||||
|
Slog.e(TAG, "mSelectedMethodId is null!");
|
||||||
|
return InputBindResult.NO_IME;
|
||||||
|
}
|
||||||
|
|
||||||
InputMethodInfo info = mMethodMap.get(mSelectedMethodId);
|
InputMethodInfo info = mMethodMap.get(mSelectedMethodId);
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
throw new IllegalArgumentException("Unknown id: " + mSelectedMethodId);
|
throw new IllegalArgumentException("Unknown id: " + mSelectedMethodId);
|
||||||
|
|||||||
Reference in New Issue
Block a user