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

Commit ea9abd14 authored by Chris Wren's avatar Chris Wren Committed by Android Git Automerger
Browse files

am 0c5ec0e0: Merge "Avoid race condition in heads up snooze code path." into lmp-mr1-dev

* commit '0c5ec0e0':
  Avoid race condition in heads up snooze code path.
parents 41b0cbb3 0c5ec0e0
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ public class HeadsUpNotificationView extends FrameLayout implements SwipeHelper.

    private NotificationData.Entry mHeadsUp;
    private int mUser;
    private String mMostRecentPackageName;

    public HeadsUpNotificationView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
@@ -117,6 +118,7 @@ public class HeadsUpNotificationView extends FrameLayout implements SwipeHelper.
        }

        if (mHeadsUp != null) {
            mMostRecentPackageName = mHeadsUp.notification.getPackageName();
            mHeadsUp.row.setSystemExpanded(true);
            mHeadsUp.row.setSensitive(false);
            mHeadsUp.row.setHeadsUp(true);
@@ -198,8 +200,10 @@ public class HeadsUpNotificationView extends FrameLayout implements SwipeHelper.
    }

    private void snooze() {
        mSnoozedPackages.put(snoozeKey(mHeadsUp.notification.getPackageName(), mUser),
        if (mMostRecentPackageName != null) {
            mSnoozedPackages.put(snoozeKey(mMostRecentPackageName, mUser),
                    SystemClock.elapsedRealtime() + mSnoozeLengthMs);
        }
        releaseAndClose();
    }