Merge "Replace the ArtThinBuild.bp files with patches that gets applied instead." into main
diff --git a/mainline/local_riscv64/prebuilts/module_sdk/StatsD/current/Android.bp.patch b/mainline/local_riscv64/prebuilts/module_sdk/StatsD/current/Android.bp.patch
new file mode 100644
index 0000000..104fe7f
--- /dev/null
+++ b/mainline/local_riscv64/prebuilts/module_sdk/StatsD/current/Android.bp.patch
@@ -0,0 +1,20 @@
+diff --git i/current/Android.bp w/current/Android.bp
+index d82af96e..34a6bd6f 100644
+--- i/current/Android.bp
++++ w/current/Android.bp
+@@ -1,4 +1,4 @@
+-// This is auto-generated. DO NOT EDIT.
++// DO NOT COMMIT. Changes in this file are temporary and generated by art/tools/buildbot-build.sh. See b/286551985.
+ 
+ // blueprint rules added by vendor/google/build/mainline_modules_sdks.py
+ // to support coexistence.
+@@ -174,6 +174,9 @@ cc_prebuilt_library_shared {
+         arm64: {
+             srcs: ["arm64/lib/libstatssocket.so"],
+         },
++        riscv64: {
++            srcs: ["riscv64/lib/libstatssocket.so"],
++        },
+         x86_64: {
+             srcs: ["x86_64/lib/libstatssocket.so"],
+         },
diff --git a/mainline/local_riscv64/prebuilts/module_sdk/StatsD/current/ArtThinBuild.bp b/mainline/local_riscv64/prebuilts/module_sdk/StatsD/current/ArtThinBuild.bp
deleted file mode 100644
index 1bff947..0000000
--- a/mainline/local_riscv64/prebuilts/module_sdk/StatsD/current/ArtThinBuild.bp
+++ /dev/null
@@ -1,158 +0,0 @@
-// DO NOT COMMIT. Changes in this file are temporary and generated by art/tools/buildbot-build.sh. See b/286551985.
-
-package {
-    // A default list here prevents the license LSC from adding its own list which would
-    // be unnecessary as every module in the sdk already has its own licenses property.
-    default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
-prebuilt_bootclasspath_fragment {
-    name: "com.android.os.statsd-bootclasspath-fragment",
-    // Do not prefer prebuilt if the Soong config variable "module_build_from_source" in namespace "ANDROID" is true.
-    use_source_config_var: {
-        config_namespace: "ANDROID",
-        var_name: "module_build_from_source",
-    },
-    visibility: ["//visibility:public"],
-    apex_available: ["com.android.os.statsd"],
-    licenses: ["statsd-module-sdk_Android-Apache-2.0"],
-    contents: ["framework-statsd"],
-    fragments: [
-        {
-            apex: "com.android.art",
-            module: "art-bootclasspath-fragment",
-        },
-    ],
-    hidden_api: {
-        max_target_o_low_priority: ["hiddenapi/hiddenapi-max-target-o-low-priority.txt"],
-        annotation_flags: "hiddenapi/annotation-flags.csv",
-        metadata: "hiddenapi/metadata.csv",
-        index: "hiddenapi/index.csv",
-        signature_patterns: "hiddenapi/signature-patterns.csv",
-        filtered_stub_flags: "hiddenapi/filtered-stub-flags.csv",
-        filtered_flags: "hiddenapi/filtered-flags.csv",
-    },
-}
-
-java_sdk_library_import {
-    name: "framework-statsd",
-    // Do not prefer prebuilt if the Soong config variable "module_build_from_source" in namespace "ANDROID" is true.
-    use_source_config_var: {
-        config_namespace: "ANDROID",
-        var_name: "module_build_from_source",
-    },
-    visibility: ["//visibility:public"],
-    apex_available: [
-        "com.android.os.statsd",
-        "test_com.android.os.statsd",
-    ],
-    licenses: ["statsd-module-sdk_Android-Apache-2.0"],
-    shared_library: false,
-    permitted_packages: [
-        "android.app",
-        "android.os",
-        "android.util",
-        "com.android.internal.statsd",
-    ],
-    public: {
-        jars: ["sdk_library/public/framework-statsd-stubs.jar"],
-        stub_srcs: ["sdk_library/public/framework-statsd.srcjar"],
-        current_api: "sdk_library/public/framework-statsd.txt",
-        removed_api: "sdk_library/public/framework-statsd-removed.txt",
-        annotations: "sdk_library/public/framework-statsd_annotations.zip",
-        sdk_version: "module_current",
-    },
-    system: {
-        jars: ["sdk_library/system/framework-statsd-stubs.jar"],
-        stub_srcs: ["sdk_library/system/framework-statsd.srcjar"],
-        current_api: "sdk_library/system/framework-statsd.txt",
-        removed_api: "sdk_library/system/framework-statsd-removed.txt",
-        annotations: "sdk_library/system/framework-statsd_annotations.zip",
-        sdk_version: "module_current",
-    },
-    module_lib: {
-        jars: ["sdk_library/module-lib/framework-statsd-stubs.jar"],
-        stub_srcs: ["sdk_library/module-lib/framework-statsd.srcjar"],
-        current_api: "sdk_library/module-lib/framework-statsd.txt",
-        removed_api: "sdk_library/module-lib/framework-statsd-removed.txt",
-        annotations: "sdk_library/module-lib/framework-statsd_annotations.zip",
-        sdk_version: "module_current",
-    },
-}
-
-java_import {
-    name: "service-statsd",
-    // Do not prefer prebuilt if the Soong config variable "module_build_from_source" in namespace "ANDROID" is true.
-    use_source_config_var: {
-        config_namespace: "ANDROID",
-        var_name: "module_build_from_source",
-    },
-    visibility: ["//visibility:public"],
-    apex_available: [
-        "com.android.os.statsd",
-        "test_com.android.os.statsd",
-    ],
-    licenses: ["statsd-module-sdk_Android-Apache-2.0"],
-    jars: ["java_systemserver_libs/snapshot/jars/are/invalid/service-statsd.jar"],
-}
-
-license {
-    name: "statsd-module-sdk_Android-Apache-2.0",
-    visibility: ["//visibility:private"],
-    license_kinds: ["SPDX-license-identifier-Apache-2.0"],
-    license_text: ["licenses/build/soong/licenses/LICENSE"],
-}
-
-cc_prebuilt_library_shared {
-    name: "libstatssocket",
-    // Do not prefer prebuilt if the Soong config variable "module_build_from_source" in namespace "ANDROID" is true.
-    use_source_config_var: {
-        config_namespace: "ANDROID",
-        var_name: "module_build_from_source",
-    },
-    visibility: ["//visibility:public"],
-    apex_available: [
-        "com.android.os.statsd",
-        "test_com.android.os.statsd",
-    ],
-    licenses: ["statsd-module-sdk_Android-Apache-2.0"],
-    stl: "libc++_static",
-    compile_multilib: "both",
-    export_include_dirs: ["include/packages/modules/StatsD/lib/libstatssocket/include"],
-    stubs: {
-        versions: [
-            "30",
-            "current",
-        ],
-    },
-    arch: {
-        arm64: {
-            srcs: ["arm64/lib/libstatssocket.so"],
-        },
-        riscv64: {
-            srcs: ["riscv64/lib/libstatssocket.so"],
-        },
-        x86_64: {
-            srcs: ["x86_64/lib/libstatssocket.so"],
-        },
-        arm: {
-            srcs: ["arm/lib/libstatssocket.so"],
-        },
-        x86: {
-            srcs: ["x86/lib/libstatssocket.so"],
-        },
-    },
-}
-
-prebuilt_systemserverclasspath_fragment {
-    name: "com.android.os.statsd-systemserverclasspath-fragment",
-    // Do not prefer prebuilt if the Soong config variable "module_build_from_source" in namespace "ANDROID" is true.
-    use_source_config_var: {
-        config_namespace: "ANDROID",
-        var_name: "module_build_from_source",
-    },
-    visibility: ["//visibility:public"],
-    apex_available: ["com.android.os.statsd"],
-    licenses: ["statsd-module-sdk_Android-Apache-2.0"],
-    standalone_contents: ["service-statsd"],
-}
diff --git a/mainline/local_riscv64/prebuilts/module_sdk/conscrypt/current/Android.bp.patch b/mainline/local_riscv64/prebuilts/module_sdk/conscrypt/current/Android.bp.patch
new file mode 100644
index 0000000..b0a696b
--- /dev/null
+++ b/mainline/local_riscv64/prebuilts/module_sdk/conscrypt/current/Android.bp.patch
@@ -0,0 +1,20 @@
+diff --git i/current/Android.bp w/current/Android.bp
+index b9c13893..5a1d211e 100644
+--- i/current/Android.bp
++++ w/current/Android.bp
+@@ -1,4 +1,4 @@
+-// This is auto-generated. DO NOT EDIT.
++// DO NOT COMMIT. Changes in this file are temporary and generated by art/tools/buildbot-build.sh. See b/286551985.
+ 
+ // blueprint rules added by vendor/google/build/mainline_modules_sdks.py
+ // to support coexistence.
+@@ -199,6 +199,9 @@ cc_prebuilt_library_shared {
+         arm64: {
+             srcs: ["arm64/lib/libconscrypt_jni.so"],
+         },
++        riscv64: {
++            srcs: ["riscv64/lib/libconscrypt_jni.so"],
++        },
+         x86_64: {
+             srcs: ["x86_64/lib/libconscrypt_jni.so"],
+         },
diff --git a/mainline/local_riscv64/prebuilts/module_sdk/conscrypt/current/ArtThinBuild.bp b/mainline/local_riscv64/prebuilts/module_sdk/conscrypt/current/ArtThinBuild.bp
deleted file mode 100644
index ea4b76b..0000000
--- a/mainline/local_riscv64/prebuilts/module_sdk/conscrypt/current/ArtThinBuild.bp
+++ /dev/null
@@ -1,209 +0,0 @@
-// DO NOT COMMIT. Changes in this file are temporary and generated by art/tools/buildbot-build.sh. See b/286551985.
-
-package {
-    // A default list here prevents the license LSC from adding its own list which would
-    // be unnecessary as every module in the sdk already has its own licenses property.
-    default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
-prebuilt_bootclasspath_fragment {
-    name: "com.android.conscrypt-bootclasspath-fragment",
-    // Do not prefer prebuilt if the Soong config variable "module_build_from_source" in namespace "ANDROID" is true.
-    use_source_config_var: {
-        config_namespace: "ANDROID",
-        var_name: "module_build_from_source",
-    },
-    visibility: ["//external/conscrypt:__subpackages__"],
-    apex_available: ["com.android.conscrypt"],
-    licenses: ["conscrypt-module-sdk_external_conscrypt_license"],
-    contents: ["conscrypt"],
-    fragments: [
-        {
-            apex: "com.android.art",
-            module: "art-bootclasspath-fragment",
-        },
-    ],
-    api: {
-        stub_libs: ["conscrypt.module.public.api"],
-    },
-    core_platform_api: {
-        stub_libs: ["conscrypt.module.platform.api"],
-    },
-    hidden_api: {
-        max_target_o_low_priority: ["hiddenapi/hiddenapi-max-target-o-low-priority.txt"],
-        annotation_flags: "hiddenapi/annotation-flags.csv",
-        metadata: "hiddenapi/metadata.csv",
-        index: "hiddenapi/index.csv",
-        signature_patterns: "hiddenapi/signature-patterns.csv",
-        filtered_stub_flags: "hiddenapi/filtered-stub-flags.csv",
-        filtered_flags: "hiddenapi/filtered-flags.csv",
-    },
-}
-
-java_import {
-    name: "conscrypt",
-    // Do not prefer prebuilt if the Soong config variable "module_build_from_source" in namespace "ANDROID" is true.
-    use_source_config_var: {
-        config_namespace: "ANDROID",
-        var_name: "module_build_from_source",
-    },
-    visibility: [
-        "//device:__subpackages__",
-        "//external/conscrypt:__subpackages__",
-        "//system/apex/tests",
-    ],
-    apex_available: [
-        "com.android.conscrypt",
-        "test_com.android.conscrypt",
-    ],
-    licenses: ["conscrypt-module-sdk_external_conscrypt_license"],
-    jars: ["java_boot_libs/snapshot/jars/are/invalid/conscrypt.jar"],
-    permitted_packages: [
-        "android.net.ssl",
-        "com.android.org.conscrypt",
-    ],
-}
-
-java_sdk_library_import {
-    name: "conscrypt.module.public.api",
-    // Do not prefer prebuilt if the Soong config variable "module_build_from_source" in namespace "ANDROID" is true.
-    use_source_config_var: {
-        config_namespace: "ANDROID",
-        var_name: "module_build_from_source",
-    },
-    visibility: [
-        "//build/soong/java/core-libraries",
-        "//external/conscrypt",
-        "//frameworks/base",
-        "//frameworks/base/api",
-        "//libcore",
-        "//packages/modules/IPsec",
-        "//packages/modules/common/sdk",
-        "//prebuilts:__subpackages__",
-    ],
-    apex_available: ["//apex_available:platform"],
-    licenses: ["conscrypt-module-sdk_external_conscrypt_license"],
-    shared_library: false,
-    public: {
-        jars: ["sdk_library/public/conscrypt.module.public.api-stubs.jar"],
-        stub_srcs: ["sdk_library/public/conscrypt.module.public.api.srcjar"],
-        current_api: "sdk_library/public/conscrypt.module.public.api.txt",
-        removed_api: "sdk_library/public/conscrypt.module.public.api-removed.txt",
-        annotations: "sdk_library/public/conscrypt.module.public.api_annotations.zip",
-        sdk_version: "none",
-    },
-    system: {
-        jars: ["sdk_library/system/conscrypt.module.public.api-stubs.jar"],
-        stub_srcs: ["sdk_library/system/conscrypt.module.public.api.srcjar"],
-        current_api: "sdk_library/system/conscrypt.module.public.api.txt",
-        removed_api: "sdk_library/system/conscrypt.module.public.api-removed.txt",
-        annotations: "sdk_library/system/conscrypt.module.public.api_annotations.zip",
-        sdk_version: "none",
-    },
-    module_lib: {
-        jars: ["sdk_library/module-lib/conscrypt.module.public.api-stubs.jar"],
-        stub_srcs: ["sdk_library/module-lib/conscrypt.module.public.api.srcjar"],
-        current_api: "sdk_library/module-lib/conscrypt.module.public.api.txt",
-        removed_api: "sdk_library/module-lib/conscrypt.module.public.api-removed.txt",
-        annotations: "sdk_library/module-lib/conscrypt.module.public.api_annotations.zip",
-        sdk_version: "none",
-    },
-}
-
-java_sdk_library_import {
-    name: "conscrypt.module.platform.api",
-    // Do not prefer prebuilt if the Soong config variable "module_build_from_source" in namespace "ANDROID" is true.
-    use_source_config_var: {
-        config_namespace: "ANDROID",
-        var_name: "module_build_from_source",
-    },
-    visibility: [
-        "//build/soong/java/core-libraries",
-        "//external/conscrypt",
-        "//external/wycheproof",
-        "//libcore/mmodules/core_platform_api",
-        "//prebuilts:__subpackages__",
-    ],
-    apex_available: ["//apex_available:platform"],
-    licenses: ["conscrypt-module-sdk_external_conscrypt_license"],
-    shared_library: false,
-    public: {
-        jars: ["sdk_library/public/conscrypt.module.platform.api-stubs.jar"],
-        stub_srcs: ["sdk_library/public/conscrypt.module.platform.api.srcjar"],
-        current_api: "sdk_library/public/conscrypt.module.platform.api.txt",
-        removed_api: "sdk_library/public/conscrypt.module.platform.api-removed.txt",
-        sdk_version: "none",
-    },
-}
-
-java_sdk_library_import {
-    name: "conscrypt.module.intra.core.api",
-    // Do not prefer prebuilt if the Soong config variable "module_build_from_source" in namespace "ANDROID" is true.
-    use_source_config_var: {
-        config_namespace: "ANDROID",
-        var_name: "module_build_from_source",
-    },
-    visibility: [
-        "//external/conscrypt",
-        "//external/okhttp",
-        "//libcore:__subpackages__",
-        "//prebuilts:__subpackages__",
-    ],
-    apex_available: ["//apex_available:platform"],
-    licenses: ["conscrypt-module-sdk_external_conscrypt_license"],
-    shared_library: false,
-    public: {
-        jars: ["sdk_library/public/conscrypt.module.intra.core.api-stubs.jar"],
-        stub_srcs: ["sdk_library/public/conscrypt.module.intra.core.api.srcjar"],
-        current_api: "sdk_library/public/conscrypt.module.intra.core.api.txt",
-        removed_api: "sdk_library/public/conscrypt.module.intra.core.api-removed.txt",
-        sdk_version: "none",
-    },
-}
-
-license {
-    name: "conscrypt-module-sdk_external_conscrypt_license",
-    visibility: ["//visibility:private"],
-    license_kinds: [
-        "SPDX-license-identifier-Apache-2.0",
-        "legacy_unencumbered",
-    ],
-    license_text: [
-        "licenses/external/conscrypt/LICENSE",
-        "licenses/external/conscrypt/NOTICE",
-        "licenses/external/conscrypt/licenses/LICENSE.harmony.txt",
-        "licenses/external/conscrypt/licenses/LICENSE.netty.txt",
-    ],
-}
-
-cc_prebuilt_library_shared {
-    name: "libconscrypt_jni",
-    // Do not prefer prebuilt if the Soong config variable "module_build_from_source" in namespace "ANDROID" is true.
-    use_source_config_var: {
-        config_namespace: "ANDROID",
-        var_name: "module_build_from_source",
-    },
-    visibility: ["//external/conscrypt:__subpackages__"],
-    apex_available: ["//apex_available:platform"],
-    licenses: ["conscrypt-module-sdk_external_conscrypt_license"],
-    stl: "c++_static",
-    compile_multilib: "both",
-    shared_libs: ["liblog"],
-    arch: {
-        arm64: {
-            srcs: ["arm64/lib/libconscrypt_jni.so"],
-        },
-        riscv64: {
-            srcs: ["riscv64/lib/libconscrypt_jni.so"],
-        },
-        x86_64: {
-            srcs: ["x86_64/lib/libconscrypt_jni.so"],
-        },
-        arm: {
-            srcs: ["arm/lib/libconscrypt_jni.so"],
-        },
-        x86: {
-            srcs: ["x86/lib/libconscrypt_jni.so"],
-        },
-    },
-}
diff --git a/mainline/local_riscv64/prebuilts/module_sdk/conscrypt/current/test-exports/Android.bp.patch b/mainline/local_riscv64/prebuilts/module_sdk/conscrypt/current/test-exports/Android.bp.patch
new file mode 100644
index 0000000..c95a4db
--- /dev/null
+++ b/mainline/local_riscv64/prebuilts/module_sdk/conscrypt/current/test-exports/Android.bp.patch
@@ -0,0 +1,20 @@
+diff --git i/current/test-exports/Android.bp w/current/test-exports/Android.bp
+index 633e6dfb..882f8d3f 100644
+--- i/current/test-exports/Android.bp
++++ w/current/test-exports/Android.bp
+@@ -1,4 +1,4 @@
+-// This is auto-generated. DO NOT EDIT.
++// DO NOT COMMIT. Changes in this file are temporary and generated by art/tools/buildbot-build.sh. See b/286551985.
+ 
+ // blueprint rules added by vendor/google/build/mainline_modules_sdks.py
+ // to support coexistence.
+@@ -94,6 +94,9 @@ cc_prebuilt_library_shared {
+         android_arm64: {
+             srcs: ["android/arm64/lib/libjavacrypto.so"],
+         },
++        android_riscv64: {
++            srcs: ["android/riscv64/lib/libjavacrypto.so"],
++        },
+         android_x86_64: {
+             srcs: ["android/x86_64/lib/libjavacrypto.so"],
+         },
diff --git a/mainline/local_riscv64/prebuilts/module_sdk/conscrypt/current/test-exports/ArtThinBuild.bp b/mainline/local_riscv64/prebuilts/module_sdk/conscrypt/current/test-exports/ArtThinBuild.bp
deleted file mode 100644
index 4b2263d..0000000
--- a/mainline/local_riscv64/prebuilts/module_sdk/conscrypt/current/test-exports/ArtThinBuild.bp
+++ /dev/null
@@ -1,124 +0,0 @@
-// DO NOT COMMIT. Changes in this file are temporary and generated by art/tools/buildbot-build.sh. See b/286551985.
-
-package {
-    // A default list here prevents the license LSC from adding its own list which would
-    // be unnecessary as every module in the sdk already has its own licenses property.
-    default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
-java_import {
-    name: "conscrypt-for-host",
-    // Do not prefer prebuilt if the Soong config variable "module_build_from_source" in namespace "ANDROID" is true.
-    use_source_config_var: {
-        config_namespace: "ANDROID",
-        var_name: "module_build_from_source",
-    },
-    visibility: [
-        "//art/build",
-        "//external/conscrypt",
-        "//external/robolectric",
-        "//external/robolectric-shadows",
-        "//frameworks/layoutlib",
-    ],
-    apex_available: ["//apex_available:platform"],
-    licenses: ["conscrypt-module-test-exports_external_conscrypt_license"],
-    jars: ["java/conscrypt-for-host.jar"],
-}
-
-java_test_import {
-    name: "conscrypt-tests",
-    // Do not prefer prebuilt if the Soong config variable "module_build_from_source" in namespace "ANDROID" is true.
-    use_source_config_var: {
-        config_namespace: "ANDROID",
-        var_name: "module_build_from_source",
-    },
-    visibility: [
-        "//cts/tests/libcore/luni",
-        "//external/conscrypt",
-        "//external/conscrypt/apex/tests",
-        "//libcore",
-    ],
-    apex_available: ["//apex_available:platform"],
-    licenses: ["conscrypt-module-test-exports_external_conscrypt_license"],
-    jars: ["java/conscrypt-tests.jar"],
-    test_config: "java/conscrypt-tests-AndroidTest.xml",
-}
-
-license {
-    name: "conscrypt-module-test-exports_external_conscrypt_license",
-    visibility: ["//visibility:private"],
-    license_kinds: [
-        "SPDX-license-identifier-Apache-2.0",
-        "legacy_unencumbered",
-    ],
-    license_text: [
-        "licenses/external/conscrypt/LICENSE",
-        "licenses/external/conscrypt/NOTICE",
-        "licenses/external/conscrypt/licenses/LICENSE.harmony.txt",
-        "licenses/external/conscrypt/licenses/LICENSE.netty.txt",
-    ],
-}
-
-cc_prebuilt_library_shared {
-    name: "libjavacrypto",
-    // Do not prefer prebuilt if the Soong config variable "module_build_from_source" in namespace "ANDROID" is true.
-    use_source_config_var: {
-        config_namespace: "ANDROID",
-        var_name: "module_build_from_source",
-    },
-    visibility: ["//external/conscrypt:__subpackages__"],
-    apex_available: [
-        "com.android.conscrypt",
-        "test_com.android.conscrypt",
-    ],
-    licenses: ["conscrypt-module-test-exports_external_conscrypt_license"],
-    host_supported: true,
-    target: {
-        host: {
-            enabled: false,
-        },
-        android: {
-            compile_multilib: "both",
-            shared_libs: [
-                "liblog",
-                "libcrypto",
-                "libssl",
-            ],
-        },
-        android_arm64: {
-            srcs: ["android/arm64/lib/libjavacrypto.so"],
-        },
-        android_riscv64: {
-            srcs: ["android/riscv64/lib/libjavacrypto.so"],
-        },
-        android_x86_64: {
-            srcs: ["android/x86_64/lib/libjavacrypto.so"],
-        },
-        android_arm: {
-            srcs: ["android/arm/lib/libjavacrypto.so"],
-        },
-        android_x86: {
-            srcs: ["android/x86/lib/libjavacrypto.so"],
-        },
-        linux_bionic: {
-            compile_multilib: "64",
-            shared_libs: ["liblog"],
-        },
-        linux_bionic_x86_64: {
-            enabled: true,
-            srcs: ["linux_bionic/x86_64/lib/libjavacrypto.so"],
-        },
-        linux_glibc: {
-            compile_multilib: "both",
-            shared_libs: ["liblog"],
-        },
-        linux_glibc_x86_64: {
-            enabled: true,
-            srcs: ["linux_glibc/x86_64/lib/libjavacrypto.so"],
-        },
-        linux_glibc_x86: {
-            enabled: true,
-            srcs: ["linux_glibc/x86/lib/libjavacrypto.so"],
-        },
-    },
-}