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

Commit 59e81a0b authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge "When no IME target, use empty control target"

parents 9964f40c f768ea53
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -60,6 +60,8 @@ class InsetsStateController {
            w.notifyInsetsChanged();
        }
    };
    private final InsetsControlTarget mEmptyImeControlTarget = () -> {
    };

    InsetsStateController(DisplayContent displayContent) {
        mDisplayContent = displayContent;
@@ -182,7 +184,10 @@ class InsetsStateController {
    }

    void onImeControlTargetChanged(@Nullable InsetsControlTarget imeTarget) {
        onControlChanged(ITYPE_IME, imeTarget);

        // Make sure that we always have a control target for the IME, even if the IME target is
        // null. Otherwise there is no leash that will hide it and IME becomes "randomly" visible.
        onControlChanged(ITYPE_IME, imeTarget != null ? imeTarget : mEmptyImeControlTarget);
        notifyPendingInsetsControlChanged();
    }