From 0e2acaf0a58e7c8a2abe916e18f7c7b281803ccd Mon Sep 17 00:00:00 2001 From: Evan Laird Date: Tue, 26 May 2020 17:47:30 -0400 Subject: [PATCH] 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 --- .../systemui/statusbar/NotificationInteractionTracker.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInteractionTracker.kt b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInteractionTracker.kt index 40a3ed64f2c2e..d140e342960eb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInteractionTracker.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInteractionTracker.kt @@ -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