[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:
@@ -118,6 +118,7 @@ class DefaultClock(
|
||||
recomputePadding()
|
||||
animations = DefaultClockAnimations(dozeFraction, foldFraction)
|
||||
events.onColorPaletteChanged(resources, true, true)
|
||||
events.onTimeZoneChanged(TimeZone.getDefault())
|
||||
events.onTimeTick()
|
||||
}
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user