From 0dc1bb8302247b9048e3c1a38c5e73e1accf36a1 Mon Sep 17 00:00:00 2001 From: Evan Laird Date: Tue, 26 May 2020 17:47:30 -0400 Subject: [PATCH] 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 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 2ed04eb088a3e..9dbec1037aa5c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInteractionTracker.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInteractionTracker.kt @@ -22,7 +22,9 @@ class NotificationInteractionTracker @Inject constructor( entryManager.addCollectionListener(this) } - fun hasUserInteractedWith(key: String): Boolean = key in interactions + fun hasUserInteractedWith(key: String): Boolean { + return interactions[key] ?: false + } override fun onEntryAdded(entry: NotificationEntry) { interactions[entry.key] = false