libbinder: add RpcTransportTipcAndroid
Adds a new Binder RPC transport in Android for Trusty IPC.
To enable code sharing between the transports, this moves
interruptableReadOrWrite into a new RpcTransportUtils.h header
that is used by RpcTransportRaw and RpcTransportTrusty.
Bug: 224644083
Test: trusty_binder_test
Change-Id: I47843560374049821cbfc36875a738083ffd5d75
diff --git a/libs/binder/Android.bp b/libs/binder/Android.bp
index 441a4a8..fabf3eb 100644
--- a/libs/binder/Android.bp
+++ b/libs/binder/Android.bp
@@ -339,6 +339,34 @@
defaults: ["libbinder_tls_defaults"],
}
+cc_library_shared {
+ name: "libbinder_trusty",
+ vendor: true,
+ srcs: [
+ "RpcTransportTipcAndroid.cpp",
+ "RpcTrusty.cpp",
+ ],
+
+ shared_libs: [
+ "libbinder",
+ "liblog",
+ "libtrusty",
+ "libutils",
+ ],
+ static_libs: [
+ "libbase",
+ ],
+ export_include_dirs: ["include_trusty"],
+
+ // Most of Android doesn't need this library and shouldn't use it,
+ // so we restrict its visibility to the Trusty-specific packages.
+ visibility: [
+ ":__subpackages__",
+ "//system/core/trusty:__subpackages__",
+ "//vendor:__subpackages__",
+ ],
+}
+
// For testing
cc_library_static {
name: "libbinder_tls_static",