summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Felix Stern <fstern@google.com> 2024-12-09 09:35:42 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-12-09 09:35:42 +0000
commit680fbc119daaae6501b28bc1c1362bde049de32f (patch)
tree78d06741b3fc8b4e436660a93ae2fee40cb9c9eb
parent12a4a857eefc44c79347ef5a8e17a8ad807bd5d9 (diff)
parent0d1d1c3515c775554982cb79edacd53be065d95f (diff)
Merge "Update layout position in SplitLayout (hide IME) without imeLayeringTarget" into main
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java11
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java17
2 files changed, 22 insertions, 6 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java
index ec3c0b83fe2d..5129d83cdd8b 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java
@@ -414,9 +414,14 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged
// already (e.g., when focussing an editText in activity B, while and editText in
// activity A is focussed), we will not get a call of #insetsControlChanged, and
// therefore have to start the show animation from here
- startAnimation(mImeRequestedVisible /* show */, false /* forceRestart */);
-
- setVisibleDirectly(mImeRequestedVisible || mAnimation != null, statsToken);
+ startAnimation(mImeRequestedVisible /* show */, false /* forceRestart */,
+ statsToken);
+
+ // In case of a hide, the statsToken should not been send yet (as the animation
+ // is still ongoing). It will be sent at the end of the animation
+ boolean hideAnimOngoing = !mImeRequestedVisible && mAnimation != null;
+ setVisibleDirectly(mImeRequestedVisible || mAnimation != null,
+ hideAnimOngoing ? null : statsToken);
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java
index 1852cda7e804..e6b6ef737f6e 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java
@@ -1560,7 +1560,9 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
final int imeTargetPosition = getImeTargetPosition();
mHasImeFocus = imeTargetPosition != SPLIT_POSITION_UNDEFINED;
if (!mHasImeFocus) {
- return 0;
+ if (!android.view.inputmethod.Flags.refactorInsetsController() || showing) {
+ return 0;
+ }
}
mStartImeTop = showing ? hiddenTop : shownTop;
@@ -1613,7 +1615,11 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
@Override
public void onImePositionChanged(int displayId, int imeTop, SurfaceControl.Transaction t) {
- if (displayId != mDisplayId || !mHasImeFocus) return;
+ if (displayId != mDisplayId || !mHasImeFocus) {
+ if (!android.view.inputmethod.Flags.refactorInsetsController() || mImeShown) {
+ return;
+ }
+ }
onProgress(getProgress(imeTop));
mSplitLayoutHandler.onLayoutPositionChanging(SplitLayout.this);
}
@@ -1621,7 +1627,12 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
@Override
public void onImeEndPositioning(int displayId, boolean cancel,
SurfaceControl.Transaction t) {
- if (displayId != mDisplayId || !mHasImeFocus || cancel) return;
+ if (displayId != mDisplayId || cancel) return;
+ if (!mHasImeFocus) {
+ if (!android.view.inputmethod.Flags.refactorInsetsController() || mImeShown) {
+ return;
+ }
+ }
ProtoLog.v(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN,
"Split IME animation ending, canceled=%b", cancel);
onProgress(1.0f);