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

Commit d236127c authored by Hawkwood Glazier's avatar Hawkwood Glazier
Browse files

Initialize TimeZone during DefaultClockProvider init

This is a duplication of Ie8b08bec36bccfda5a1f1eb20c91a040c1f688ab
for the refactored clock code. It's validated via unit test as it
has proved somewhat tricky to reproduce manually.

Test: atest DefaultClockProviderTest
Fixes: 241729527
Change-Id: I0c664750190572790e71f6095a1ac8c4995c83ca
(cherry picked from commit c6bfa32a)
parent b0643838
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@ class DefaultClock(
        recomputePadding()
        animations = DefaultClockAnimations(dozeFraction, foldFraction)
        events.onColorPaletteChanged(resources, true, true)
        events.onTimeZoneChanged(TimeZone.getDefault())
        events.onTimeTick()
    }

+3 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import org.junit.runner.RunWith
import org.mockito.ArgumentMatchers.anyBoolean
import org.mockito.ArgumentMatchers.anyFloat
import org.mockito.ArgumentMatchers.anyInt
import org.mockito.ArgumentMatchers.notNull
import org.mockito.Mock
import org.mockito.Mockito.times
import org.mockito.Mockito.verify
@@ -98,6 +99,8 @@ class DefaultClockProviderTest : SysuiTestCase() {

        verify(mockSmallClockView, times(2)).setColors(eq(DOZE_COLOR), anyInt())
        verify(mockLargeClockView, times(2)).setColors(eq(DOZE_COLOR), anyInt())
        verify(mockSmallClockView).onTimeZoneChanged(notNull())
        verify(mockLargeClockView).onTimeZoneChanged(notNull())
        verify(mockSmallClockView).refreshTime()
        verify(mockLargeClockView).refreshTime()
        verify(mockLargeClockView).setLayoutParams(any())