[DO NOT MERGE] 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
This commit is contained in:
Hawkwood Glazier
2022-08-24 16:01:45 +00:00
parent 6a62f99b50
commit c6bfa32a24
2 changed files with 4 additions and 0 deletions

View File

@@ -118,6 +118,7 @@ class DefaultClock(
recomputePadding()
animations = DefaultClockAnimations(dozeFraction, foldFraction)
events.onColorPaletteChanged(resources, true, true)
events.onTimeZoneChanged(TimeZone.getDefault())
events.onTimeTick()
}

View File

@@ -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())