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

Commit 29473164 authored by andrewxu's avatar andrewxu
Browse files

Make the window root view transparent on the desktop

This CL adds a new config res to indicate whether the blurred
wallpaper is supported by device. This config is true by default and
is overridden to false on desktop.

In this CL, when the aforementioned config is false, the surface
is transparent.

Bug: 399112904
Flag: EXEMPT bugfix
Change-Id: I3b6310b086e3a26da1e7803b44727d9bad992898
parent fed1c95a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1176,4 +1176,7 @@

    <!-- Indicates post recording flow to use flat bottom bar to save vertical space -->
    <bool name="screen_record_post_recording_flat_bottom_bar">false</bool>

    <!-- Indicates whether the blurred wallpaper is supported -->
    <bool name="config_supportBlurredWallpaper">true</bool>
</resources>
+8 −0
Original line number Diff line number Diff line
@@ -16,13 +16,16 @@

package com.android.systemui.window.domain.interactor

import android.content.res.Resources
import com.android.systemui.Flags
import com.android.systemui.communal.domain.interactor.CommunalInteractor
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor
import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor
import com.android.systemui.keyguard.shared.model.KeyguardState.PRIMARY_BOUNCER
import com.android.systemui.res.R
import com.android.systemui.window.data.repository.BlurAppliedListener
import com.android.systemui.window.data.repository.WindowRootViewBlurRepository
import javax.inject.Inject
@@ -45,6 +48,7 @@ class WindowRootViewBlurInteractor
@Inject
constructor(
    @Application private val applicationScope: CoroutineScope,
    @Main private val resources: Resources,
    keyguardInteractor: KeyguardInteractor,
    keyguardTransitionInteractor: KeyguardTransitionInteractor,
    private val communalInteractor: CommunalInteractor,
@@ -91,6 +95,10 @@ constructor(
     */
    val isBlurCurrentlySupported: StateFlow<Boolean> = repository.isBlurSupported

    /** Whether the blurred wallpaper is supported. This feature is disabled on desktop. */
    val isBlurredWallpaperSupported: Boolean =
        resources.getBoolean(R.bool.config_supportBlurredWallpaper)

    /** Radius of blur to be applied on the window root view. */
    val blurRadiusRequestedByShade: StateFlow<Float> = repository.blurRequestedByShade.asStateFlow()

+6 −2
Original line number Diff line number Diff line
@@ -137,8 +137,12 @@ constructor(
     * Whether this surface is opaque or transparent. This controls whether the alpha channel is
     * composited with the alpha channels from the surfaces below while rendering.
     */
    val isSurfaceOpaque =
        if (Flags.notificationShadeBlur()) flowOf(false) else shadeInteractor.isAnyFullyExpanded
    val isSurfaceOpaque: Flow<Boolean> =
        if (Flags.notificationShadeBlur() || !blurInteractor.isBlurredWallpaperSupported) {
            flowOf(false)
        } else {
            shadeInteractor.isAnyFullyExpanded
        }

    fun onBlurApplied(blurRadius: Int, isOpaque: Boolean) {
        if (isLoggable) {
+2 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.window.domain.interactor

import android.content.res.mainResources
import com.android.systemui.communal.domain.interactor.communalInteractor
import com.android.systemui.keyguard.domain.interactor.keyguardInteractor
import com.android.systemui.keyguard.domain.interactor.keyguardTransitionInteractor
@@ -27,6 +28,7 @@ val Kosmos.windowRootViewBlurInteractor by
    Kosmos.Fixture {
        WindowRootViewBlurInteractor(
            repository = windowRootViewBlurRepository,
            resources = mainResources,
            keyguardInteractor = keyguardInteractor,
            keyguardTransitionInteractor = keyguardTransitionInteractor,
            communalInteractor = communalInteractor,