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

Commit aae0b1bd authored by Bryce Lee's avatar Bryce Lee Committed by Android (Google) Code Review
Browse files

Merge "Do not apply shade blur on transition to shade when dreaming." into main

parents b59a4c08 dfffbc02
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -2201,6 +2201,16 @@ flag {
    }
}

flag {
    name: "no_shade_blur_on_dream_start"
    namespace: "systemui"
    description: "Suppress shade blur when starting dream"
    bug: "440661063"
    metadata {
      purpose: PURPOSE_BUGFIX
    }
}

flag {

    name: "qs_split_internet_tile"
+19 −0
Original line number Diff line number Diff line
@@ -106,6 +106,8 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() {
    private val maxBlur = 150
    private lateinit var notificationShadeDepthController: NotificationShadeDepthController

    private val dreamingFlow = MutableStateFlow(false)

    @Before
    fun setup() {
        // Constructs kosmos.windowRootViewBlurInteractor after test starts to avoid the error that
@@ -130,6 +132,7 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() {
        `when`(blurUtils.maxBlurRadius).thenReturn(maxBlur.toFloat())
        `when`(windowRootViewBlurInteractor.isBlurCurrentlySupported)
            .thenReturn(MutableStateFlow(true))
        `when`(keyguardInteractor.isDreaming).thenReturn(dreamingFlow)

        notificationShadeDepthController =
            NotificationShadeDepthController(
@@ -249,6 +252,22 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() {
        verify(shadeAnimation).animateTo(eq(0))
    }

    @Test
    @EnableFlags(Flags.FLAG_NO_SHADE_BLUR_ON_DREAM_START)
    fun onStateChanged_noBlurEvaluation_ifShadeAndDreaming() {
        onPanelExpansionChanged_apliesBlur_ifShade()
        clearInvocations(choreographer)
        statusBarState = StatusBarState.KEYGUARD
        statusBarStateListener.onStateChanged(statusBarState)
        verify(shadeAnimation).animateTo(eq(0))

        clearInvocations(shadeAnimation)
        statusBarState = StatusBarState.SHADE
        dreamingFlow.value = true
        statusBarStateListener.onStateChanged(statusBarState)
        verify(shadeAnimation, never()).animateTo(anyInt())
    }

    @Test
    fun setQsPanelExpansion_appliesBlur() {
        statusBarState = StatusBarState.KEYGUARD
+13 −1
Original line number Diff line number Diff line
@@ -137,6 +137,8 @@ constructor(
    // Shade expansion offset that happens when pulling down on a HUN.
    var panelPullDownMinFraction = 0f

    var existingStatusBarState: Int? = null

    var shadeAnimation = DepthAnimation()

    @VisibleForTesting var brightnessMirrorSpring = DepthAnimation()
@@ -416,6 +418,16 @@ constructor(
    private val statusBarStateCallback =
        object : StatusBarStateController.StateListener {
            override fun onStateChanged(newState: Int) {
                if (Flags.noShadeBlurOnDreamStart()) {
                    if (existingStatusBarState == StatusBarState.KEYGUARD
                        && newState == StatusBarState.SHADE
                        && keyguardInteractor.isDreaming.value) {
                        return
                    }
                }

                existingStatusBarState = newState

                updateShadeAnimationBlur(
                    shadeExpansion,
                    prevTracking,
@@ -653,7 +665,7 @@ constructor(

        // Do not blur or zoom out the wallpaper if the blurred wallpaper is not supported.
        if (!windowRootViewBlurInteractor.isBlurredWallpaperSupported) {
            return;
            return
        }

        if (Flags.bouncerUiRevamp() || Flags.glanceableHubBlurredBackground()) {