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

Commit 326d1390 authored by Jordan Demeulenaere's avatar Jordan Demeulenaere
Browse files

Hide Flexiglass Compose code behind a constant Boolean flag

This CL adds an additional SCENE_CONTAINER_ENABLED flag on top of the
existing SCENE_CONTAINER flag that has to be flipped in source code when
developping to enable Flexiglass. This is necessary so that we can
enable our existing Compose features without paying the apk size cost of
Flexiglass (see comments of http://ag/24151185 for details).

Bug: 238993727
Test: Manual, checked the size of our userdebug APK with and without the
flag.
Change-Id: If9788a535a6f56b7f3aa44563d2c86e7c20bc687
parent 8a06c701
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -636,7 +636,13 @@ object Flags {
    val CLIPBOARD_SHARED_TRANSITIONS =
            unreleasedFlag("clipboard_shared_transitions", teamfood = true)

    /**
     * Whether the scene container (Flexiglass) is enabled. Note that [SCENE_CONTAINER] should be
     * checked and toggled together with [SCENE_CONTAINER_ENABLED] so that ProGuard can remove
     * unused code from our APK at compile time.
     */
    // TODO(b/283300105): Tracking Bug
    @JvmField val SCENE_CONTAINER_ENABLED = false
    @JvmField val SCENE_CONTAINER = unreleasedFlag("scene_container")

    // 1900
+3 −1
Original line number Diff line number Diff line
@@ -77,7 +77,9 @@ abstract class ShadeViewProviderModule {
            layoutInsetController: NotificationInsetsController,
        ): WindowRootView {
            return if (
                featureFlags.isEnabled(Flags.SCENE_CONTAINER) && ComposeFacade.isComposeAvailable()
                Flags.SCENE_CONTAINER_ENABLED &&
                    featureFlags.isEnabled(Flags.SCENE_CONTAINER) &&
                    ComposeFacade.isComposeAvailable()
            ) {
                val sceneWindowRootView =
                    layoutInflater.inflate(R.layout.scene_window_root, null) as SceneWindowRootView