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

Commit 10e834c2 authored by Ming-Shin Lu's avatar Ming-Shin Lu Committed by Automerger Merge Worker
Browse files

Merge "Calling updateImeParent when the layering target is staled" into sc-dev...

Merge "Calling updateImeParent when the layering target is staled" into sc-dev am: cae02ff4 am: e7e61d50

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

Change-Id: Ic78084b8fe616437dc3b2c2aadc8e3d6c6721674
parents 2e11565a e7e61d50
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -3842,7 +3842,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        // 4. Update the IME control target to apply any inset change and animation.
        // 5. Reparent the IME container surface to either the input target app, or the IME window
        // parent.
        updateImeControlTarget();
        updateImeControlTarget(true /* forceUpdateImeParent */);
    }

    @VisibleForTesting
@@ -3974,12 +3974,17 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
    }

    void updateImeControlTarget() {
        updateImeControlTarget(false /* forceUpdateImeParent */);
    }

    void updateImeControlTarget(boolean forceUpdateImeParent) {
        InsetsControlTarget prevImeControlTarget = mImeControlTarget;
        mImeControlTarget = computeImeControlTarget();
        mInsetsStateController.onImeControlTargetChanged(mImeControlTarget);
        // Update Ime parent when IME insets leash created, which is the best time that default
        // IME visibility has been settled down after IME control target changed.
        if (prevImeControlTarget != mImeControlTarget) {
        // Update Ime parent when IME insets leash created or the new IME layering target might
        // updated from setImeLayeringTarget, which is the best time that default IME visibility
        // has been settled down after IME control target changed.
        if (prevImeControlTarget != mImeControlTarget || forceUpdateImeParent) {
            updateImeParent();
        }