summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/view/inputmethod/InputMethodManager.java8
-rw-r--r--core/java/com/android/internal/inputmethod/InputMethodDebug.java6
-rw-r--r--core/java/com/android/internal/inputmethod/StartInputReason.java30
3 files changed, 29 insertions, 15 deletions
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index 477dd1d13295..821dd742db9a 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -19,6 +19,9 @@ package android.view.inputmethod;
import static android.Manifest.permission.INTERACT_ACROSS_USERS_FULL;
import static android.Manifest.permission.WRITE_SECURE_SETTINGS;
+import static com.android.internal.inputmethod.StartInputReason.WINDOW_FOCUS_GAIN_REPORT_WITHOUT_EDITOR;
+import static com.android.internal.inputmethod.StartInputReason.WINDOW_FOCUS_GAIN_REPORT_WITH_SAME_EDITOR;
+
import android.annotation.DrawableRes;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -622,8 +625,11 @@ public final class InputMethodManager {
Log.v(TAG, "Reporting focus gain, without startInput"
+ ", nextFocusIsServedView=" + nextFocusIsServedView);
}
+ final int startInputReason =
+ nextFocusIsServedView ? WINDOW_FOCUS_GAIN_REPORT_WITH_SAME_EDITOR
+ : WINDOW_FOCUS_GAIN_REPORT_WITHOUT_EDITOR;
mService.startInputOrWindowGainedFocus(
- StartInputReason.WINDOW_FOCUS_GAIN_REPORT_ONLY, mClient,
+ startInputReason, mClient,
focusedView.getWindowToken(), startInputFlags, softInputMode,
windowFlags,
nextFocusIsServedView ? mCurrentTextBoxAttribute : null,
diff --git a/core/java/com/android/internal/inputmethod/InputMethodDebug.java b/core/java/com/android/internal/inputmethod/InputMethodDebug.java
index a660493f4613..085cdfcf9462 100644
--- a/core/java/com/android/internal/inputmethod/InputMethodDebug.java
+++ b/core/java/com/android/internal/inputmethod/InputMethodDebug.java
@@ -46,8 +46,10 @@ public final class InputMethodDebug {
return "UNSPECIFIED";
case StartInputReason.WINDOW_FOCUS_GAIN:
return "WINDOW_FOCUS_GAIN";
- case StartInputReason.WINDOW_FOCUS_GAIN_REPORT_ONLY:
- return "WINDOW_FOCUS_GAIN_REPORT_ONLY";
+ case StartInputReason.WINDOW_FOCUS_GAIN_REPORT_WITH_SAME_EDITOR:
+ return "WINDOW_FOCUS_GAIN_REPORT_WITH_SAME_EDITOR";
+ case StartInputReason.WINDOW_FOCUS_GAIN_REPORT_WITHOUT_EDITOR:
+ return "WINDOW_FOCUS_GAIN_REPORT_WITHOUT_EDITOR";
case StartInputReason.APP_CALLED_RESTART_INPUT_API:
return "APP_CALLED_RESTART_INPUT_API";
case StartInputReason.CHECK_FOCUS:
diff --git a/core/java/com/android/internal/inputmethod/StartInputReason.java b/core/java/com/android/internal/inputmethod/StartInputReason.java
index a4eaa21538f7..946ce858c12d 100644
--- a/core/java/com/android/internal/inputmethod/StartInputReason.java
+++ b/core/java/com/android/internal/inputmethod/StartInputReason.java
@@ -30,7 +30,8 @@ import java.lang.annotation.Retention;
@IntDef(value = {
StartInputReason.UNSPECIFIED,
StartInputReason.WINDOW_FOCUS_GAIN,
- StartInputReason.WINDOW_FOCUS_GAIN_REPORT_ONLY,
+ StartInputReason.WINDOW_FOCUS_GAIN_REPORT_WITH_SAME_EDITOR,
+ StartInputReason.WINDOW_FOCUS_GAIN_REPORT_WITHOUT_EDITOR,
StartInputReason.APP_CALLED_RESTART_INPUT_API,
StartInputReason.CHECK_FOCUS,
StartInputReason.BOUND_TO_IMMS,
@@ -49,45 +50,50 @@ public @interface StartInputReason {
*/
int WINDOW_FOCUS_GAIN = 1;
/**
+ * {@link android.view.Window} gained focus and the focused view is same as current served
+ * view and its input connection remains. {@link android.view.inputmethod.InputMethodManager}
+ * just reports this window focus change event to sync IME input target for system.
+ */
+ int WINDOW_FOCUS_GAIN_REPORT_WITH_SAME_EDITOR = 2;
+ /**
* {@link android.view.Window} gained focus but there is no {@link android.view.View} that is
- * eligible to have IME focus, or the focused view is same as current served view and its
- * input connection remains. {@link android.view.inputmethod.InputMethodManager} just reports
- * this window focus change event to sync IME input target for system.
+ * eligible to have IME focus. {@link android.view.inputmethod.InputMethodManager} just reports
+ * this window focus change event for logging.
*/
- int WINDOW_FOCUS_GAIN_REPORT_ONLY = 2;
+ int WINDOW_FOCUS_GAIN_REPORT_WITHOUT_EDITOR = 3;
/**
* {@link android.view.inputmethod.InputMethodManager#restartInput(android.view.View)} is
* either explicitly called by the application or indirectly called by some Framework class
* (e.g. {@link android.widget.EditText}).
*/
- int APP_CALLED_RESTART_INPUT_API = 3;
+ int APP_CALLED_RESTART_INPUT_API = 4;
/**
* {@link android.view.View} requested a new connection because of view focus change.
*/
- int CHECK_FOCUS = 4;
+ int CHECK_FOCUS = 5;
/**
* {@link android.view.inputmethod.InputMethodManager} is responding to
* {@link com.android.internal.view.IInputMethodClient#onBindMethod}.
*/
- int BOUND_TO_IMMS = 5;
+ int BOUND_TO_IMMS = 6;
/**
* {@link android.view.inputmethod.InputMethodManager} is responding to
* {@link com.android.internal.view.IInputMethodClient#onUnbindMethod}.
*/
- int UNBOUND_FROM_IMMS = 6;
+ int UNBOUND_FROM_IMMS = 7;
/**
* {@link android.view.inputmethod.InputMethodManager} is responding to
* {@link com.android.internal.view.IInputMethodClient#setActive}.
*/
- int ACTIVATED_BY_IMMS = 7;
+ int ACTIVATED_BY_IMMS = 8;
/**
* {@link android.view.inputmethod.InputMethodManager} is responding to
* {@link com.android.internal.view.IInputMethodClient#setActive}.
*/
- int DEACTIVATED_BY_IMMS = 8;
+ int DEACTIVATED_BY_IMMS = 9;
/**
* {@link com.android.server.inputmethod.InputMethodManagerService} is responding to
* {@link com.android.internal.view.IInputSessionCallback#sessionCreated}.
*/
- int SESSION_CREATED_BY_IME = 9;
+ int SESSION_CREATED_BY_IME = 10;
}