From b3214c5176721ca2f20fd07935cac03a21b88f0f Mon Sep 17 00:00:00 2001 From: Ming-Shin Lu Date: Mon, 31 Oct 2022 10:53:17 +0800 Subject: [PATCH] Update showSoftInput javadoc For the app developers to understand the editor view of requesting showSoftInput requires the view and its window must be focused and serverd by an input method. Bug: 256517410 Test: build Change-Id: Ibe52263a01f62140862527fd59111b914ad5e18c --- .../view/inputmethod/InputMethodManager.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java index 574d0356ae42f..389a4f2cfab01 100644 --- a/core/java/android/view/inputmethod/InputMethodManager.java +++ b/core/java/android/view/inputmethod/InputMethodManager.java @@ -1904,8 +1904,11 @@ public final class InputMethodManager { * a result receiver: explicitly request that the current input method's * soft input area be shown to the user, if needed. * - * @param view The currently focused view, which would like to receive - * soft keyboard input. + * @param view The currently focused view, which would like to receive soft keyboard input. + * Note that this view is only considered focused here if both it itself has + * {@link View#isFocused view focus}, and its containing window has + * {@link View#hasWindowFocus window focus}. Otherwise the call fails and + * returns {@code false}. * @param flags Provides additional operating flags. Currently may be * 0 or have the {@link #SHOW_IMPLICIT} bit set. */ @@ -1967,8 +1970,11 @@ public final class InputMethodManager { * can be garbage collected regardless of the lifetime of * {@link ResultReceiver}. * - * @param view The currently focused view, which would like to receive - * soft keyboard input. + * @param view The currently focused view, which would like to receive soft keyboard input. + * Note that this view is only considered focused here if both it itself has + * {@link View#isFocused view focus}, and its containing window has + * {@link View#hasWindowFocus window focus}. Otherwise the call fails and + * returns {@code false}. * @param flags Provides additional operating flags. Currently may be * 0 or have the {@link #SHOW_IMPLICIT} bit set. * @param resultReceiver If non-null, this will be called by the IME when