DO NOT MERGE: Fix interaction tracking logic

Tried to put a clever kotlin-ism there, but then the interaction tracker
was returning `true` for every notification because it only checked if
the key existed

Test: manual
Bug: 144324894
Bug: 119041698
Change-Id: Ie2f489acca973c0aebbd8e7d8fc7fbef2bac793f
This commit is contained in:
Evan Laird
2020-05-26 17:47:30 -04:00
parent 6dc0941994
commit 0e2acaf0a5

View File

@@ -23,7 +23,9 @@ class NotificationInteractionTracker @Inject constructor(
entryManager.addNotificationEntryListener(this)
}
fun hasUserInteractedWith(key: String): Boolean = key in interactions
fun hasUserInteractedWith(key: String): Boolean {
return interactions[key] ?: false
}
override fun onNotificationAdded(entry: NotificationEntry) {
interactions[entry.key] = false