Merge "Make sure to reset isFoldHandled" into tm-qpr-dev am: 921756c9ef
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22860951 Change-Id: I785c67b112fa3b04e6b7354a6c396332612759d1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -154,10 +154,6 @@ constructor(
|
|||||||
pendingScrimReadyCallback = onReady
|
pendingScrimReadyCallback = onReady
|
||||||
}
|
}
|
||||||
} else if (isFolded && !isFoldHandled && alwaysOnEnabled && isDozing) {
|
} else if (isFolded && !isFoldHandled && alwaysOnEnabled && isDozing) {
|
||||||
// Screen turning on for the first time after folding and we are already dozing
|
|
||||||
// We should play the folding to AOD animation
|
|
||||||
isFoldHandled = true
|
|
||||||
|
|
||||||
setAnimationState(playing = true)
|
setAnimationState(playing = true)
|
||||||
getShadeFoldAnimator().prepareFoldToAodAnimation()
|
getShadeFoldAnimator().prepareFoldToAodAnimation()
|
||||||
|
|
||||||
@@ -173,6 +169,13 @@ constructor(
|
|||||||
// No animation, call ready callback immediately
|
// No animation, call ready callback immediately
|
||||||
onReady.run()
|
onReady.run()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isFolded) {
|
||||||
|
// Any time the screen turns on, this state needs to be reset if the device has been
|
||||||
|
// folded. Reaching this line implies AOD has been shown in one way or another,
|
||||||
|
// if enabled
|
||||||
|
isFoldHandled = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Called when keyguard scrim opaque changed */
|
/** Called when keyguard scrim opaque changed */
|
||||||
|
|||||||
@@ -199,6 +199,31 @@ class FoldAodAnimationControllerTest : SysuiTestCase() {
|
|||||||
job.cancel()
|
job.cancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun onFolded_onScreenTurningOnWithoutDozingThenWithDozing_doesNotLogLatency() =
|
||||||
|
runBlocking(IMMEDIATE) {
|
||||||
|
val job = underTest.listenForDozing(this)
|
||||||
|
keyguardRepository.setDozing(false)
|
||||||
|
setAodEnabled(enabled = true)
|
||||||
|
|
||||||
|
yield()
|
||||||
|
|
||||||
|
fold()
|
||||||
|
simulateScreenTurningOn()
|
||||||
|
reset(latencyTracker)
|
||||||
|
|
||||||
|
// Now enable dozing and trigger a second run through the aod animation code. It should
|
||||||
|
// not rerun the animation
|
||||||
|
keyguardRepository.setDozing(true)
|
||||||
|
yield()
|
||||||
|
simulateScreenTurningOn()
|
||||||
|
|
||||||
|
verify(latencyTracker, never()).onActionStart(any())
|
||||||
|
verify(latencyTracker, never()).onActionEnd(any())
|
||||||
|
|
||||||
|
job.cancel()
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun onFolded_animationCancelled_doesNotLogLatency() =
|
fun onFolded_animationCancelled_doesNotLogLatency() =
|
||||||
runBlocking(IMMEDIATE) {
|
runBlocking(IMMEDIATE) {
|
||||||
|
|||||||
Reference in New Issue
Block a user