support lib for libcutils<->NDK AIDL handle
The native_handle API is notoriously tricky to work with, and this is
expected to be very common. So, adding a small helper library.
Fixes: 175432703
Test: atest libaidlcommonsupport_test
Change-Id: I4a00d2b14fefe6c979ee656e353e117661a1a483
diff --git a/common/support/Android.bp b/common/support/Android.bp
new file mode 100644
index 0000000..3bb4804
--- /dev/null
+++ b/common/support/Android.bp
@@ -0,0 +1,27 @@
+cc_library_static {
+ name: "libaidlcommonsupport",
+ vendor_available: true,
+ host_supported: true,
+ defaults: ["libbinder_ndk_host_user"],
+ srcs: ["NativeHandle.cpp"],
+ export_include_dirs: ["include"],
+ shared_libs: [
+ "android.hardware.common-unstable-ndk_platform",
+ "libcutils",
+ ],
+}
+
+cc_test {
+ name: "libaidlcommonsupport_test",
+ host_supported: true,
+ defaults: ["libbinder_ndk_host_user"],
+ srcs: ["test.cpp"],
+ static_libs: [
+ "libaidlcommonsupport",
+ ],
+ shared_libs: [
+ "android.hardware.common-unstable-ndk_platform",
+ "libcutils",
+ ],
+ test_suites: ["general-tests"],
+}