Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 680fbc11 authored by Felix Stern's avatar Felix Stern Committed by Android (Google) Code Review
Browse files

Merge "Update layout position in SplitLayout (hide IME) without imeLayeringTarget" into main

parents 12a4a857 0d1d1c35
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -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);
            }
        }

+14 −3
Original line number Diff line number Diff line
@@ -1560,8 +1560,10 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
            final int imeTargetPosition = getImeTargetPosition();
            mHasImeFocus = imeTargetPosition != SPLIT_POSITION_UNDEFINED;
            if (!mHasImeFocus) {
                if (!android.view.inputmethod.Flags.refactorInsetsController() || showing) {
                    return 0;
                }
            }

            mStartImeTop = showing ? hiddenTop : shownTop;
            mEndImeTop = showing ? shownTop : hiddenTop;
@@ -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);