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

Commit 941e613b authored by Jordan Demeulenaere's avatar Jordan Demeulenaere
Browse files

Remove SystemUI Compose build flag (2/4)

This CL removes the build configuration around the SystemUI Compose
build flag as well as all files that were used when the flag was
disabled, now that this flag is enabled by default on all SystemUI
variants.

I will remove the ComposeFacade in a follow-up CL.

Bug: 295304993
Test: mp droid
Flag: N/A
Change-Id: I6294e43c411aeaafb77a59b327ce9c4ead07fc95
parent bc9139ce
Loading
Loading
Loading
Loading
+22 −56
Original line number Diff line number Diff line
@@ -32,55 +32,6 @@ license {
    ],
}

// Opt-in configuration for code depending on Jetpack Compose.
soong_config_module_type {
    name: "systemui_compose_java_defaults",
    module_type: "java_defaults",
    config_namespace: "ANDROID",
    bool_variables: ["SYSTEMUI_USE_COMPOSE"],
    properties: [
        "srcs",
        "static_libs",
    ],
}

systemui_compose_java_defaults {
    name: "SystemUI_compose_defaults",
    soong_config_variables: {
        SYSTEMUI_USE_COMPOSE: {
            // Because files in compose/features/ depend on SystemUI
            // code, we compile those files when compiling SystemUI-core.
            // We also compile the ComposeFacade in
            // compose/facade/enabled/.
            srcs: [
                "compose/features/src/**/*.kt",
                "compose/facade/enabled/src/**/*.kt",
            ],

            // The dependencies needed by SystemUIComposeFeatures,
            // except for SystemUI-core.
            // Copied from compose/features/Android.bp.
            static_libs: [
                "PlatformComposeCore",
                "PlatformComposeSceneTransitionLayout",

                "androidx.compose.runtime_runtime",
                "androidx.compose.material3_material3",
                "androidx.compose.material_material-icons-extended",
                "androidx.activity_activity-compose",
                "androidx.compose.animation_animation-graphics",
            ],

            // By default, Compose is disabled and we compile the ComposeFacade
            // in compose/facade/disabled/.
            conditions_default: {
                srcs: ["compose/facade/disabled/src/**/*.kt"],
                static_libs: [],
            },
        },
    },
}

java_library {
    name: "SystemUI-proto",

@@ -138,14 +89,13 @@ android_library {

android_library {
    name: "SystemUI-core",
    defaults: [
        "SystemUI_compose_defaults",
    ],
    srcs: [
        "src/**/*.kt",
        "src/**/*.java",
        "src/**/I*.aidl",
        ":ReleaseJavaFiles",
        "compose/features/src/**/*.kt",
        "compose/facade/enabled/src/**/*.kt",
    ],
    product_variables: {
        debuggable: {
@@ -207,6 +157,13 @@ android_library {
        "LowLightDreamLib",
        "motion_tool_lib",
        "notification_flags_lib",
        "PlatformComposeCore",
        "PlatformComposeSceneTransitionLayout",
        "androidx.compose.runtime_runtime",
        "androidx.compose.material3_material3",
        "androidx.compose.material_material-icons-extended",
        "androidx.activity_activity-compose",
        "androidx.compose.animation_animation-graphics",
    ],
    libs: [
        "keepanno-annotations",
@@ -337,15 +294,19 @@ android_library {
        "ravenwood-junit",
        "platform-test-annotations",
        "notification_flags_lib",
        "PlatformComposeCore",
        "PlatformComposeSceneTransitionLayout",
        "androidx.compose.runtime_runtime",
        "androidx.compose.material3_material3",
        "androidx.compose.material_material-icons-extended",
        "androidx.activity_activity-compose",
        "androidx.compose.animation_animation-graphics",
    ],
}

android_library {
    name: "SystemUI-tests",
    use_resource_processor: true,
    defaults: [
        "SystemUI_compose_defaults",
    ],
    manifest: "tests/AndroidManifest-base.xml",
    additional_manifests: ["tests/AndroidManifest.xml"],
    srcs: [
@@ -357,6 +318,8 @@ android_library {
        ":ReleaseJavaFiles",
        ":SystemUI-tests-multivalent",
        ":SystemUI-tests-utils",
        "compose/features/src/**/*.kt",
        "compose/facade/enabled/src/**/*.kt",
    ],
    static_libs: [
        "SystemUI-tests-base",
@@ -367,6 +330,7 @@ android_library {
        "androidx.test.ext.truth",
        "kotlin-test",
        "SystemUICustomizationTestUtils",
        "androidx.compose.runtime_runtime",
    ],
    libs: [
        "android.test.runner",
@@ -396,7 +360,6 @@ android_app {
    defaults: [
        "platform_app_defaults",
        "SystemUI_optimized_defaults",
        "SystemUI_compose_defaults",
    ],
    manifest: "tests/AndroidManifest-base.xml",

@@ -405,9 +368,12 @@ android_app {
        "src/**/*.java",
        "src/**/I*.aidl",
        ":ReleaseJavaFiles",
        "compose/features/src/**/*.kt",
        "compose/facade/enabled/src/**/*.kt",
    ],
    static_libs: [
        "SystemUI-tests-base",
        "androidx.compose.runtime_runtime",
    ],
    libs: [
        "keepanno-annotations",
+0 −11
Original line number Diff line number Diff line
@@ -11,17 +11,6 @@
        }
      ]
    },
    {
      "name": "SystemUIComposeFeaturesTests",
      "options": [
        {
          "exclude-annotation": "org.junit.Ignore"
        },
        {
          "exclude-annotation": "androidx.test.filters.FlakyTest"
        }
      ]
    },
    {
      "name": "SystemUIComposeGalleryTests",
      "options": [
+0 −132
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package com.android.systemui.compose

import android.content.Context
import android.view.View
import android.view.WindowInsets
import androidx.activity.ComponentActivity
import androidx.lifecycle.LifecycleOwner
import com.android.systemui.bouncer.ui.BouncerDialogFactory
import com.android.systemui.bouncer.ui.viewmodel.BouncerViewModel
import com.android.systemui.communal.ui.viewmodel.BaseCommunalViewModel
import com.android.systemui.communal.ui.viewmodel.CommunalViewModel
import com.android.systemui.communal.widgets.WidgetConfigurator
import com.android.systemui.keyboard.stickykeys.ui.viewmodel.StickyKeysIndicatorViewModel
import com.android.systemui.keyguard.shared.model.LockscreenSceneBlueprint
import com.android.systemui.keyguard.ui.viewmodel.LockscreenContentViewModel
import com.android.systemui.people.ui.viewmodel.PeopleViewModel
import com.android.systemui.qs.footer.ui.viewmodel.FooterActionsViewModel
import com.android.systemui.scene.shared.model.Scene
import com.android.systemui.scene.shared.model.SceneDataSourceDelegator
import com.android.systemui.scene.shared.model.SceneKey
import com.android.systemui.scene.ui.viewmodel.SceneContainerViewModel
import com.android.systemui.volume.panel.ui.viewmodel.VolumePanelViewModel
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.StateFlow

/** The Compose facade, when Compose is *not* available. */
object ComposeFacade : BaseComposeFacade {
    override fun isComposeAvailable(): Boolean = false

    override fun composeInitializer(): ComposeInitializer {
        throwComposeUnavailableError()
    }

    override fun setPeopleSpaceActivityContent(
        activity: ComponentActivity,
        viewModel: PeopleViewModel,
        onResult: (PeopleViewModel.Result) -> Unit,
    ) {
        throwComposeUnavailableError()
    }

    override fun setCommunalEditWidgetActivityContent(
        activity: ComponentActivity,
        viewModel: BaseCommunalViewModel,
        widgetConfigurator: WidgetConfigurator,
        onOpenWidgetPicker: () -> Unit,
        onEditDone: () -> Unit,
    ) {
        throwComposeUnavailableError()
    }

    override fun setVolumePanelActivityContent(
        activity: ComponentActivity,
        viewModel: VolumePanelViewModel,
        onDismiss: () -> Unit,
    ) {
        throwComposeUnavailableError()
    }

    override fun createFooterActionsView(
        context: Context,
        viewModel: FooterActionsViewModel,
        qsVisibilityLifecycleOwner: LifecycleOwner
    ): View {
        throwComposeUnavailableError()
    }

    override fun createSceneContainerView(
        scope: CoroutineScope,
        context: Context,
        viewModel: SceneContainerViewModel,
        windowInsets: StateFlow<WindowInsets?>,
        sceneByKey: Map<SceneKey, Scene>,
        dataSourceDelegator: SceneDataSourceDelegator,
    ): View {
        throwComposeUnavailableError()
    }

    override fun createStickyKeysIndicatorContent(
        context: Context,
        viewModel: StickyKeysIndicatorViewModel
    ): View {
        throwComposeUnavailableError()
    }

    override fun createCommunalView(
        context: Context,
        viewModel: BaseCommunalViewModel,
    ): View {
        throwComposeUnavailableError()
    }

    override fun createCommunalContainer(context: Context, viewModel: CommunalViewModel): View {
        throwComposeUnavailableError()
    }

    override fun createBouncer(
        context: Context,
        viewModel: BouncerViewModel,
        dialogFactory: BouncerDialogFactory,
    ): View = throwComposeUnavailableError()

    override fun createLockscreen(
        context: Context,
        viewModel: LockscreenContentViewModel,
        blueprints: Set<@JvmSuppressWildcards LockscreenSceneBlueprint>,
    ): View = throwComposeUnavailableError()

    private fun throwComposeUnavailableError(): Nothing {
        error(
            "Compose is not available. Make sure to check isComposeAvailable() before calling any" +
                " other function on ComposeFacade."
        )
    }
}
+0 −21
Original line number Diff line number Diff line
/*
 * Copyright 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.scene

import dagger.Module

@Module interface BouncerSceneModule
+0 −21
Original line number Diff line number Diff line
/*
 * Copyright 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.scene

import dagger.Module

@Module interface CommunalSceneModule
Loading