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

Commit 1189e8b1 authored by Colin Cross's avatar Colin Cross
Browse files

Build DocumentsUI sources once

Put all the DocumentsUI sources and resources into an android_library
so that they are only built once and can always use a single package
name to refer to the resources once use_resource_processor: true is
enabled.

Bug: 294256649
Test: DocumentsUI DocumentsUIGoogle DocumentsUITests DocumentsUIUnitTests
Change-Id: I97387234c9e90fa2a68b9ee7e013dbb0f15c04ca
parent cfcf929d
Loading
Loading
Loading
Loading
+8 −54
Original line number Diff line number Diff line
@@ -68,14 +68,6 @@ platform_compat_config {
    src: ":DocumentsUI",
}

filegroup {
    name: "DocumentsUI-srcs",
    srcs: [
        "src/**/*.java",
	":statslog-docsui-java-gen",
    ],
}

java_library {
    name: "docsui-statsd",
    srcs: [
@@ -93,51 +85,18 @@ genrule {
}

android_library {
    name: "DocumentsUI-res-lib",

    manifest: "AndroidManifest.xml",

    static_libs: [
        "androidx.appcompat_appcompat",
        "com.google.android.material_material",
    ],

    resource_dirs: [
        "res",
    ],

    aaptflags: [
        "--auto-add-overlay",
    ],

    sdk_version: "system_current",
    target_sdk_version: "33",
    min_sdk_version: "29",
    lint: { strict_updatability_linting: true }
}

android_library {
    name: "DocumentsUIUnitTests-res-lib",

    manifest: "AndroidManifestForUnitTests.xml",
    name: "DocumentsUI-lib",
    defaults: ["documentsui_defaults"],

    static_libs: [
        "androidx.appcompat_appcompat",
        "com.google.android.material_material",
        "modules-utils-build_system",
    ],
    manifest: "AndroidManifestLib.xml",

    resource_dirs: [
        "res",
    ],

    licenses: [
        "Android-Apache-2.0",
        "packages_apps_DocumentsUI_res_drawable_pd_license",
    ],

    aaptflags: [
        "--auto-add-overlay",
    srcs: [
        "src/**/*.java",
	":statslog-docsui-java-gen",
    ],

    sdk_version: "system_current",
@@ -153,13 +112,8 @@ android_app {

    manifest: "AndroidManifest.xml",

    srcs: [
        ":DocumentsUI-srcs",
    ],

    resource_dirs: [
        "res",
    ],
    static_libs: ["DocumentsUI-lib"],
    resource_dirs: [],

    licenses: [
        "Android-Apache-2.0",
+0 −0

File moved.

+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@ android_test {
    manifest: "AndroidManifest.xml",

    srcs: [
        ":DocumentsUIPerfTests-files",
        "src/**/*.java",
    ],

@@ -23,6 +22,7 @@ android_test {
    ],

    static_libs: [
        "DocumentsUIPerfTests-lib",
        "androidx.legacy_legacy-support-v4",
        "androidx.test.rules",
        "androidx.test.espresso.core",
+2 −1
Original line number Diff line number Diff line
@@ -79,7 +79,8 @@ public class ActionModeController extends SelectionObserver<String>
                    Log.d(TAG, "Starting action mode.");
                }
                mActionMode = mActivity.startActionMode(this);
                final View closeButton = mActivity.findViewById(R.id.action_mode_close_button);
                final View closeButton =
                        mActivity.findViewById(androidx.appcompat.R.id.action_mode_close_button);
                if (closeButton != null) {
                    closeButton.setContentDescription(mActivity.getString(android.R.string.cancel));
                }
+2 −1
Original line number Diff line number Diff line
@@ -141,7 +141,8 @@ public class NavigationViewManager implements AppBarLayout.OnOffsetChangedListen
        // move directory_header out of the AppBarLayout.

        Window window = mActivity.getWindow();
        View actionBar = window.getDecorView().findViewById(R.id.action_mode_bar);
        View actionBar =
                window.getDecorView().findViewById(androidx.appcompat.R.id.action_mode_bar);
        int dynamicHeaderColor = ContextCompat.getColor(mActivity,
                offset == 0 ? mDefaultStatusBarColorResId : R.color.color_surface_header);
        if (actionBar != null) {
Loading