Merge "Fix clock fading in incorrectly" into tm-qpr-dev
This commit is contained in:
@@ -64,7 +64,11 @@ constructor(
|
||||
.sample(keyguardTransitionInteractor.startedKeyguardTransitionStep, ::Pair)
|
||||
.collect { pair ->
|
||||
val (isAbleToDream, lastStartedTransition) = pair
|
||||
if (isAbleToDream && lastStartedTransition.to == KeyguardState.LOCKSCREEN) {
|
||||
if (
|
||||
isAbleToDream &&
|
||||
lastStartedTransition.to == KeyguardState.LOCKSCREEN &&
|
||||
lastStartedTransition.from != KeyguardState.AOD
|
||||
) {
|
||||
keyguardTransitionRepository.startTransition(
|
||||
TransitionInfo(
|
||||
name,
|
||||
|
||||
@@ -357,6 +357,50 @@ class KeyguardTransitionScenariosTest : SysuiTestCase() {
|
||||
coroutineContext.cancelChildren()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `LOCKSCREEN to DREAMING`() =
|
||||
testScope.runTest {
|
||||
// GIVEN a device that is not dreaming or dozing
|
||||
keyguardRepository.setDreamingWithOverlay(false)
|
||||
keyguardRepository.setWakefulnessModel(startingToWake())
|
||||
keyguardRepository.setDozeTransitionModel(
|
||||
DozeTransitionModel(from = DozeStateModel.DOZE, to = DozeStateModel.FINISH)
|
||||
)
|
||||
runCurrent()
|
||||
|
||||
// GIVEN a prior transition has run to LOCKSCREEN
|
||||
runner.startTransition(
|
||||
testScope,
|
||||
TransitionInfo(
|
||||
ownerName = "",
|
||||
from = KeyguardState.GONE,
|
||||
to = KeyguardState.LOCKSCREEN,
|
||||
animator =
|
||||
ValueAnimator().apply {
|
||||
duration = 10
|
||||
interpolator = Interpolators.LINEAR
|
||||
},
|
||||
)
|
||||
)
|
||||
reset(mockTransitionRepository)
|
||||
|
||||
// WHEN the device begins to dream
|
||||
keyguardRepository.setDreamingWithOverlay(true)
|
||||
advanceUntilIdle()
|
||||
|
||||
val info =
|
||||
withArgCaptor<TransitionInfo> {
|
||||
verify(mockTransitionRepository).startTransition(capture(), anyBoolean())
|
||||
}
|
||||
// THEN a transition to DREAMING should occur
|
||||
assertThat(info.ownerName).isEqualTo("FromLockscreenTransitionInteractor")
|
||||
assertThat(info.from).isEqualTo(KeyguardState.LOCKSCREEN)
|
||||
assertThat(info.to).isEqualTo(KeyguardState.DREAMING)
|
||||
assertThat(info.animator).isNotNull()
|
||||
|
||||
coroutineContext.cancelChildren()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `LOCKSCREEN to DOZING`() =
|
||||
testScope.runTest {
|
||||
|
||||
Reference in New Issue
Block a user