Merge "Clocks now correctly respond to font setting changes" into tm-qpr-dev am: fa0dc28b4c am: f0a7aa6898

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19974909

Change-Id: Ie0eaa8d70bc5b489ff0ad1362664f10bc97568c7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/packages/SystemUI/src/com/android/keyguard/ClockEventController.kt b/packages/SystemUI/src/com/android/keyguard/ClockEventController.kt
index 0e1e0cb..b444f4c 100644
--- a/packages/SystemUI/src/com/android/keyguard/ClockEventController.kt
+++ b/packages/SystemUI/src/com/android/keyguard/ClockEventController.kt
@@ -137,6 +137,10 @@
         override fun onThemeChanged() {
             updateFun.updateColors()
         }
+
+        override fun onDensityOrFontScaleChanged() {
+            clock?.events?.onFontSettingChanged()
+        }
     }
 
     private val batteryCallback = object : BatteryStateChangeCallback {
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/ClockEventControllerTest.kt b/packages/SystemUI/tests/src/com/android/keyguard/ClockEventControllerTest.kt
index 914d945..25e7dbb 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/ClockEventControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/keyguard/ClockEventControllerTest.kt
@@ -119,6 +119,20 @@
     }
 
     @Test
+    fun fontChanged_verifyFontSizeUpdated() {
+        clockEventController.clock = clock
+        verify(events).onColorPaletteChanged(any(), any(), any())
+
+        clockEventController.registerListeners()
+
+        val captor = argumentCaptor<ConfigurationController.ConfigurationListener>()
+        verify(configurationController).addCallback(capture(captor))
+        captor.value.onDensityOrFontScaleChanged()
+
+        verify(events).onFontSettingChanged()
+    }
+
+    @Test
     fun batteryCallback_keyguardShowingCharging_verifyChargeAnimation() {
         clockEventController.clock = clock
         clockEventController.registerListeners()