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

Commit 53bbc534 authored by Louis Chang's avatar Louis Chang Committed by android-build-merger
Browse files

Merge "Unregister ImeInsetsSourceConsumer when focus lost" into qt-dev am: c1a0fbce

am: 27105fb7

Change-Id: I84c69694d53194fc8679a1eb97f251ec7bd607db
parents 9f058f9c 27105fb7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ public final class ImeInsetsSourceConsumer extends InsetsSourceConsumer {
    @Override
    public void onWindowFocusLost() {
        mHasWindowFocus = false;
        getImm().unregisterImeConsumer(this);
    }

    /**
+17 −0
Original line number Diff line number Diff line
@@ -1950,6 +1950,23 @@ public final class InputMethodManager {
        }
    }

    /**
     * Unregister for IME state callbacks and applying visibility in
     * {@link android.view.ImeInsetsSourceConsumer}.
     * @hide
     */
    public void unregisterImeConsumer(@NonNull ImeInsetsSourceConsumer imeInsetsConsumer) {
        if (imeInsetsConsumer == null) {
            throw new IllegalStateException("ImeInsetsSourceConsumer cannot be null.");
        }

        synchronized (mH) {
            if (mImeInsetsConsumer == imeInsetsConsumer) {
                mImeInsetsConsumer = null;
            }
        }
    }

    /**
     * Call showSoftInput with currently focused view.
     * @return {@code true} if IME can be shown.