Loading core/api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -2570,6 +2570,7 @@ package android.view.inputmethod { public final class InputMethodManager { method public int getDisplayId(); method public boolean hasActiveInputConnection(@Nullable android.view.View); method public boolean isInputMethodPickerShown(); } Loading core/java/android/view/inputmethod/InputMethodManager.java +12 −1 Original line number Diff line number Diff line Loading @@ -749,7 +749,7 @@ public final class InputMethodManager { @Override public boolean hasActiveConnection(View view) { synchronized (mH) { if (!hasServedByInputMethodLocked(view)) { if (!hasServedByInputMethodLocked(view) || mCurMethod == null) { return false; } Loading @@ -765,6 +765,17 @@ public final class InputMethodManager { return mDelegate; } /** * Checks whether the active input connection (if any) is for the given view. * * @hide * @see ImeFocusController#getImmDelegate()#hasActiveInputConnection(View) */ @TestApi public boolean hasActiveInputConnection(@Nullable View view) { return mDelegate.hasActiveConnection(view); } private View getServedViewLocked() { return mCurRootView != null ? mCurRootView.getImeFocusController().getServedView() : null; } Loading core/java/android/widget/ImeAwareEditText.java +1 −1 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ public class ImeAwareEditText extends EditText { public void scheduleShowSoftInput() { final InputMethodManager imm = getContext().getSystemService(InputMethodManager.class); if (imm.isActive(this)) { if (imm.hasActiveInputConnection(this)) { // This means that ImeAwareEditText is already connected to the IME. // InputMethodManager#showSoftInput() is guaranteed to pass client-side focus check. mHasPendingShowSoftInputRequest = false; Loading Loading
core/api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -2570,6 +2570,7 @@ package android.view.inputmethod { public final class InputMethodManager { method public int getDisplayId(); method public boolean hasActiveInputConnection(@Nullable android.view.View); method public boolean isInputMethodPickerShown(); } Loading
core/java/android/view/inputmethod/InputMethodManager.java +12 −1 Original line number Diff line number Diff line Loading @@ -749,7 +749,7 @@ public final class InputMethodManager { @Override public boolean hasActiveConnection(View view) { synchronized (mH) { if (!hasServedByInputMethodLocked(view)) { if (!hasServedByInputMethodLocked(view) || mCurMethod == null) { return false; } Loading @@ -765,6 +765,17 @@ public final class InputMethodManager { return mDelegate; } /** * Checks whether the active input connection (if any) is for the given view. * * @hide * @see ImeFocusController#getImmDelegate()#hasActiveInputConnection(View) */ @TestApi public boolean hasActiveInputConnection(@Nullable View view) { return mDelegate.hasActiveConnection(view); } private View getServedViewLocked() { return mCurRootView != null ? mCurRootView.getImeFocusController().getServedView() : null; } Loading
core/java/android/widget/ImeAwareEditText.java +1 −1 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ public class ImeAwareEditText extends EditText { public void scheduleShowSoftInput() { final InputMethodManager imm = getContext().getSystemService(InputMethodManager.class); if (imm.isActive(this)) { if (imm.hasActiveInputConnection(this)) { // This means that ImeAwareEditText is already connected to the IME. // InputMethodManager#showSoftInput() is guaranteed to pass client-side focus check. mHasPendingShowSoftInputRequest = false; Loading