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

Commit 1b0b29b4 authored by Matthew Mourgos's avatar Matthew Mourgos
Browse files

Avoid adding DesktopWallpaperActivity to show home behind desktop

Bug: 375644149
Flag: com.android.window.flags.show_home_behind_desktop
Test: enter desktop, open a freeform task, verify that no desktop
wallpaper activity shown.

Change-Id: Ieed31ea8d0dec4dc0c432f4232706e7694d7ae45
parent 0d3728a1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -7383,6 +7383,9 @@
         screen. -->
    <bool name="config_dragToMaximizeInDesktopMode">false</bool>

    <!-- Whether the home screen should be shown behind freeform tasks in desktop mode. -->
    <bool name="config_showHomeBehindDesktop">false</bool>

    <!-- Frame rate compatibility value for Wallpaper
         FRAME_RATE_COMPATIBILITY_MIN (102) is used by default for lower power consumption -->
    <integer name="config_wallpaperFrameRateCompatibility">102</integer>
+3 −0
Original line number Diff line number Diff line
@@ -5846,6 +5846,9 @@
       screen. -->
  <java-symbol type="bool" name="config_dragToMaximizeInDesktopMode" />

  <!-- Whether the home screen should be shown behind freeform tasks in desktop mode. -->
  <java-symbol type="bool" name="config_showHomeBehindDesktop" />

  <!-- Frame rate compatibility value for Wallpaper -->
  <java-symbol type="integer" name="config_wallpaperFrameRateCompatibility" />

+5 −0
Original line number Diff line number Diff line
@@ -89,6 +89,11 @@ interface DesktopState {
     */
    val isFreeformEnabled: Boolean

    /**
     * Whether the home screen should be shown behind freeform tasks in the desktop.
     */
    val shouldShowHomeBehindDesktop: Boolean

    companion object {
        /** Creates a new [DesktopState] from a context. */
        @JvmStatic
+5 −0
Original line number Diff line number Diff line
@@ -144,6 +144,11 @@ class DesktopStateImpl(context: Context) : DesktopState {
        ) != 0
    override val isFreeformEnabled: Boolean = hasFreeformFeature || hasFreeformDevOption

    override val shouldShowHomeBehindDesktop: Boolean =
        Flags.showHomeBehindDesktop() && context.resources.getBoolean(
            R.bool.config_showHomeBehindDesktop
        )

    companion object {
        @VisibleForTesting
        const val ENFORCE_DEVICE_RESTRICTIONS_SYS_PROP =
+2 −1
Original line number Diff line number Diff line
@@ -1891,7 +1891,8 @@ class DesktopTasksController(
        // Currently, we only handle the desktop on the default display really.
        if (
            (displayId == DEFAULT_DISPLAY || Flags.enablePerDisplayDesktopWallpaperActivity()) &&
                ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY.isTrue()
                ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY.isTrue() &&
                !desktopState.shouldShowHomeBehindDesktop
        ) {
            // Add translucent wallpaper activity to show the wallpaper underneath.
            addWallpaperActivity(displayId, wct)
Loading