summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2022-07-19 03:10:45 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-07-19 03:10:45 +0000
commita4f1d0640407170ace1ca00450cd38393389316e (patch)
tree9c6939edf3f1cd3fd4315df874f74fe8f5a4d0b9 /services
parent945dbc0427f1bb1c1e7adbc750a6fa32675815eb (diff)
parent22fa71566209a1a27dc92e7bb04c1c8f015f081c (diff)
Merge "Fix not hiding soft-input when quick switch start" into tm-qpr-dev
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/wm/InputMonitor.java27
-rw-r--r--services/core/java/com/android/server/wm/RecentsAnimationController.java21
-rw-r--r--services/core/java/com/android/server/wm/Transition.java22
3 files changed, 25 insertions, 45 deletions
diff --git a/services/core/java/com/android/server/wm/InputMonitor.java b/services/core/java/com/android/server/wm/InputMonitor.java
index 8389dbde3e14..2ce333d5438b 100644
--- a/services/core/java/com/android/server/wm/InputMonitor.java
+++ b/services/core/java/com/android/server/wm/InputMonitor.java
@@ -64,7 +64,10 @@ import android.view.SurfaceControl;
import android.view.WindowManager;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.inputmethod.SoftInputShowHideReason;
import com.android.internal.protolog.common.ProtoLog;
+import com.android.server.LocalServices;
+import com.android.server.inputmethod.InputMethodManagerInternal;
import java.io.PrintWriter;
import java.lang.ref.WeakReference;
@@ -405,8 +408,28 @@ final class InputMonitor {
// Shell transitions doesn't use RecentsAnimationController
|| getWeak(mActiveRecentsActivity) != null && focus.inTransition();
if (shouldApplyRecentsInputConsumer) {
- requestFocus(recentsAnimationInputConsumer.mWindowHandle.token,
- recentsAnimationInputConsumer.mName);
+ if (mInputFocus != recentsAnimationInputConsumer.mWindowHandle.token) {
+ requestFocus(recentsAnimationInputConsumer.mWindowHandle.token,
+ recentsAnimationInputConsumer.mName);
+ // Hiding IME/IME icon when recents input consumer gain focus.
+ if (!mDisplayContent.isImeAttachedToApp()) {
+ // Hiding IME if IME window is not attached to app since it's not proper to
+ // snapshot Task with IME window to animate together in this case.
+ final InputMethodManagerInternal inputMethodManagerInternal =
+ LocalServices.getService(InputMethodManagerInternal.class);
+ if (inputMethodManagerInternal != null) {
+ inputMethodManagerInternal.hideCurrentInputMethod(
+ SoftInputShowHideReason.HIDE_RECENTS_ANIMATION);
+ }
+ } else {
+ // Disable IME icon explicitly when IME attached to the app in case
+ // IME icon might flickering while swiping to the next app task still
+ // in animating before the next app window focused, or IME icon
+ // persists on the bottom when swiping the task to recents.
+ InputMethodManagerInternal.get().updateImeWindowStatus(
+ true /* disableImeIcon */);
+ }
+ }
return;
}
}
diff --git a/services/core/java/com/android/server/wm/RecentsAnimationController.java b/services/core/java/com/android/server/wm/RecentsAnimationController.java
index e8a63d453004..08bf7bca93c4 100644
--- a/services/core/java/com/android/server/wm/RecentsAnimationController.java
+++ b/services/core/java/com/android/server/wm/RecentsAnimationController.java
@@ -70,7 +70,6 @@ import android.window.PictureInPictureSurfaceTransaction;
import android.window.TaskSnapshot;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.inputmethod.SoftInputShowHideReason;
import com.android.internal.protolog.common.ProtoLog;
import com.android.internal.util.function.pooled.PooledConsumer;
import com.android.internal.util.function.pooled.PooledLambda;
@@ -326,26 +325,6 @@ public class RecentsAnimationController implements DeathRecipient {
}
}
InputMethodManagerInternal.get().maybeFinishStylusHandwriting();
- if (!behindSystemBars) {
- // Hiding IME if IME window is not attached to app.
- // Since some windowing mode is not proper to snapshot Task with IME window
- // while the app transitioning to the next task (e.g. split-screen mode)
- if (!mDisplayContent.isImeAttachedToApp()) {
- final InputMethodManagerInternal inputMethodManagerInternal =
- LocalServices.getService(InputMethodManagerInternal.class);
- if (inputMethodManagerInternal != null) {
- inputMethodManagerInternal.hideCurrentInputMethod(
- SoftInputShowHideReason.HIDE_RECENTS_ANIMATION);
- }
- } else {
- // Disable IME icon explicitly when IME attached to the app in case
- // IME icon might flickering while swiping to the next app task still
- // in animating before the next app window focused, or IME icon
- // persists on the bottom when swiping the task to recents.
- InputMethodManagerInternal.get().updateImeWindowStatus(
- true /* disableImeIcon */);
- }
- }
mService.mWindowPlacerLocked.requestTraversal();
}
} finally {
diff --git a/services/core/java/com/android/server/wm/Transition.java b/services/core/java/com/android/server/wm/Transition.java
index 5ad5a55bf6db..91f69a55d400 100644
--- a/services/core/java/com/android/server/wm/Transition.java
+++ b/services/core/java/com/android/server/wm/Transition.java
@@ -85,11 +85,9 @@ import android.window.TransitionInfo;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.graphics.ColorUtils;
-import com.android.internal.inputmethod.SoftInputShowHideReason;
import com.android.internal.protolog.ProtoLogGroup;
import com.android.internal.protolog.common.ProtoLog;
import com.android.internal.util.function.pooled.PooledLambda;
-import com.android.server.LocalServices;
import com.android.server.inputmethod.InputMethodManagerInternal;
import java.lang.annotation.Retention;
@@ -959,26 +957,6 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
}
}
- // Hiding IME/IME icon when starting quick-step with resents animation.
- if (!mTargetDisplays.get(mRecentsDisplayId).isImeAttachedToApp()) {
- // Hiding IME if IME window is not attached to app.
- // Since some windowing mode is not proper to snapshot Task with IME window
- // while the app transitioning to the next task (e.g. split-screen mode)
- final InputMethodManagerInternal inputMethodManagerInternal =
- LocalServices.getService(InputMethodManagerInternal.class);
- if (inputMethodManagerInternal != null) {
- inputMethodManagerInternal.hideCurrentInputMethod(
- SoftInputShowHideReason.HIDE_RECENTS_ANIMATION);
- }
- } else {
- // Disable IME icon explicitly when IME attached to the app in case
- // IME icon might flickering while swiping to the next app task still
- // in animating before the next app window focused, or IME icon
- // persists on the bottom when swiping the task to recents.
- InputMethodManagerInternal.get().updateImeWindowStatus(
- true /* disableImeIcon */);
- }
-
// The rest of this function handles nav-bar reparenting
if (!dc.getDisplayPolicy().shouldAttachNavBarToAppDuringTransition()