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

Commit 1e9e29ff authored by Julia Tuttle's avatar Julia Tuttle Committed by Automerger Merge Worker
Browse files

Merge "Demote tryRemoveNotification crash to Log.wtf" into udc-qpr-dev am:...

Merge "Demote tryRemoveNotification crash to Log.wtf" into udc-qpr-dev am: 98abc65d am: 87db9c5d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23600134



Change-Id: I4f3d9e0ad15e075ef698f8f170887ab2992560ad
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b702f7c7 87db9c5d
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ import android.service.notification.NotificationListenerService.Ranking;
import android.service.notification.NotificationListenerService.RankingMap;
import android.service.notification.StatusBarNotification;
import android.util.ArrayMap;
import android.util.Log;
import android.util.Pair;

import androidx.annotation.NonNull;
@@ -513,10 +514,16 @@ public class NotifCollection implements Dumpable, PipelineDumpable {
     * @return True if the notification was removed, false otherwise.
     */
    private boolean tryRemoveNotification(NotificationEntry entry) {
        if (mNotificationSet.get(entry.getKey()) != entry) {
        final NotificationEntry storedEntry = mNotificationSet.get(entry.getKey());
        if (storedEntry == null) {
            Log.wtf(TAG, "TRY REMOVE non-existent notification " + logKey(entry));
            return false;
        } else if (storedEntry != entry) {
            throw mEulogizer.record(
                    new IllegalStateException("No notification to remove with key "
                            + logKey(entry)));
                    new IllegalStateException("Mismatched stored and tryRemoved entries"
                            + " for key " + logKey(entry) + ":"
                            + " stored=@" + Integer.toHexString(storedEntry.hashCode())
                            + " tryRemoved=@" + Integer.toHexString(entry.hashCode())));
        }

        if (!entry.isCanceled()) {