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

Commit 67a77c57 authored by Chandru S's avatar Chandru S
Browse files

Bouncer -> Gone should leave blur at max if shade is going to be open

Running dismiss from keyguard does not matter because we need to reset blur to min anyway if we're going to keyguard or gone without shade.

Bug: 370555003
Flag: com.android.systemui.bouncer_ui_revamp
Flag: com.android.systemui.notification_shade_blur
Test: verified blur is still applied using logs, shade alpha becomes 1.0 immediately after that so blur is still not visible.
Change-Id: I7b5174bbe1ddadc1ba536b58de1756cd38c4a9fc
parent 546dbf91
Loading
Loading
Loading
Loading
+7 −15
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.keyguard.ui.viewmodel

import android.util.MathUtils
import com.android.systemui.Flags
import com.android.systemui.bouncer.domain.interactor.PrimaryBouncerInteractor
import com.android.systemui.bouncer.shared.flag.ComposeBouncerFlags
import com.android.systemui.dagger.SysUISingleton
@@ -109,15 +110,14 @@ constructor(
        )
    }

    private fun createBouncerWindowBlurFlow(
        willRunAnimationOnKeyguard: () -> Boolean
    ): Flow<Float> {
    private fun createBouncerWindowBlurFlow(): Flow<Float> {
        return transitionAnimation.sharedFlow(
            duration = TO_GONE_SHORT_DURATION,
            onStart = { willRunDismissFromKeyguard = willRunAnimationOnKeyguard() },
            onStart = { leaveShadeOpen = statusBarStateController.leaveOpenOnKeyguardHide() },
            onStep = {
                if (willRunDismissFromKeyguard) {
                    blurConfig.minBlurRadiusPx
                if (leaveShadeOpen && Flags.notificationShadeBlur()) {
                    // Going back to shade from bouncer after keyguard dismissal
                    blurConfig.maxBlurRadiusPx
                } else {
                    transitionProgressToBlurRadius(
                        starBlurRadius = blurConfig.maxBlurRadiusPx,
@@ -158,15 +158,7 @@ constructor(
        )
    }

    override val windowBlurRadius: Flow<Float> =
        if (ComposeBouncerFlags.isEnabled) {
            keyguardDismissActionInteractor
                .get()
                .willAnimateDismissActionOnLockscreen
                .flatMapLatest { createBouncerWindowBlurFlow { it } }
        } else {
            createBouncerWindowBlurFlow(primaryBouncerInteractor::willRunDismissFromKeyguard)
        }
    override val windowBlurRadius: Flow<Float> = createBouncerWindowBlurFlow()

    override val notificationBlurRadius: Flow<Float> =
        transitionAnimation.immediatelyTransitionTo(0.0f)