Implement Discovery PLATFORM logic in Rust
This commit introduces new PAL that is used by ReamoteAuth protocol
communicate with remote device
Design doc: go/remote-auth-manager-fishfood-design
Test: built successfully.
Bug: : 291333048
Change-Id: I9c78137ccf2fd6c86735bef0dd0c9cedf589d704
diff --git a/remoteauth/service/jni/Android.bp b/remoteauth/service/jni/Android.bp
new file mode 100644
index 0000000..e6e8a43
--- /dev/null
+++ b/remoteauth/service/jni/Android.bp
@@ -0,0 +1,76 @@
+package {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+rust_defaults {
+ name: "libremoteauth_jni_rust_defaults",
+ crate_name: "remoteauth_jni_rust",
+ lints: "android",
+ clippy_lints: "android",
+ min_sdk_version: "35",
+ srcs: ["src/lib.rs"],
+ rustlibs: [
+ "libbinder_rs",
+ "libjni",
+ "liblazy_static",
+ "liblog_rust",
+ "liblogger",
+ "libnum_traits",
+ "libthiserror",
+ "libtokio",
+ "libanyhow",
+ ],
+ proc_macros: [
+ "libasync_trait",
+ ],
+ prefer_rlib: true,
+ apex_available: [
+ "com.android.remoteauth",
+ ],
+ host_supported: true,
+}
+
+rust_test {
+ name: "libremoteauth_jni_rust_tests",
+ defaults: ["libremoteauth_jni_rust_defaults"],
+ rustlibs: [
+ ],
+ target: {
+ android: {
+ test_suites: [
+ "general-tests",
+ ],
+ test_config_template: "remoteauth_rust_test_config_template.xml",
+ },
+ host: {
+ test_suites: [
+ "general-tests",
+ ],
+ data_libs: [
+ "libandroid_runtime_lazy",
+ "libbase",
+ "libbinder",
+ "libbinder_ndk",
+ "libcutils",
+ "liblog",
+ "libutils",
+ ],
+ },
+ },
+ test_options: {
+ unit_test: true,
+ },
+ // Support multilib variants (using different suffix per sub-architecture), which is needed on
+ // build targets with secondary architectures, as the MTS test suite packaging logic flattens
+ // all test artifacts into a single `testcases` directory.
+ compile_multilib: "both",
+ multilib: {
+ lib32: {
+ suffix: "32",
+ },
+ lib64: {
+ suffix: "64",
+ },
+ },
+ auto_gen_config: true,
+}