Add more logging to NotifCollection

Attempting to track down the cause of b/151317347.

Test: atest
Bug: 112656837
Bug: 151317347
Change-Id: I670c99e11d4a852a258b554a79153a6849e0379e
This commit is contained in:
Ned Burns
2020-05-26 11:09:45 -04:00
parent 77db95ce85
commit 8d36a2a2a3
2 changed files with 38 additions and 0 deletions

View File

@@ -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));

View File

@@ -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