Use android_get_control_socket from the rustutils crate
prng_seeder had its own rust wrapper for android_get_control_socket
(from libcutils). Let's switch to the one in the rustutils crate since
it provides a common implementation. Plus, the implementation is a bit
safer because it ensures that the socket is exclusively owned by using
the recently added rustutils::inherited_fd module.
Ignore-AOSP-First: the topic includes git_main-only change. Will
cherry-pick the rest.
Bug: 243500154
Test: build
Flag: EXEMPT refactor
Change-Id: I70318dc8b197a93d0f791ac968fc03b7aaf2efaa
diff --git a/prng_seeder/Android.bp b/prng_seeder/Android.bp
index 4f9b7e1..b56a405 100644
--- a/prng_seeder/Android.bp
+++ b/prng_seeder/Android.bp
@@ -19,19 +19,6 @@
default_applicable_licenses: ["system_security_license"],
}
-rust_bindgen {
- name: "libcutils_socket_bindgen",
- crate_name: "cutils_socket_bindgen",
- wrapper_src: "cutils_wrapper.h",
- source_stem: "bindings",
- bindgen_flags: [
- "--allowlist-function=android_get_control_socket",
- ],
- shared_libs: [
- "libcutils",
- ],
-}
-
rust_defaults {
name: "prng_seeder_defaults",
edition: "2021",
@@ -39,10 +26,10 @@
"libanyhow",
"libbssl_sys",
"libclap",
- "libcutils_socket_bindgen",
"liblogger",
"liblog_rust",
"libnix",
+ "librustutils",
"libtokio",
],
@@ -73,10 +60,10 @@
"libanyhow",
"libbssl_sys",
"libclap",
- "libcutils_socket_bindgen",
"liblogger",
"liblog_rust",
"libnix",
+ "librustutils",
"libtokio",
],
test_suites: ["general-tests"],