Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f683b400 authored by Beverly Tai's avatar Beverly Tai Committed by Android (Google) Code Review
Browse files

Merge "Add keyguardStateToCamera transition" into main

parents 59ccaf0c 5b3775e2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ constructor(
        listenForAlternateBouncerToGone()
        listenForAlternateBouncerToLockscreenAodOrDozing()
        listenForAlternateBouncerToPrimaryBouncer()
        listenForTransitionToCamera(scope, keyguardInteractor)
    }

    private fun listenForAlternateBouncerToLockscreenAodOrDozing() {
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ constructor(
    override fun start() {
        listenForAodToLockscreenOrOccluded()
        listenForAodToGone()
        listenForTransitionToCamera(scope, keyguardInteractor)
    }

    private fun listenForAodToLockscreenOrOccluded() {
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ constructor(
    override fun start() {
        listenForDozingToLockscreenOrOccluded()
        listenForDozingToGone()
        listenForTransitionToCamera(scope, keyguardInteractor)
    }

    private fun listenForDozingToLockscreenOrOccluded() {
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ constructor(
        listenForDreamingToOccluded()
        listenForDreamingToGone()
        listenForDreamingToDozing()
        listenForTransitionToCamera(scope, keyguardInteractor)
    }

    fun startToLockscreenTransition() {
+6 −23
Original line number Diff line number Diff line
@@ -63,12 +63,12 @@ constructor(
        listenForLockscreenToGone()
        listenForLockscreenToGoneDragging()
        listenForLockscreenToOccluded()
        listenForLockscreenToCamera()
        listenForLockscreenToAodOrDozing()
        listenForLockscreenToPrimaryBouncer()
        listenForLockscreenToDreaming()
        listenForLockscreenToPrimaryBouncerDragging()
        listenForLockscreenToAlternateBouncer()
        listenForLockscreenTransitionToCamera()
    }

    /**
@@ -128,6 +128,10 @@ constructor(
            }
            .distinctUntilChanged()

    private fun listenForLockscreenTransitionToCamera() {
        listenForTransitionToCamera(scope, keyguardInteractor)
    }

    private fun listenForLockscreenToDreaming() {
        val invalidFromStates = setOf(KeyguardState.AOD, KeyguardState.DOZING)
        scope.launch {
@@ -311,7 +315,7 @@ constructor(
            keyguardInteractor.isKeyguardOccluded
                .sample(
                    combine(
                        transitionInteractor.finishedKeyguardState,
                        transitionInteractor.startedKeyguardState,
                        keyguardInteractor.isDreaming,
                        ::Pair
                    ),
@@ -325,27 +329,6 @@ constructor(
        }
    }

    /** This signal may come in before the occlusion signal, and can provide a custom transition */
    private fun listenForLockscreenToCamera() {
        scope.launch {
            keyguardInteractor.onCameraLaunchDetected
                .sample(transitionInteractor.startedKeyguardTransitionStep, ::Pair)
                .collect { (_, lastStartedStep) ->
                    // DREAMING/AOD/OFF may trigger on the first power button push, so include this
                    // state in order to cancel and correct the transition
                    if (
                        lastStartedStep.to == KeyguardState.LOCKSCREEN ||
                            lastStartedStep.to == KeyguardState.DREAMING ||
                            lastStartedStep.to == KeyguardState.DOZING ||
                            lastStartedStep.to == KeyguardState.AOD ||
                            lastStartedStep.to == KeyguardState.OFF
                    ) {
                        startTransitionTo(KeyguardState.OCCLUDED)
                    }
                }
        }
    }

    private fun listenForLockscreenToAodOrDozing() {
        scope.launch {
            keyguardInteractor.wakefulnessModel
Loading