summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lyn <lynhan@google.com> 2024-04-10 21:57:48 +0000
committer Lyn <lynhan@google.com> 2024-04-10 21:59:16 +0000
commitc0ecb0a92ba1f089e98a6fb1a0c1bc3fd309e90f (patch)
tree4058a2a0e138ca4a0f85a3395951b920b00e9e8a
parent47068c2b6fee408a54a6b1a9062b836a65d9ef26 (diff)
Null check AvalancheController.delete
Bug: 331192804 Test: manual Change-Id: I262bcdc4d4a7515effc06fb22914f5e47e9d4375
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/AvalancheController.kt7
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/AvalancheController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AvalancheController.kt
index 55a0f59bf461..861cffb7445e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/AvalancheController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AvalancheController.kt
@@ -106,13 +106,16 @@ class AvalancheController @Inject constructor() {
* Run or ignore Runnable for given HeadsUpEntry. If entry was never shown, ignore and delete
* all Runnables associated with that entry.
*/
- fun delete(entry: HeadsUpEntry, runnable: Runnable, label: String) {
+ fun delete(entry: HeadsUpEntry?, runnable: Runnable, label: String) {
if (!NotificationThrottleHun.isEnabled) {
runnable.run()
return
}
val fn = "[$label] => AvalancheController.delete " + getKey(entry)
-
+ if (entry == null) {
+ log { "$fn => cannot remove NULL entry" }
+ return
+ }
if (entry in nextMap) {
log { "$fn => [remove from next]" }
if (entry in nextMap) nextMap.remove(entry)