Build HalProxy unit tests with a test library ScopedWakelock
Unit tests do not currently build because they cannot find the
ScopedWakelock shared object. Make a test library version of
ScopedWakelock for them.
Bug: 147912609
Test: Build and run atest android.hardware.sensors@2.0-halproxy-unit-tests
Merged-In: Ie8d3eb606ccba3825be2c8102b9a7bc6ea033f65
Change-Id: Ie8d3eb606ccba3825be2c8102b9a7bc6ea033f65
diff --git a/sensors/2.0/multihal/Android.bp b/sensors/2.0/multihal/Android.bp
index 24c475c..b7fa15a 100644
--- a/sensors/2.0/multihal/Android.bp
+++ b/sensors/2.0/multihal/Android.bp
@@ -92,3 +92,18 @@
"android.hardware.sensors@2.0-ScopedWakelock",
],
}
+
+cc_test_library {
+ name: "android.hardware.sensors@2.0-ScopedWakelock.testlib",
+ defaults: [
+ "hidl_defaults",
+ "android.hardware.sensors@2.0-multihal-defaults",
+ ],
+ srcs: [
+ "ScopedWakelock.cpp",
+ ],
+ vendor_available: true,
+ export_header_lib_headers: [
+ "android.hardware.sensors@2.0-multihal.header",
+ ],
+}