Merge "Merge changes from topic "presubmit-am-b1e78f9adaeb496da178ba91df448585" into tm-qpr-dev-plus-aosp am: 7e39707f2f" into udc-dev am: 0afff725e1

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22650441

Change-Id: I8e5b5d1c367b577e0b13669f72459b16b01811b3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Automerger Merge Worker
2023-04-18 09:38:36 +00:00
2 changed files with 16 additions and 0 deletions

View File

@@ -47,6 +47,7 @@ constructor(
duration = TO_LOCKSCREEN_DURATION,
onStep = { value -> -translatePx + value * translatePx },
interpolator = EMPHASIZED_DECELERATE,
onCancel = { 0f },
)
}

View File

@@ -92,6 +92,21 @@ class OccludedToLockscreenTransitionViewModelTest : SysuiTestCase() {
job.cancel()
}
@Test
fun lockscreenTranslationYResettedAfterJobCancelled() =
runTest(UnconfinedTestDispatcher()) {
val values = mutableListOf<Float>()
val pixels = 100
val job =
underTest.lockscreenTranslationY(pixels).onEach { values.add(it) }.launchIn(this)
repository.sendTransitionStep(step(0.5f, TransitionState.CANCELED))
assertThat(values.last()).isEqualTo(0f)
job.cancel()
}
private fun step(
value: Float,
state: TransitionState = TransitionState.RUNNING