Merge changes Id9f50e84,I4d7f0497 into tm-qpr-dev
* changes: Improve logging in NotifCollection for when ending the LifetimeExtender fails or might fail. Improve dumps/logs to diagnose mis-ordered group children
This commit is contained in:
@@ -121,6 +121,12 @@ public class ListDumper {
|
|||||||
sb.append(" (parent=")
|
sb.append(" (parent=")
|
||||||
.append(entry.getParent() != null ? entry.getParent().getKey() : null)
|
.append(entry.getParent() != null ? entry.getParent().getKey() : null)
|
||||||
.append(")");
|
.append(")");
|
||||||
|
|
||||||
|
NotificationEntry notifEntry = entry.getRepresentativeEntry();
|
||||||
|
if (notifEntry != null) {
|
||||||
|
sb.append(" rank=")
|
||||||
|
.append(notifEntry.getRanking().getRank());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry.getSection() != null) {
|
if (entry.getSection() != null) {
|
||||||
|
|||||||
@@ -609,12 +609,21 @@ public class NotifCollection implements Dumpable {
|
|||||||
}
|
}
|
||||||
checkForReentrantCall();
|
checkForReentrantCall();
|
||||||
|
|
||||||
|
NotificationEntry collectionEntry = getEntry(entry.getKey());
|
||||||
|
String logKey = logKey(entry);
|
||||||
|
String collectionEntryIs = collectionEntry == null ? "null"
|
||||||
|
: entry == collectionEntry ? "same" : "different";
|
||||||
|
|
||||||
|
if (entry != collectionEntry) {
|
||||||
|
// TODO: We should probably make this throw, but that's too risky right now
|
||||||
|
mLogger.logEntryBeingExtendedNotInCollection(entry, extender, collectionEntryIs);
|
||||||
|
}
|
||||||
|
|
||||||
if (!entry.mLifetimeExtenders.remove(extender)) {
|
if (!entry.mLifetimeExtenders.remove(extender)) {
|
||||||
throw mEulogizer.record(new IllegalStateException(
|
throw mEulogizer.record(new IllegalStateException(
|
||||||
String.format(
|
String.format("Cannot end lifetime extension for extender \"%s\""
|
||||||
"Cannot end lifetime extension for extender \"%s\" (%s)",
|
+ " of entry %s (collection entry is %s)",
|
||||||
extender.getName(),
|
extender.getName(), logKey, collectionEntryIs)));
|
||||||
extender)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mLogger.logLifetimeExtensionEnded(
|
mLogger.logLifetimeExtensionEnded(
|
||||||
|
|||||||
@@ -25,12 +25,9 @@ data class NotifSection(
|
|||||||
val sectioner: NotifSectioner,
|
val sectioner: NotifSectioner,
|
||||||
val index: Int
|
val index: Int
|
||||||
) {
|
) {
|
||||||
val label: String
|
@PriorityBucket
|
||||||
get() = "Section($index, $bucket, \"${sectioner.name}\")"
|
val bucket: Int = sectioner.bucket
|
||||||
|
val label: String = "$index:$bucket:${sectioner.name}"
|
||||||
val headerController: NodeController? = sectioner.headerNodeController
|
val headerController: NodeController? = sectioner.headerNodeController
|
||||||
|
|
||||||
val comparator: NotifComparator? = sectioner.comparator
|
val comparator: NotifComparator? = sectioner.comparator
|
||||||
|
|
||||||
@PriorityBucket val bucket: Int = sectioner.bucket
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -248,6 +248,20 @@ class NotifCollectionLogger @Inject constructor(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun logEntryBeingExtendedNotInCollection(
|
||||||
|
entry: NotificationEntry,
|
||||||
|
extender: NotifLifetimeExtender,
|
||||||
|
collectionEntryIs: String
|
||||||
|
) {
|
||||||
|
buffer.log(TAG, WARNING, {
|
||||||
|
str1 = entry.logKey
|
||||||
|
str2 = extender.name
|
||||||
|
str3 = collectionEntryIs
|
||||||
|
}, {
|
||||||
|
"While ending lifetime extension by $str2 of $str1, entry in collection is $str3"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
fun logFutureDismissalReused(dismissal: FutureDismissal) {
|
fun logFutureDismissalReused(dismissal: FutureDismissal) {
|
||||||
buffer.log(TAG, INFO, {
|
buffer.log(TAG, INFO, {
|
||||||
str1 = dismissal.label
|
str1 = dismissal.label
|
||||||
|
|||||||
Reference in New Issue
Block a user