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

Commit 3c1dd6f9 authored by Colin Cross's avatar Colin Cross
Browse files

Fix SettingsProvider for use_resource_processor: true

Compile the SettingsProvider sources and resources once in an
android_library instead of separately in SettingsProvider and
SettingsProviderTest so that the resources are only compiled with
one package name and can always be referenced via that package.

Bug: 294256649
Test: m javac-check
Change-Id: I085c45b130ff1d2fc2726d2b9ecd237abe1db033
parent 8d46e51f
Loading
Loading
Loading
Loading
+17 −22
Original line number Original line Diff line number Diff line
@@ -17,9 +17,10 @@ license {
    ],
    ],
}
}


android_app {
android_library {
    name: "SettingsProvider",
    name: "SettingsProviderLib",
    defaults: ["platform_app_defaults"],
    defaults: ["platform_app_defaults"],
    manifest: "AndroidManifestLib.xml",
    resource_dirs: ["res"],
    resource_dirs: ["res"],
    srcs: [
    srcs: [
        "src/**/*.java",
        "src/**/*.java",
@@ -32,38 +33,37 @@ android_app {
    ],
    ],
    static_libs: [
    static_libs: [
        "device_config_service_flags_java",
        "device_config_service_flags_java",
        "junit",
        "SettingsLibDeviceStateRotationLock",
        "SettingsLibDeviceStateRotationLock",
        "SettingsLibDisplayUtils",
        "SettingsLibDisplayUtils",
    ],
    ],
    platform_apis: true,
    platform_apis: true,
}

android_app {
    name: "SettingsProvider",
    defaults: ["platform_app_defaults"],
    resource_dirs: [],
    static_libs: ["SettingsProviderLib"],
    platform_apis: true,
    certificate: "platform",
    certificate: "platform",
    privileged: true,
    privileged: true,
}
}


android_test {
android_test {
    name: "SettingsProviderTest",
    name: "SettingsProviderTest",
    // Note we statically link several classes to do some unit tests.  It's not accessible otherwise
    // because this test is not an instrumentation test. (because the target runs in the system process.)
    srcs: [
    srcs: [
        "test/**/*.java",
        "test/**/*.java",
        "src/android/provider/settings/backup/*",
        "src/android/provider/settings/validators/*",
        "src/com/android/providers/settings/GenerationRegistry.java",
        "src/com/android/providers/settings/SettingsBackupAgent.java",
        "src/com/android/providers/settings/SettingsState.java",
        "src/com/android/providers/settings/SettingsHelper.java",
        "src/com/android/providers/settings/WifiSoftApConfigChangedNotifier.java",
    ],
    ],
    static_libs: [
    static_libs: [
        // Note we statically link SettingsProviderLib to do some unit tests.  It's not accessible otherwise
        // because this test is not an instrumentation test. (because the target runs in the system process.)
        "SettingsProviderLib",

        "androidx.test.rules",
        "androidx.test.rules",
        "device_config_service_flags_java",
        "flag-junit",
        "flag-junit",
        "junit",
        "mockito-target-minus-junit4",
        "mockito-target-minus-junit4",
        "platform-test-annotations",
        "platform-test-annotations",
        "SettingsLibDeviceStateRotationLock",
        "SettingsLibDisplayUtils",
        "platform-test-annotations",
        "truth",
        "truth",
    ],
    ],
    libs: [
    libs: [
@@ -71,12 +71,7 @@ android_test {
        "android.test.mock",
        "android.test.mock",
        "unsupportedappusage",
        "unsupportedappusage",
    ],
    ],
    resource_dirs: ["res"],
    resource_dirs: [],
    aaptflags: [
        "--auto-add-overlay",
        "--extra-packages",
        "com.android.providers.settings",
    ],
    platform_apis: true,
    platform_apis: true,
    certificate: "platform",
    certificate: "platform",
    test_suites: ["device-tests"],
    test_suites: ["device-tests"],
+2 −0
Original line number Original line Diff line number Diff line
<manifest package="com.android.providers.settings">
</manifest>