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

Commit fc8d622f authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Remove shade window goes around from desktop windowing dev flag

This flag will be part of it later

Bug: 362719719
Bug: 414707538
Test: enable dev option, check shade does not go around
Flag: com.android.systemui.shade_window_goes_around
Change-Id: I9d1d4fadf571d2b2bdc1cfb9ba140b41885421ca
parent 198c0c89
Loading
Loading
Loading
Loading
+6 −20
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ 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

/** Helper for reading or using the shade window goes around flag state. */
@@ -27,24 +26,21 @@ object ShadeWindowGoesAround {
    /** The aconfig flag name */
    const val FLAG_NAME = Flags.FLAG_SHADE_WINDOW_GOES_AROUND

    /** A token used for dependency declaration */
    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.
     * When true, 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
     * ```
     */
    private const val ENABLED_BY_DESKTOP_EXPERIENCE_DEV_OPTION = false

    val FLAG =
        DesktopExperienceFlags.DesktopExperienceFlag(
            Flags::shadeWindowGoesAround,
            /* shouldOverrideByDevOption= */ true,
            /* shouldOverrideByDevOption= */ ENABLED_BY_DESKTOP_EXPERIENCE_DEV_OPTION,
            Flags.FLAG_SHADE_WINDOW_GOES_AROUND,
        )

@@ -62,16 +58,6 @@ object ShadeWindowGoesAround {
    inline fun isUnexpectedlyInLegacyMode() =
        RefactorFlagUtils.isUnexpectedlyInLegacyMode(isEnabled, FLAG_NAME)

    /**
     * Called to ensure code is only run when the flag is enabled. This will throw an exception if
     * the flag is not enabled to ensure that the refactor author catches issues in testing.
     * Caution!! Using this check incorrectly will cause crashes in nextfood builds!
     */
    @JvmStatic
    @Deprecated("Avoid crashing.", ReplaceWith("if (this.isUnexpectedlyInLegacyMode()) return"))
    inline fun unsafeAssertInNewMode() =
        RefactorFlagUtils.unsafeAssertInNewMode(isEnabled, FLAG_NAME)

    /**
     * Called to ensure code is only run when the flag is disabled. This will throw an exception if
     * the flag is enabled to ensure that the refactor author catches issues in testing.