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

Commit 0e0d95d6 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I0808f8b8,I03c9f251,I6509e037,I0e3adb67 into tm-qpr-dev

* changes:
  Dreaming transitions - Enable teamfood
  Transitions - Update for canceled state
  Transitions - Handle cancel of bouncer swipe
  Transitions: Gone->Dreaming
parents 4fd565a8 a2a94e3f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1292,6 +1292,9 @@
    <!-- LOCKSCREEN -> DREAMING transition: Amount to shift lockscreen content on entering -->
    <dimen name="lockscreen_to_dreaming_transition_lockscreen_translation_y">-40dp</dimen>

    <!-- GONE -> DREAMING transition: Amount to shift lockscreen content on entering -->
    <dimen name="gone_to_dreaming_transition_lockscreen_translation_y">-40dp</dimen>

    <!-- LOCKSCREEN -> OCCLUDED transition: Amount to shift lockscreen content on entering -->
    <dimen name="lockscreen_to_occluded_transition_lockscreen_translation_y">-40dp</dimen>

+1 −1
Original line number Diff line number Diff line
@@ -200,7 +200,7 @@ object Flags {
    /** A different path for unocclusion transitions back to keyguard */
    // TODO(b/262859270): Tracking Bug
    @JvmField
    val UNOCCLUSION_TRANSITION = unreleasedFlag(223, "unocclusion_transition", teamfood = false)
    val UNOCCLUSION_TRANSITION = unreleasedFlag(223, "unocclusion_transition", teamfood = true)

    // flag for controlling auto pin confirmation and material u shapes in bouncer
    @JvmField
+1 −1
Original line number Diff line number Diff line
@@ -209,7 +209,7 @@ class KeyguardTransitionRepositoryImpl @Inject constructor() : KeyguardTransitio
            return
        }

        if (state == TransitionState.FINISHED) {
        if (state == TransitionState.FINISHED || state == TransitionState.CANCELED) {
            updateTransitionId = null
        }

+15 −24
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ import com.android.systemui.animation.Interpolators
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.keyguard.data.repository.KeyguardTransitionRepository
import com.android.systemui.keyguard.shared.model.BiometricUnlockModel.Companion.isWakeAndUnlock
import com.android.systemui.keyguard.shared.model.BiometricUnlockModel
import com.android.systemui.keyguard.shared.model.DozeStateModel
import com.android.systemui.keyguard.shared.model.DozeStateModel.Companion.isDozeOff
import com.android.systemui.keyguard.shared.model.KeyguardState
@@ -56,7 +56,7 @@ constructor(
        scope.launch {
            // Using isDreamingWithOverlay provides an optimized path to LOCKSCREEN state, which
            // otherwise would have gone through OCCLUDED first
            keyguardInteractor.isDreamingWithOverlay
            keyguardInteractor.isAbleToDream
                .sample(
                    combine(
                        keyguardInteractor.dozeTransitionModel,
@@ -65,8 +65,7 @@ constructor(
                    ),
                    ::toTriple
                )
                .collect { triple ->
                    val (isDreaming, dozeTransitionModel, lastStartedTransition) = triple
                .collect { (isDreaming, dozeTransitionModel, lastStartedTransition) ->
                    if (
                        !isDreaming &&
                            isDozeOff(dozeTransitionModel.to) &&
@@ -96,8 +95,7 @@ constructor(
                    ),
                    ::toTriple
                )
                .collect { triple ->
                    val (isDreaming, isOccluded, lastStartedTransition) = triple
                .collect { (isDreaming, isOccluded, lastStartedTransition) ->
                    if (
                        isOccluded &&
                            !isDreaming &&
@@ -123,14 +121,8 @@ constructor(

    private fun listenForDreamingToGone() {
        scope.launch {
            keyguardInteractor.biometricUnlockState
                .sample(keyguardTransitionInteractor.finishedKeyguardState, ::Pair)
                .collect { pair ->
                    val (biometricUnlockState, keyguardState) = pair
                    if (
                        keyguardState == KeyguardState.DREAMING &&
                            isWakeAndUnlock(biometricUnlockState)
                    ) {
            keyguardInteractor.biometricUnlockState.collect { biometricUnlockState ->
                if (biometricUnlockState == BiometricUnlockModel.WAKE_AND_UNLOCK_FROM_DREAM) {
                    keyguardTransitionRepository.startTransition(
                        TransitionInfo(
                            name,
@@ -151,8 +143,7 @@ constructor(
                    keyguardTransitionInteractor.finishedKeyguardState,
                    ::Pair
                )
                .collect { pair ->
                    val (dozeTransitionModel, keyguardState) = pair
                .collect { (dozeTransitionModel, keyguardState) ->
                    if (
                        dozeTransitionModel.to == DozeStateModel.DOZE &&
                            keyguardState == KeyguardState.DREAMING
+30 −13
Original line number Diff line number Diff line
@@ -48,8 +48,6 @@ constructor(
    private val keyguardTransitionRepository: KeyguardTransitionRepository,
) : TransitionInteractor(FromLockscreenTransitionInteractor::class.simpleName!!) {

    private var transitionId: UUID? = null

    override fun start() {
        listenForLockscreenToGone()
        listenForLockscreenToOccluded()
@@ -104,6 +102,7 @@ constructor(

    /* Starts transitions when manually dragging up the bouncer from the lockscreen. */
    private fun listenForLockscreenToBouncerDragging() {
        var transitionId: UUID? = null
        scope.launch {
            shadeRepository.shadeModel
                .sample(
@@ -114,25 +113,43 @@ constructor(
                    ),
                    ::toTriple
                )
                .collect { triple ->
                    val (shadeModel, keyguardState, statusBarState) = triple

                .collect { (shadeModel, keyguardState, statusBarState) ->
                    val id = transitionId
                    if (id != null) {
                        // An existing `id` means a transition is started, and calls to
                        // `updateTransition` will control it until FINISHED
                        // `updateTransition` will control it until FINISHED or CANCELED
                        var nextState =
                            if (shadeModel.expansionAmount == 0f) {
                                TransitionState.FINISHED
                            } else if (shadeModel.expansionAmount == 1f) {
                                TransitionState.CANCELED
                            } else {
                                TransitionState.RUNNING
                            }
                        keyguardTransitionRepository.updateTransition(
                            id,
                            1f - shadeModel.expansionAmount,
                            nextState,
                        )

                        if (
                                shadeModel.expansionAmount == 0f || shadeModel.expansionAmount == 1f
                            nextState == TransitionState.CANCELED ||
                                nextState == TransitionState.FINISHED
                        ) {
                            transitionId = null
                                TransitionState.FINISHED
                            } else {
                                TransitionState.RUNNING
                        }

                        // If canceled, just put the state back
                        if (nextState == TransitionState.CANCELED) {
                            keyguardTransitionRepository.startTransition(
                                TransitionInfo(
                                    ownerName = name,
                                    from = KeyguardState.BOUNCER,
                                    to = KeyguardState.LOCKSCREEN,
                                    animator = getAnimator(0.milliseconds)
                                )
                            )
                        }
                    } else {
                        // TODO (b/251849525): Remove statusbarstate check when that state is
                        // integrated into KeyguardTransitionRepository
Loading