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

Commit 04734194 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.

This relands I97387234c9e90fa2a68b9ee7e013dbb0f15c04ca with a fix to
export DocumentsUIManifestLib including the AndroidManifest.xml for
merging into DocumentsUIGoogle and ArcDocumentsUI.

Bug: 294256649
Test: DocumentsUI DocumentsUIGoogle DocumentsUITests DocumentsUIUnitTests
Change-Id: I9b0caf2d63fdb00321391d4b50a0bee5f00bbc41
parent 806bb929
Loading
Loading
Loading
Loading
+15 −42
Original line number Diff line number Diff line
@@ -70,14 +70,6 @@ platform_compat_config {
    src: ":DocumentsUI",
}

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

java_library {
    name: "docsui-statsd",
    srcs: [
@@ -98,14 +90,10 @@ genrule {
}

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

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

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

    resource_dirs: [
        "res",
@@ -115,6 +103,11 @@ android_library {
        "--auto-add-overlay",
    ],

    srcs: [
        "src/**/*.java",
        ":statslog-docsui-java-gen",
    ],

    sdk_version: "system_current",
    target_sdk_version: "33",
    min_sdk_version: "29",
@@ -125,28 +118,13 @@ android_library {
}

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

    manifest: "AndroidManifestForUnitTests.xml",

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

    resource_dirs: [
        "res",
    ],
    name: "DocumentsUIManifestLib",
    defaults: ["documentsui_defaults"],

    licenses: [
        "Android-Apache-2.0",
        "packages_apps_DocumentsUI_res_drawable_pd_license",
    ],
    manifest: "AndroidManifest.xml",

    aaptflags: [
        "--auto-add-overlay",
    ],
    resource_dirs: [],
    libs: ["DocumentsUI-lib"],

    sdk_version: "system_current",
    target_sdk_version: "33",
@@ -164,13 +142,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