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

Commit 774d763d authored by lyn's avatar lyn
Browse files

Return early if there are no entries to remove

Bug: 354031627
Test: treehugger
Flag: com.android.systemui.notification_avalanche_throttle_hun
Change-Id: I4d20f1959aa27c436a1c5d2326bc8694abf889d4
parent e49f5aba
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -389,10 +389,13 @@ public class HeadsUpManagerPhone extends BaseHeadsUpManager implements
    //  OnReorderingAllowedListener:

    private final OnReorderingAllowedListener mOnReorderingAllowedListener = () -> {
        mAnimationStateHandler.setHeadsUpGoingAwayAnimationsAllowed(false);
        if (NotificationThrottleHun.isEnabled()) {
            mAvalancheController.setEnableAtRuntime(true);
            if (mEntriesToRemoveWhenReorderingAllowed.isEmpty()) {
                return;
            }
        }
        mAnimationStateHandler.setHeadsUpGoingAwayAnimationsAllowed(false);
        for (NotificationEntry entry : mEntriesToRemoveWhenReorderingAllowed) {
            if (isHeadsUpEntry(entry.getKey())) {
                // Maybe the heads-up was removed already