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

Commit 02198d0c authored by Josh Tsuji's avatar Josh Tsuji
Browse files

Pseudo-merge scene_container and keyguard_wm_state_refactor.

scene_container depends on keyguard_wm_state_refactor, but keyguard_wm_state_refactor does not need scene_container (ouch).

We would like to continue attempting to roll out keyguard_wm_state_refactor independently of scene_container, in case that flag is further delayed, but we also don't want to end up in a situation where scene_container is in STAGING without keyguard_wm_state_refactor. This is the simplest way to make that possible.

Bug: 278086361
Test: enable scene_container, keyguard_wm_state_refactor, both, neither
Flag: com.android.systemui.keyguard_wm_state_refactor
Change-Id: I200c946965676fcf403f8b69b6dc392164955fd5
parent 18516fda
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -20,7 +20,16 @@ import com.android.systemui.Flags
import com.android.systemui.flags.FlagToken
import com.android.systemui.flags.RefactorFlagUtils

/** Helper for reading or using the keyguard wm state refactor flag state. */
/**
 * Helper for reading or using the keyguard_wm_state_refactor flag state.
 *
 * keyguard_wm_state_refactor works both with and without flexiglass (scene_container), but
 * flexiglass requires keyguard_wm_state_refactor. For this reason, this class will return isEnabled
 * if either keyguard_wm_state_refactor OR scene_container are enabled. This enables us to roll out
 * keyguard_wm_state_refactor independently of scene_container, while also ensuring that
 * scene_container rolling out ahead of keyguard_wm_state_refactor causes code gated by
 * KeyguardWmStateRefactor to be enabled as well.
 */
@Suppress("NOTHING_TO_INLINE")
object KeyguardWmStateRefactor {
    /** The aconfig flag name */
@@ -30,10 +39,9 @@ object KeyguardWmStateRefactor {
    val token: FlagToken
        get() = FlagToken(FLAG_NAME, isEnabled)

    /** Is the refactor enabled */
    @JvmStatic
    inline val isEnabled
        get() = Flags.keyguardWmStateRefactor()
        get() = Flags.keyguardWmStateRefactor() || Flags.sceneContainer()

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