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

Commit f768ea53 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

When no IME target, use empty control target

...such that IME doesn't show up if there is no target. It would
show because we don't attach it to a leash.

Test: Open any app while IME was previously open
Bug: 111084606
Change-Id: I1d99af44157244538f9ba95ba8daf6576a851e19
parent b29730fc
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();
    }