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

Commit a92974f4 authored by Adrian Roos's avatar Adrian Roos Committed by The Android Automerger
Browse files

Fix DirectReply bug when reapply fails

RemoteInputView failed to notice updates where the
reapply failed, causing it to reopen upon success.

Change-Id: I4fdd4d3240da6e38878d281fbf8c654ee9a682c3
Fixes: 29057180
parent 26c00cb9
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -277,15 +277,25 @@ public class NotificationContentView extends FrameLayout {
            mContractedChild.animate().cancel();
            removeView(mContractedChild);
        }
        mPreviousExpandedRemoteInputIntent =
                mExpandedRemoteInput != null ? mExpandedRemoteInput.getPendingIntent() : null;
        mPreviousExpandedRemoteInputIntent = null;
        if (mExpandedRemoteInput != null) {
            mExpandedRemoteInput.onNotificationUpdateOrReset();
            if (mExpandedRemoteInput.isActive()) {
                mPreviousExpandedRemoteInputIntent = mExpandedRemoteInput.getPendingIntent();
            }
        }
        if (mExpandedChild != null) {
            mExpandedChild.animate().cancel();
            removeView(mExpandedChild);
            mExpandedRemoteInput = null;
        }
        mPreviousHeadsUpRemoteInputIntent =
                mHeadsUpRemoteInput != null ? mHeadsUpRemoteInput.getPendingIntent() : null;
        mPreviousHeadsUpRemoteInputIntent = null;
        if (mHeadsUpRemoteInput != null) {
            mHeadsUpRemoteInput.onNotificationUpdateOrReset();
            if (mHeadsUpRemoteInput.isActive()) {
                mPreviousHeadsUpRemoteInputIntent = mHeadsUpRemoteInput.getPendingIntent();
            }
        }
        if (mHeadsUpChild != null) {
            mHeadsUpChild.animate().cancel();
            removeView(mHeadsUpChild);
@@ -908,7 +918,7 @@ public class NotificationContentView extends FrameLayout {
                    view.findViewWithTag(RemoteInputView.VIEW_TAG);

            if (existing != null) {
                existing.onNotificationUpdate();
                existing.onNotificationUpdateOrReset();
            }

            if (existing == null && hasRemoteInput) {
+1 −1
Original line number Diff line number Diff line
@@ -227,7 +227,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
        updateSendButton();
    }

    public void onNotificationUpdate() {
    public void onNotificationUpdateOrReset() {
        boolean sending = mProgressBar.getVisibility() == VISIBLE;

        if (sending) {