summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Aaron Liu <aaronjli@google.com> 2023-03-27 11:29:54 -0700
committer Aaron Liu <aaronjli@google.com> 2023-03-29 21:08:21 +0000
commit74f6dce9851cafdccd4281dfd0086bb577a7c7b6 (patch)
tree76fe1a9cf48ebf98d24d155a3ea32208705b3f32
parent2b671a036c8e54e0dccb6f2fd7936d05a0a7be37 (diff)
Fix dismiss callback when keyguard is dismissing.
AnimatingAway is set to false before hide is called, causing the dismiss action to be cancelled. This is breaking CarSysUI. Maintain parity with the legacy bouncer by setting disppear animation to null when we hide the bouncer so we maintain the state of animating away when we check to see if we should dismiss the callback. Fixes: 271166101 Test: Atest Change-Id: Ia51ec982dd78b69db82f69ae525e402bd461f294 Merged-In: Ia51ec982dd78b69db82f69ae525e402bd461f294
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractor.kt15
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractorTest.kt1
2 files changed, 7 insertions, 9 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractor.kt
index e9184aeeb29e..59bcfe09df5d 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractor.kt
@@ -106,10 +106,9 @@ constructor(
val panelExpansionAmount: Flow<Float> = repository.panelExpansionAmount
/** 0f = bouncer fully hidden. 1f = bouncer fully visible. */
val bouncerExpansion: Flow<Float> =
- combine(
- repository.panelExpansionAmount,
- repository.primaryBouncerShow
- ) { panelExpansion, primaryBouncerIsShowing ->
+ combine(repository.panelExpansionAmount, repository.primaryBouncerShow) {
+ panelExpansion,
+ primaryBouncerIsShowing ->
if (primaryBouncerIsShowing) {
1f - panelExpansion
} else {
@@ -201,6 +200,7 @@ constructor(
dismissCallbackRegistry.notifyDismissCancelled()
}
+ repository.setPrimaryStartDisappearAnimation(null)
falsingCollector.onBouncerHidden()
keyguardStateController.notifyPrimaryBouncerShowing(false /* showing */)
cancelShowRunnable()
@@ -312,11 +312,8 @@ constructor(
runnable.run()
return
}
- val finishRunnable = Runnable {
- runnable.run()
- repository.setPrimaryStartDisappearAnimation(null)
- }
- repository.setPrimaryStartDisappearAnimation(finishRunnable)
+
+ repository.setPrimaryStartDisappearAnimation(runnable)
}
/** Determine whether to show the side fps animation. */
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractorTest.kt
index bdc33f45c717..4c8a0a51bcdf 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractorTest.kt
@@ -131,6 +131,7 @@ class PrimaryBouncerInteractorTest : SysuiTestCase() {
verify(repository).setPrimaryShowingSoon(false)
verify(repository).setPrimaryShow(false)
verify(mPrimaryBouncerCallbackInteractor).dispatchVisibilityChanged(View.INVISIBLE)
+ verify(repository).setPrimaryStartDisappearAnimation(null)
}
@Test