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

Commit 5a1680de authored by Ned Burns's avatar Ned Burns Committed by Android (Google) Code Review
Browse files

Merge "Log a warning whenever we get an incomplete ranking map"

parents bc084d53 8cd2f1d3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -326,6 +326,8 @@ public class NotifCollection implements Dumpable {
                            entry.getSbn().setOverrideGroupKey(newOverrideGroupKey);
                        }
                    }
                } else {
                    mLogger.logRankingMissing(entry.getKey(), rankingMap);
                }
            }
        }
+16 −5
Original line number Diff line number Diff line
@@ -16,8 +16,11 @@

package com.android.systemui.statusbar.notification.collection.notifcollection

import android.service.notification.NotificationListenerService.RankingMap
import com.android.systemui.log.LogBuffer
import com.android.systemui.log.LogLevel
import com.android.systemui.log.LogLevel.DEBUG
import com.android.systemui.log.LogLevel.INFO
import com.android.systemui.log.LogLevel.WARNING
import com.android.systemui.log.dagger.NotificationLog
import javax.inject.Inject

@@ -25,7 +28,7 @@ class NotifCollectionLogger @Inject constructor(
    @NotificationLog private val buffer: LogBuffer
) {
    fun logNotifPosted(key: String) {
        buffer.log(TAG, LogLevel.INFO, {
        buffer.log(TAG, INFO, {
            str1 = key
        }, {
            "POSTED $str1"
@@ -33,7 +36,7 @@ class NotifCollectionLogger @Inject constructor(
    }

    fun logNotifGroupPosted(groupKey: String, batchSize: Int) {
        buffer.log(TAG, LogLevel.INFO, {
        buffer.log(TAG, INFO, {
            str1 = groupKey
            int1 = batchSize
        }, {
@@ -42,7 +45,7 @@ class NotifCollectionLogger @Inject constructor(
    }

    fun logNotifUpdated(key: String) {
        buffer.log(TAG, LogLevel.INFO, {
        buffer.log(TAG, INFO, {
            str1 = key
        }, {
            "UPDATED $str1"
@@ -50,13 +53,21 @@ class NotifCollectionLogger @Inject constructor(
    }

    fun logNotifRemoved(key: String, reason: Int) {
        buffer.log(TAG, LogLevel.INFO, {
        buffer.log(TAG, INFO, {
            str1 = key
            int1 = reason
        }, {
            "REMOVED $str1 reason=$int1"
        })
    }

    fun logRankingMissing(key: String, rankingMap: RankingMap) {
        buffer.log(TAG, WARNING, { str1 = key }, { "Ranking update is missing ranking for $str1" })
        buffer.log(TAG, DEBUG, {}, { "Ranking map contents:" })
        for (entry in rankingMap.orderedKeys) {
            buffer.log(TAG, DEBUG, { str1 = entry }, { "  $str1" })
        }
    }
}

private const val TAG = "NotifCollection"
 No newline at end of file