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

Commit 3514f085 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[flexiglass] Lazy init canSwipeToEnter" into main

parents f2642e5d 6de11885
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -119,15 +119,18 @@ constructor(
     * Note: `true` doesn't mean the lockscreen is visible. It may be occluded or covered by other
     * UI.
     */
    val canSwipeToEnter: StateFlow<Boolean?> =
    val canSwipeToEnter: StateFlow<Boolean?> by lazy {
        combine(
                authenticationInteractor.authenticationMethod.map {
                    it == AuthenticationMethodModel.None
                },
                isLockscreenEnabled,
                deviceUnlockedInteractor.deviceUnlockStatus,
                isDeviceEntered
            ) { isNoneAuthMethod, isLockscreenEnabled, deviceUnlockStatus, isDeviceEntered ->
                isDeviceEntered) {
                    isNoneAuthMethod,
                    isLockscreenEnabled,
                    deviceUnlockStatus,
                    isDeviceEntered ->
                    val isSwipeAuthMethod = isNoneAuthMethod && isLockscreenEnabled
                    (isSwipeAuthMethod ||
                        (deviceUnlockStatus.isUnlocked &&
@@ -142,6 +145,7 @@ constructor(
                // from upstream data sources.
                initialValue = null,
            )
    }

    /**
     * Attempt to enter the device and dismiss the lockscreen. If authentication is required to