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

Commit ca8d1e06 authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz Committed by Android Build Coastguard Worker
Browse files

[SwipeHelper] remove not swiped out notification from swiped out list

It is expected that Swiped out view is moved to transientview first and after that swipe out animation runs. However, this animation is not part of NSSL animations and it runs independently.
This animation starts before NSSL removes this notification and get cancelled due to some updates. In this edge case, this view is moved to transientview and remain on the shade.

This CL removes this notification from swiped out list when it is not swiped out and leaves removal responsibility to NSSL.

Fixes: 415279408
Test: Post  a notification with notify with delay and have many updates. During updates try to swipe out quickly.
Flag: EXEMPT bug fix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:47128c21e45aa2c0a22520bf1b8bbdf9ce907785)
Merged-In: I18a8b95501fd93f41571dd71ba5a20ab24a87c9c
Change-Id: I18a8b95501fd93f41571dd71ba5a20ab24a87c9c
parent 9b6f29f7
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -6062,6 +6062,18 @@ public class NotificationStackScrollLayout
        }
    }

    void removeSwipedOutView(View v) {
        logRemoveSwipedOutView(v);
        mSwipedOutViews.remove(v);
    }

    private void logRemoveSwipedOutView(View v) {
        if (mLogger != null && v instanceof ExpandableNotificationRow row) {
            mLogger.logRemoveSwipedOutView(row.getLoggingKey(), mClearAllInProgress);
        }
    }


    void onSwipeBegin(View viewSwiped) {
        if (!(viewSwiped instanceof ExpandableNotificationRow)) {
            return;
+3 −0
Original line number Diff line number Diff line
@@ -711,6 +711,9 @@ public class NotificationStackScrollLayoutController implements Dumpable {
                public void onChildNotDismissed(View v, boolean animationCancelled,
                        boolean viewWasRemoved) {
                    logOnChildNotDismissed(v, animationCancelled, viewWasRemoved);
                    if (!viewWasRemoved) {
                        mView.removeSwipedOutView(v);
                    }
                }

                private void logOnChildNotDismissed(View v, boolean animationCancelled,
+12 −0
Original line number Diff line number Diff line
@@ -246,6 +246,18 @@ constructor(
        )
    }

    fun logRemoveSwipedOutView(loggingKey: String, clearAllInProgress: Boolean) {
        notificationRenderBuffer.log(
            TAG,
            INFO,
            {
                str1 = loggingKey
                bool1 = clearAllInProgress
            },
            { "removeSwipedOutView from NSSL: childKey = $str1 -- clearAllInProgress:$bool1" },
        )
    }

    fun logOnChildDismissed(loggingKey: String, clearAllInProgress: Boolean) {
        notificationRenderBuffer.log(
            TAG,