Correctly count message events for notification heuristic.

This commit is contained in:
Clark Chen
2024-01-18 14:45:58 -05:00
committed by Greyson Parrelli
parent 5b7eb9c332
commit e4b755ced8

View File

@@ -176,7 +176,7 @@ object SlowNotificationHeuristics {
Log.d(TAG, "insufficient data for message latency")
return false
}
val eventCount = metrics.count { it.name == SignalLocalMetrics.MessageLatency.NAME_HIGH }
val eventCount = metrics.find { it.name == SignalLocalMetrics.MessageLatency.NAME_HIGH }?.count ?: 0
if (eventCount < messageThreshold) {
Log.d(TAG, "not enough messages for message latency")
return false