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

Commit 7228f885 authored by Kshitij Gupta's avatar Kshitij Gupta Committed by Android (Google) Code Review
Browse files

Merge "Keyguard: Defer doze-to-lockscreen transition on shade drag" into main

parents 79c374eb f9309850
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -2196,3 +2196,13 @@ flag {
    bug: "201143076"
    is_fixed_read_only: true
}

flag {
   name: "defer_doze_transition_on_shade_drag"
   namespace: "systemui"
   description: "Defer doze-to-lockscreen transition animation during notification shade drag"
   bug: "419763981"
   metadata {
        purpose: PURPOSE_BUGFIX
   }
}
+20 −5
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ import kotlinx.coroutines.flow.combineTransform
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.emptyFlow
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.merge
@@ -256,6 +257,24 @@ constructor(
                .dumpWhileCollecting("zoomOutFromGlanceableHub")
        }

    private fun dozingToLockscreenAlpha(viewState: ViewStateAccessor) =
        alphaOnShadeExpansion
            .map { it < 1f }
            .distinctUntilChanged()
            .onStart { emit(false) }.flatMapLatest { isExpanding ->
                if (Flags.deferDozeTransitionOnShadeDrag() && isExpanding) {
                    // If shade is expanding, switch to a flow that never emits.
                    emptyFlow()
                } else {
                    // Otherwise, use the original flow.
                    if (Flags.newDozingKeyguardStates()) {
                        dozingToLockscreenTransitionViewModel.lockscreenAlpha(viewState)
                    } else {
                        dozingToLockscreenTransitionViewModel.lockscreenAlpha
                    }
                }
            }

    /** Last point that the root view was tapped */
    val lastRootViewTapPosition: Flow<Point?> =
        keyguardInteractor.lastRootViewTapPosition.dumpWhileCollecting("lastRootViewTapPosition")
@@ -314,11 +333,7 @@ constructor(
                        aodToGlanceableHubTransitionViewModel.lockscreenAlpha(viewState),
                        dozingToDreamingTransitionViewModel.lockscreenAlpha,
                        dozingToGoneTransitionViewModel.lockscreenAlpha(viewState),
                        if (Flags.newDozingKeyguardStates()) {
                            dozingToLockscreenTransitionViewModel.lockscreenAlpha(viewState)
                        } else {
                            dozingToLockscreenTransitionViewModel.lockscreenAlpha
                        },
                        dozingToLockscreenAlpha(viewState),
                        dozingToOccludedTransitionViewModel.lockscreenAlpha(viewState),
                        dozingToPrimaryBouncerTransitionViewModel.lockscreenAlpha,
                        dreamingToAodTransitionViewModel.lockscreenAlpha,