summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorMing-Shin Lu <lumark@google.com>2020-11-04 02:06:01 +0800
committerMing-Shin Lu <lumark@google.com>2021-03-01 23:41:22 +0800
commite99a1b491d170ffe000315a37ebc577106a1bd8a (patch)
tree3d07a4c6c31812558cab6f7e88de841a776777bf /core/java/android
parent5f630223cc91a813a8b35cded57513274b20932d (diff)
Restore the last IME visiblity of the app window when allowed
Since when bring an existing app task to foreground or quick switching app task with gesture navigation will first see the task snapshot during app transition, If the task previously focused and shown IME, even the task may hide IME when switching to the next task, As the goal of go/ime-transition-improve-s mentioned, if the task is still focused by editor, we should keep the original focused IME shown and keep the input connection focused state when navigating back to the original task. Bug: 166736352 Test: atest CtsInputMethodTestcases Test: manual by focusing app with an editor to show keyboard, switch the app task to the next with gesture nav and then switched back, expected the soft-keyboard is still shown. Change-Id: I63b144bed6c37569d79fba1c2b63dd4f1074f0f6
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/ImeFocusController.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/java/android/view/ImeFocusController.java b/core/java/android/view/ImeFocusController.java
index 4a5c95f43d46..d23a1e5992cc 100644
--- a/core/java/android/view/ImeFocusController.java
+++ b/core/java/android/view/ImeFocusController.java
@@ -116,8 +116,9 @@ public final class ImeFocusController {
if (!hasWindowFocus || !mHasImeFocus || isInLocalFocusMode(windowAttribute)) {
return;
}
+ View viewForWindowFocus = focusedView != null ? focusedView : mViewRootImpl.mView;
if (DEBUG) {
- Log.v(TAG, "onWindowFocus: " + focusedView
+ Log.v(TAG, "onWindowFocus: " + viewForWindowFocus
+ " softInputMode=" + InputMethodDebug.softInputModeToString(
windowAttribute.softInputMode));
}
@@ -128,8 +129,8 @@ public final class ImeFocusController {
if (DEBUG) Log.v(TAG, "Restarting due to isRestartOnNextWindowFocus as true");
forceFocus = true;
}
+
// Update mNextServedView when focusedView changed.
- final View viewForWindowFocus = focusedView != null ? focusedView : mViewRootImpl.mView;
onViewFocusChanged(viewForWindowFocus, true);
// Starting new input when the next focused view is same as served view but the currently