summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-12-03 03:51:12 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-12-03 03:51:12 +0000
commitb0bd23211b01135da5ad9c774aa99d6b9cbd3f3a (patch)
treeace3e05b39ae45e53a60baf4723a7b1a8af0ad51
parent198b9f7d987e980b7739e1541766ad7dcb34c51a (diff)
parentf52c997ccbd3a4ce26cfb1560676c40f13c38151 (diff)
Merge "Show alt bouncer if needed when dismissing keyguard w/ callback." into main
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissInteractor.kt21
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissInteractorKosmos.kt2
2 files changed, 13 insertions, 10 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissInteractor.kt
index 2d7da38535b1..0a4022ad4de8 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissInteractor.kt
@@ -16,6 +16,7 @@
package com.android.systemui.keyguard.domain.interactor
+import com.android.app.tracing.coroutines.launchTraced as launch
import com.android.internal.policy.IKeyguardDismissCallback
import com.android.systemui.bouncer.domain.interactor.AlternateBouncerInteractor
import com.android.systemui.bouncer.domain.interactor.PrimaryBouncerInteractor
@@ -39,7 +40,6 @@ import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.merge
-import com.android.app.tracing.coroutines.launchTraced as launch
import kotlinx.coroutines.withContext
/** Encapsulates business logic for requesting the keyguard to dismiss/finish/done. */
@@ -53,8 +53,8 @@ constructor(
private val primaryBouncerInteractor: PrimaryBouncerInteractor,
private val selectedUserInteractor: SelectedUserInteractor,
private val dismissCallbackRegistry: DismissCallbackRegistry,
+ private val alternateBouncerInteractor: AlternateBouncerInteractor,
trustRepository: TrustRepository,
- alternateBouncerInteractor: AlternateBouncerInteractor,
powerInteractor: PowerInteractor,
) {
/*
@@ -151,13 +151,16 @@ constructor(
dismissCallbackRegistry.addCallback(callback)
}
- // This will either show the bouncer, or dismiss the keyguard if insecure.
- // We currently need to request showing the primary bouncer in order to start a
- // transition to PRIMARY_BOUNCER. Once we refactor that so that starting the
- // transition is what causes the bouncer to show, we can remove this entire method,
- // and simply ask KeyguardTransitionInteractor to transition to a bouncer state or
- // dismiss keyguard.
- primaryBouncerInteractor.show(true)
+ // This will either show the bouncer, or dismiss the keyguard if insecure. We
+ // currently need to request showing the bouncer in order to start a transition to
+ // *_BOUNCER. Once we refactor that so that starting the transition is what causes
+ // the bouncer to show, we can remove this entire method, and simply call
+ // KeyguardDismissTransitionInteractor#startDismissKeyguardTransition.
+ if (alternateBouncerInteractor.canShowAlternateBouncer.value) {
+ alternateBouncerInteractor.forceShow()
+ } else {
+ primaryBouncerInteractor.show(true)
+ }
}
}
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissInteractorKosmos.kt
index ace11573c7c6..339210c07437 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissInteractorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissInteractorKosmos.kt
@@ -38,8 +38,8 @@ val Kosmos.keyguardDismissInteractor by
primaryBouncerInteractor = primaryBouncerInteractor,
selectedUserInteractor = selectedUserInteractor,
dismissCallbackRegistry = dismissCallbackRegistry,
- trustRepository = trustRepository,
alternateBouncerInteractor = alternateBouncerInteractor,
+ trustRepository = trustRepository,
powerInteractor = powerInteractor,
)
}