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

Commit 670655c8 authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Use DesktopExperienceFlag for ShadeWindowGoesAround

This allows to enable it with all other flags from the dev setting.

Note that the shade will not move even if the flag is enabled unless the
user selects a "shade display policy" from dev settings or with the adb
command.

Bug: 362719719
Test: The flag gets enabled with the dev option
Flag: com.android.systemui.shade_window_goes_around
Change-Id: Ie4716026588b1bd164ef8f04673c009a9dceb4d1
parent b52e5663
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.shade.shared.flag

import android.window.DesktopExperienceFlags
import com.android.systemui.Flags
import com.android.systemui.flags.FlagToken
import com.android.systemui.flags.RefactorFlagUtils
@@ -30,10 +31,26 @@ object ShadeWindowGoesAround {
    val token: FlagToken
        get() = FlagToken(FLAG_NAME, isEnabled)

    /**
     * This is defined as [DesktopExperienceFlags] to make it possible to enable it together with
     * all the other desktop experience flags from the dev settings.
     *
     * Alternatively, using adb:
     * ```bash
     * adb shell aflags enable com.android.window.flags.show_desktop_experience_dev_option && \
     *   adb shell setprop persist.wm.debug.desktop_experience_devopts 1
     * ```
     */
    val FLAG =
        DesktopExperienceFlags.DesktopExperienceFlag(
            Flags::shadeWindowGoesAround,
            /* shouldOverrideByDevOption= */ true,
        )

    /** Is the refactor enabled */
    @JvmStatic
    inline val isEnabled: Boolean
        get() = Flags.shadeWindowGoesAround()
        get() = FLAG.isTrue

    /**
     * Called to ensure code is only run when the flag is enabled. This protects users from the