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

Commit 614cdd88 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add more logging to NotifCollection" into rvc-dev am: cfaca9bd

Change-Id: I0e677a086b4708241ddee9347c504f5f3f1ac6fd
parents 1ca9bd1c cfaca9bd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -281,6 +281,8 @@ public class NotifCollection implements Dumpable {
        Assert.isMainThread();
        checkForReentrantCall();

        mLogger.logDismissAll(userId);

        try {
            mStatusBarService.onClearAllNotifications(userId);
        } catch (RemoteException e) {
@@ -327,6 +329,7 @@ public class NotifCollection implements Dumpable {
                    for (NotificationEntry otherEntry : mNotificationSet.values()) {
                        if (shouldAutoDismissChildren(otherEntry, entry.getSbn().getGroupKey())) {
                            otherEntry.setDismissState(PARENT_DISMISSED);
                            mLogger.logChildDismissed(otherEntry);
                            if (isCanceled(otherEntry)) {
                                canceledEntries.add(otherEntry);
                            }
@@ -339,6 +342,7 @@ public class NotifCollection implements Dumpable {
        // Immediately remove any dismissed notifs that have already been canceled by system server
        // (probably due to being lifetime-extended up until this point).
        for (NotificationEntry canceledEntry : canceledEntries) {
            mLogger.logDismissOnAlreadyCanceledEntry(canceledEntry);
            tryRemoveNotification(canceledEntry);
        }
    }
@@ -453,6 +457,7 @@ public class NotifCollection implements Dumpable {
        }

        if (!isLifetimeExtended(entry)) {
            mLogger.logNotifReleased(entry.getKey());
            mNotificationSet.remove(entry.getKey());
            cancelDismissInterception(entry);
            mEventQueue.add(new EntryRemovedEvent(entry, entry.mCancellationReason));
+33 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import com.android.systemui.log.LogLevel.INFO
import com.android.systemui.log.LogLevel.WARNING
import com.android.systemui.log.LogLevel.WTF
import com.android.systemui.log.dagger.NotificationLog
import com.android.systemui.statusbar.notification.collection.NotificationEntry
import javax.inject.Inject

class NotifCollectionLogger @Inject constructor(
@@ -63,6 +64,14 @@ class NotifCollectionLogger @Inject constructor(
        })
    }

    fun logNotifReleased(key: String) {
        buffer.log(TAG, INFO, {
            str1 = key
        }, {
            "RELEASED $str1"
        })
    }

    fun logNotifDismissed(key: String) {
        buffer.log(TAG, INFO, {
            str1 = key
@@ -71,6 +80,30 @@ class NotifCollectionLogger @Inject constructor(
        })
    }

    fun logChildDismissed(entry: NotificationEntry) {
        buffer.log(TAG, DEBUG, {
            str1 = entry.key
        }, {
            "CHILD DISMISSED (inferred): $str1"
        })
    }

    fun logDismissAll(userId: Int) {
        buffer.log(TAG, INFO, {
            int1 = userId
        }, {
            "DISMISS ALL notifications for user $int1"
        })
    }

    fun logDismissOnAlreadyCanceledEntry(entry: NotificationEntry) {
        buffer.log(TAG, DEBUG, {
            str1 = entry.key
        }, {
            "Dismiss on $str1, which was already canceled. Trying to remove..."
        })
    }

    fun logNotifDismissedIntercepted(key: String) {
        buffer.log(TAG, INFO, {
            str1 = key