Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e18e6ad authored by Hawkwood Glazier's avatar Hawkwood Glazier
Browse files

Clocks now correctly respond to font setting changes

Bug: 247155813
Test: Manually validated the small clock changes correctly
Change-Id: Ib7be0b5a3130b30ac98d4d7be668839fc924cd81
parent 60e003dd
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -137,6 +137,10 @@ open class ClockEventController @Inject constructor(
        override fun onThemeChanged() {
            updateFun.updateColors()
        }

        override fun onDensityOrFontScaleChanged() {
            clock?.events?.onFontSettingChanged()
        }
    }

    private val batteryCallback = object : BatteryStateChangeCallback {
+14 −0
Original line number Diff line number Diff line
@@ -118,6 +118,20 @@ class ClockEventControllerTest : SysuiTestCase() {
        verify(events, times(2)).onColorPaletteChanged(any(), any(), any())
    }

    @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