From 978dfb396b35f44a6bdba93bef6eea67749b00d8 Mon Sep 17 00:00:00 2001 From: Hawkwood Glazier Date: Sat, 18 Mar 2023 17:20:27 +0000 Subject: [PATCH] Prevent null argument from crashing ClockEventController Kotlin appears to zealously check whether the timeFormat argument is null to protect us from NPEs, even though it is not used. In an edge where a null value is passed, this causes a crash. Test: N/A Bug: 267477766 Change-Id: Ie302018c8ab142d26ab8ffd18e2157cdcd1602da --- .../SystemUI/src/com/android/keyguard/ClockEventController.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/keyguard/ClockEventController.kt b/packages/SystemUI/src/com/android/keyguard/ClockEventController.kt index 4aaa566eb852f..3b9060ad0ac3f 100644 --- a/packages/SystemUI/src/com/android/keyguard/ClockEventController.kt +++ b/packages/SystemUI/src/com/android/keyguard/ClockEventController.kt @@ -259,7 +259,7 @@ constructor( largeTimeListener?.update(shouldTimeListenerRun) } - override fun onTimeFormatChanged(timeFormat: String) { + override fun onTimeFormatChanged(timeFormat: String?) { clock?.events?.onTimeFormatChanged(DateFormat.is24HourFormat(context)) }