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

Commit b13ce85b authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Hide the keyboard when remote input hides.

This fixes a regression introduced by ag/13410424, while preserving the delay introduced by that change.

Bug: 193556445
Test: manual fuzz testing the remote input / keyboard
Change-Id: I4e4cdac0886d21aff63638f05d97b765c36f7ba6
parent bb8ed302
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ public class RemoteInputController {
     */
    public void removeRemoteInput(NotificationEntry entry, Object token) {
        Objects.requireNonNull(entry);
        if (entry.mRemoteEditImeVisible) return;
        if (entry.mRemoteEditImeVisible && entry.mRemoteEditImeAnimatingAway) return;
        // If the view is being removed, this may be called even though we're not active
        if (!isRemoteInputActive(entry)) return;

+1 −0
Original line number Diff line number Diff line
@@ -183,6 +183,7 @@ public final class NotificationEntry extends ListEntry {
    private boolean mIsMarkedForUserTriggeredMovement;
    private boolean mIsAlerting;

    public boolean mRemoteEditImeAnimatingAway;
    public boolean mRemoteEditImeVisible;
    private boolean mExpandAnimationRunning;

+2 −0
Original line number Diff line number Diff line
@@ -272,6 +272,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
            public void onEnd(@NonNull WindowInsetsAnimation animation) {
                super.onEnd(animation);
                if (animation.getTypeMask() == WindowInsets.Type.ime()) {
                    mEntry.mRemoteEditImeAnimatingAway = false;
                    mEntry.mRemoteEditImeVisible =
                            mEditText.getRootWindowInsets().isVisible(WindowInsets.Type.ime());
                    if (!mEntry.mRemoteEditImeVisible && !mEditText.mShowImeOnInputConnection) {
@@ -392,6 +393,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
        mSendButton.setVisibility(INVISIBLE);
        mProgressBar.setVisibility(VISIBLE);
        mEntry.lastRemoteInputSent = SystemClock.elapsedRealtime();
        mEntry.mRemoteEditImeAnimatingAway = true;
        mController.addSpinning(mEntry.getKey(), mToken);
        mController.removeRemoteInput(mEntry, mToken);
        mEditText.mShowImeOnInputConnection = false;