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

Commit ea847a3a authored by Chandru S's avatar Chandru S
Browse files

Set the surface to be opaque when blur is not supported and shade is fully expanded.

This prevents the surface below from becoming visible when blur radius drops to 0

Bug: 405288154
Test: verified all CUJs manually with bouncer blur enabled and shade blur flag enabled and disabled
Test: with shade and bouncer blur enabled, pull down shade and enable/disable battery saver repeatedly, surface below should not be visible when battery saver is enabled
Flag: com.android.systemui.bouncer_ui_revamp

Change-Id: I3b4ebde11d3138c3c06088ade97ebcee9305e258
parent 25eda8c2
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -54,7 +54,6 @@ import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.ArgumentCaptor
import org.mockito.ArgumentMatchers.anyBoolean
import org.mockito.ArgumentMatchers.anyInt
import org.mockito.ArgumentMatchers.floatThat
import org.mockito.Captor
@@ -429,7 +428,7 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() {
    @EnableFlags(Flags.FLAG_BOUNCER_UI_REVAMP)
    fun ignoreShadeBlurUntilHidden_requestsBlur_windowBlurFlag() {
        notificationShadeDepthController.blursDisabledForAppLaunch = true
        verify(windowRootViewBlurInteractor).requestBlurForShade(anyInt(), anyBoolean())
        verify(windowRootViewBlurInteractor).requestBlurForShade(anyInt())
    }

    @Test
@@ -510,7 +509,7 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() {
        notificationShadeDepthController.updateBlurCallback.doFrame(0)
        verify(notificationShadeWindowController).setBackgroundBlurRadius(eq(0))
        verify(wallpaperController).setNotificationShadeZoom(eq(1f))
        verify(windowRootViewBlurInteractor).requestBlurForShade(0, false)
        verify(windowRootViewBlurInteractor).requestBlurForShade(0)
    }

    @Test
+1 −1
Original line number Diff line number Diff line
@@ -40,6 +40,6 @@ class WindowRootViewBlurInteractorTest : SysuiTestCase() {
        testScope.runTest {
            kosmos.fakeKeyguardBouncerRepository.setPrimaryShow(true)

            assertThat(underTest.requestBlurForShade(30, true)).isFalse()
            assertThat(underTest.requestBlurForShade(30)).isFalse()
        }
}
+2 −2
Original line number Diff line number Diff line
@@ -46,14 +46,14 @@ class WindowRootViewModelTest : SysuiTestCase() {
        testScope.runTest {
            kosmos.fakeWindowRootViewBlurRepository.isBlurSupported.value = true
            val blurRadius by collectLastValue(underTest.blurRadius)
            val isBlurOpaque by collectLastValue(underTest.isBlurOpaque)
            val isSurfaceOpaque by collectLastValue(underTest.isSurfaceOpaque)
            runCurrent()

            kosmos.fakeBouncerTransitions.first().windowBlurRadius.value = 30.0f
            runCurrent()

            assertThat(blurRadius).isEqualTo(30)
            assertThat(isBlurOpaque).isEqualTo(false)
            assertThat(isSurfaceOpaque).isEqualTo(false)
        }

    @Test
+1 −2
Original line number Diff line number Diff line
@@ -639,8 +639,7 @@ constructor(
        zoomOutCalculatedFromShadeRadius = zoomOutFromShadeRadius
        if (Flags.bouncerUiRevamp() || Flags.glanceableHubBlurredBackground()) {
            if (windowRootViewBlurInteractor.isBlurCurrentlySupported.value) {
                updateScheduled =
                    windowRootViewBlurInteractor.requestBlurForShade(blur, shouldBlurBeOpaque)
                updateScheduled = windowRootViewBlurInteractor.requestBlurForShade(blur)
                return
            }
            // When blur is not supported, zoom out still needs to happen when scheduleUpdate
+0 −1
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import kotlinx.coroutines.flow.StateFlow

class NoopWindowRootViewBlurRepository @Inject constructor() : WindowRootViewBlurRepository {
    override val blurRequestedByShade: MutableStateFlow<Int> = MutableStateFlow(0)
    override val isBlurOpaque: MutableStateFlow<Boolean> = MutableStateFlow(true)
    override val isBlurSupported: StateFlow<Boolean> = MutableStateFlow(false)
    override var blurAppliedListener: BlurAppliedListener? = null
}
Loading