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

Commit 016b4dae authored by Jordan Demeulenaere's avatar Jordan Demeulenaere Committed by Android (Google) Code Review
Browse files

Merge "Remove SystemUI Compose build flag (2/4)" into main

parents 4c56cf75 941e613b
Loading
Loading
Loading
Loading
+22 −56
Original line number Original line 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 {
java_library {
    name: "SystemUI-proto",
    name: "SystemUI-proto",


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


android_library {
android_library {
    name: "SystemUI-core",
    name: "SystemUI-core",
    defaults: [
        "SystemUI_compose_defaults",
    ],
    srcs: [
    srcs: [
        "src/**/*.kt",
        "src/**/*.kt",
        "src/**/*.java",
        "src/**/*.java",
        "src/**/I*.aidl",
        "src/**/I*.aidl",
        ":ReleaseJavaFiles",
        ":ReleaseJavaFiles",
        "compose/features/src/**/*.kt",
        "compose/facade/enabled/src/**/*.kt",
    ],
    ],
    product_variables: {
    product_variables: {
        debuggable: {
        debuggable: {
@@ -207,6 +157,13 @@ android_library {
        "LowLightDreamLib",
        "LowLightDreamLib",
        "motion_tool_lib",
        "motion_tool_lib",
        "notification_flags_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: [
    libs: [
        "keepanno-annotations",
        "keepanno-annotations",
@@ -337,15 +294,19 @@ android_library {
        "ravenwood-junit",
        "ravenwood-junit",
        "platform-test-annotations",
        "platform-test-annotations",
        "notification_flags_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",
    ],
    ],
}
}


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


@@ -405,9 +368,12 @@ android_app {
        "src/**/*.java",
        "src/**/*.java",
        "src/**/I*.aidl",
        "src/**/I*.aidl",
        ":ReleaseJavaFiles",
        ":ReleaseJavaFiles",
        "compose/features/src/**/*.kt",
        "compose/facade/enabled/src/**/*.kt",
    ],
    ],
    static_libs: [
    static_libs: [
        "SystemUI-tests-base",
        "SystemUI-tests-base",
        "androidx.compose.runtime_runtime",
    ],
    ],
    libs: [
    libs: [
        "keepanno-annotations",
        "keepanno-annotations",
+0 −11
Original line number Original line 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",
      "name": "SystemUIComposeGalleryTests",
      "options": [
      "options": [
+0 −132
Original line number Original line 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 Original line 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 Original line 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