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

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

Merge "Set the surface to be opaque when blur is not supported and shade is...

Merge "Set the surface to be opaque when blur is not supported and shade is fully expanded." into main
parents 595b8054 ea847a3a
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