commit | 33ab4107da56e9d00843fc83a26dd37c5bb0b697 | [log] [tgz] |
---|---|---|
author | Hawkwood Glazier <jglazier@google.com> | Mon Sep 19 17:37:00 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Mon Sep 19 17:37:00 2022 +0000 |
tree | c47061d4a22bb82f21693419c52fe744b59bca8f | |
parent | abe1d6ae9e6df47bb13bc6ae4c81fa07e08a3ac4 [diff] | |
parent | f0a7aa689806b6c6176829e3ac20ee91498ab96f [diff] |
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()