Loading core/java/android/view/inputmethod/InputMethodManager.java +22 −11 Original line number Original line Diff line number Diff line Loading @@ -355,9 +355,11 @@ public final class InputMethodManager { if (mServedView != null && mServedView.isFocused()) { if (mServedView != null && mServedView.isFocused()) { mServedConnecting = true; mServedConnecting = true; } } } if (mActive) { startInputInner(); startInputInner(); } } } } return; return; } } case MSG_SET_ACTIVE: { case MSG_SET_ACTIVE: { Loading Loading @@ -1127,15 +1129,21 @@ public final class InputMethodManager { * @hide * @hide */ */ public void checkFocus() { public void checkFocus() { if (checkFocusNoStartInput()) { startInputInner(); } } private boolean checkFocusNoStartInput() { // This is called a lot, so short-circuit before locking. // This is called a lot, so short-circuit before locking. if (mServedView == mNextServedView && !mNextServedNeedsStart) { if (mServedView == mNextServedView && !mNextServedNeedsStart) { return; return false; } } InputConnection ic = null; InputConnection ic = null; synchronized (mH) { synchronized (mH) { if (mServedView == mNextServedView && !mNextServedNeedsStart) { if (mServedView == mNextServedView && !mNextServedNeedsStart) { return; return false; } } if (DEBUG) Log.v(TAG, "checkFocus: view=" + mServedView if (DEBUG) Log.v(TAG, "checkFocus: view=" + mServedView + " next=" + mNextServedView + " next=" + mNextServedView Loading @@ -1148,7 +1156,7 @@ public final class InputMethodManager { // but no longer do. We should make sure the input method is // but no longer do. We should make sure the input method is // no longer shown, since it serves no purpose. // no longer shown, since it serves no purpose. closeCurrentInput(); closeCurrentInput(); return; return false; } } ic = mServedInputConnection; ic = mServedInputConnection; Loading @@ -1163,7 +1171,7 @@ public final class InputMethodManager { ic.finishComposingText(); ic.finishComposingText(); } } startInputInner(); return true; } } void closeCurrentInput() { void closeCurrentInput() { Loading Loading @@ -1192,7 +1200,7 @@ public final class InputMethodManager { focusInLocked(focusedView != null ? focusedView : rootView); focusInLocked(focusedView != null ? focusedView : rootView); } } checkFocus(); boolean startInput = checkFocusNoStartInput(); synchronized (mH) { synchronized (mH) { try { try { Loading @@ -1201,6 +1209,9 @@ public final class InputMethodManager { mService.windowGainedFocus(mClient, rootView.getWindowToken(), mService.windowGainedFocus(mClient, rootView.getWindowToken(), focusedView != null, isTextEditor, softInputMode, first, focusedView != null, isTextEditor, softInputMode, first, windowFlags); windowFlags); if (startInput) { startInputInner(); } } catch (RemoteException e) { } catch (RemoteException e) { } } } } Loading Loading
core/java/android/view/inputmethod/InputMethodManager.java +22 −11 Original line number Original line Diff line number Diff line Loading @@ -355,9 +355,11 @@ public final class InputMethodManager { if (mServedView != null && mServedView.isFocused()) { if (mServedView != null && mServedView.isFocused()) { mServedConnecting = true; mServedConnecting = true; } } } if (mActive) { startInputInner(); startInputInner(); } } } } return; return; } } case MSG_SET_ACTIVE: { case MSG_SET_ACTIVE: { Loading Loading @@ -1127,15 +1129,21 @@ public final class InputMethodManager { * @hide * @hide */ */ public void checkFocus() { public void checkFocus() { if (checkFocusNoStartInput()) { startInputInner(); } } private boolean checkFocusNoStartInput() { // This is called a lot, so short-circuit before locking. // This is called a lot, so short-circuit before locking. if (mServedView == mNextServedView && !mNextServedNeedsStart) { if (mServedView == mNextServedView && !mNextServedNeedsStart) { return; return false; } } InputConnection ic = null; InputConnection ic = null; synchronized (mH) { synchronized (mH) { if (mServedView == mNextServedView && !mNextServedNeedsStart) { if (mServedView == mNextServedView && !mNextServedNeedsStart) { return; return false; } } if (DEBUG) Log.v(TAG, "checkFocus: view=" + mServedView if (DEBUG) Log.v(TAG, "checkFocus: view=" + mServedView + " next=" + mNextServedView + " next=" + mNextServedView Loading @@ -1148,7 +1156,7 @@ public final class InputMethodManager { // but no longer do. We should make sure the input method is // but no longer do. We should make sure the input method is // no longer shown, since it serves no purpose. // no longer shown, since it serves no purpose. closeCurrentInput(); closeCurrentInput(); return; return false; } } ic = mServedInputConnection; ic = mServedInputConnection; Loading @@ -1163,7 +1171,7 @@ public final class InputMethodManager { ic.finishComposingText(); ic.finishComposingText(); } } startInputInner(); return true; } } void closeCurrentInput() { void closeCurrentInput() { Loading Loading @@ -1192,7 +1200,7 @@ public final class InputMethodManager { focusInLocked(focusedView != null ? focusedView : rootView); focusInLocked(focusedView != null ? focusedView : rootView); } } checkFocus(); boolean startInput = checkFocusNoStartInput(); synchronized (mH) { synchronized (mH) { try { try { Loading @@ -1201,6 +1209,9 @@ public final class InputMethodManager { mService.windowGainedFocus(mClient, rootView.getWindowToken(), mService.windowGainedFocus(mClient, rootView.getWindowToken(), focusedView != null, isTextEditor, softInputMode, first, focusedView != null, isTextEditor, softInputMode, first, windowFlags); windowFlags); if (startInput) { startInputInner(); } } catch (RemoteException e) { } catch (RemoteException e) { } } } } Loading