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

Commit ab7054f4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Use inputtarget to check for insets controller" into rvc-dev am: 8b110570 am: afeb2f4d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12110854

Change-Id: I9aef570358866f8495c1c0abc3cb7de7be0e1ea0
parents 440fe46e afeb2f4d
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -193,10 +193,11 @@ public class Divider extends SystemUI implements DividerView.DividerCallbacks,

            @Override
            public void onKeyguardShowingChanged() {
                if (!isDividerVisible() || mView == null) {
                if (!isSplitActive() || mView == null) {
                    return;
                }
                mView.setHidden(mKeyguardStateController.isShowing());
                mImePositionProcessor.updateAdjustForIme();
            }

            @Override
@@ -285,8 +286,9 @@ public class Divider extends SystemUI implements DividerView.DividerCallbacks,
     * while this only cares if some things are (eg. while entering/exiting as well).
     */
    private boolean isSplitActive() {
        return mSplits.mPrimary.topActivityType != ACTIVITY_TYPE_UNDEFINED
                || mSplits.mSecondary.topActivityType != ACTIVITY_TYPE_UNDEFINED;
        return mSplits.mPrimary != null && mSplits.mSecondary != null
                && (mSplits.mPrimary.topActivityType != ACTIVITY_TYPE_UNDEFINED
                        || mSplits.mSecondary.topActivityType != ACTIVITY_TYPE_UNDEFINED);
    }

    private void addDivider(Configuration configuration) {
+13 −1
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@ class DividerImeController implements DisplayImeController.ImePositionProcessor

    private boolean mPaused = true;
    private boolean mPausedTargetAdjusted = false;
    private boolean mAdjustedWhileHidden = false;

    DividerImeController(SplitScreenTaskOrganizer splits, TransactionPool pool, Handler handler) {
        mSplits = splits;
@@ -170,11 +171,17 @@ class DividerImeController implements DisplayImeController.ImePositionProcessor
            // If split is hidden, we don't want to trigger any relayouts that would cause the
            // divider to show again.
            updateImeAdjustState();
        } else {
            mAdjustedWhileHidden = true;
        }
    }

    private void updateImeAdjustState() {
        if (mAdjusted != mTargetAdjusted) {
        updateImeAdjustState(false /* force */);
    }

    private void updateImeAdjustState(boolean force) {
        if (mAdjusted != mTargetAdjusted || force) {
            // Reposition the server's secondary split position so that it evaluates
            // insets properly.
            WindowContainerTransaction wct = new WindowContainerTransaction();
@@ -231,6 +238,11 @@ class DividerImeController implements DisplayImeController.ImePositionProcessor
        mSplits.mDivider.setAdjustedForIme(mTargetShown && !mPaused);
    }

    public void updateAdjustForIme() {
        updateImeAdjustState(mAdjustedWhileHidden);
        mAdjustedWhileHidden = false;
    }

    @Override
    public void onImePositionChanged(int displayId, int imeTop,
            SurfaceControl.Transaction t) {
+4 −3
Original line number Diff line number Diff line
@@ -273,10 +273,8 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged
            if (imeSource == null || mImeSourceControl == null) {
                return;
            }
            // Set frame, but only if the new frame isn't empty -- this maintains continuity
            final Rect newFrame = imeSource.getFrame();
            mImeFrame.set(newFrame);
            final boolean isFloating = newFrame.height() == 0;
            final boolean isFloating = newFrame.height() == 0 && show;
            if (isFloating) {
                // This is likely a "floating" or "expanded" IME, so to get animations, just
                // pretend the ime has some size just below the screen.
@@ -285,6 +283,9 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged
                        mSystemWindows.mDisplayController.getDisplayLayout(mDisplayId).density()
                                * FLOATING_IME_BOTTOM_INSET);
                mImeFrame.bottom -= floatingInset;
            } else if (newFrame.height() != 0) {
                // Don't set a new frame if it's empty and hiding -- this maintains continuity
                mImeFrame.set(newFrame);
            }
            if (DEBUG) {
                Slog.d(TAG, "Run startAnim  show:" + show + "  was:"
+3 −2
Original line number Diff line number Diff line
@@ -3506,12 +3506,13 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
    }

    private boolean isImeControlledByApp() {
        return mInputMethodTarget != null && !WindowConfiguration.isSplitScreenWindowingMode(
                mInputMethodTarget.getWindowingMode());
        return mInputMethodInputTarget != null && !WindowConfiguration.isSplitScreenWindowingMode(
                        mInputMethodInputTarget.getWindowingMode());
    }

    boolean isImeAttachedToApp() {
        return isImeControlledByApp()
                && mInputMethodTarget != null
                && mInputMethodTarget.mActivityRecord != null
                && mInputMethodTarget.getWindowingMode() == WINDOWING_MODE_FULLSCREEN
                // An activity with override bounds should be letterboxed inside its parent bounds,
+1 −0
Original line number Diff line number Diff line
@@ -858,6 +858,7 @@ public class DisplayContentTests extends WindowTestsBase {
    public void testComputeImeParent_app() throws Exception {
        final DisplayContent dc = createNewDisplay();
        dc.mInputMethodTarget = createWindow(null, TYPE_BASE_APPLICATION, "app");
        dc.mInputMethodInputTarget = dc.mInputMethodTarget;
        assertEquals(dc.mInputMethodTarget.mActivityRecord.getSurfaceControl(),
                dc.computeImeParent());
    }
Loading