Compile health hal with the VNDK.
Test: builds with BOARD_VNDK_VERSION=current
Change-Id: I38ea5afed47026f6068e9aac5de3435ec031f836
diff --git a/health/1.0/default/Android.bp b/health/1.0/default/Android.bp
new file mode 100644
index 0000000..c57152f
--- /dev/null
+++ b/health/1.0/default/Android.bp
@@ -0,0 +1,24 @@
+subdirs = [
+ "libhealthd",
+]
+
+cc_library_static {
+ name: "android.hardware.health@1.0-convert",
+ vendor_available: true,
+ srcs: ["convert.cpp"],
+ include_dirs: [
+ "system/core/base/include",
+ ],
+ header_libs: ["libhealthd_headers"],
+ export_header_lib_headers: ["libhealthd_headers"],
+ export_include_dirs: ["include"],
+ shared_libs: [
+ "libcutils",
+ "libhidlbase",
+ "libhidltransport",
+ "libutils",
+ "android.hardware.health@1.0",
+ ],
+
+}
+
diff --git a/health/1.0/default/Android.mk b/health/1.0/default/Android.mk
index 96ff91f..199ab41 100644
--- a/health/1.0/default/Android.mk
+++ b/health/1.0/default/Android.mk
@@ -4,10 +4,12 @@
LOCAL_MODULE := android.hardware.health@1.0-impl
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_C_INCLUDES := system/core/healthd/include system/core/base/include
+LOCAL_C_INCLUDES := system/core/base/include
LOCAL_SRC_FILES := \
Health.cpp \
+LOCAL_HEADER_LIBRARIES := libhealthd_headers
+
LOCAL_SHARED_LIBRARIES := \
libcutils \
libhidlbase \
@@ -23,20 +25,6 @@
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.health@1.0-convert
-LOCAL_SRC_FILES := convert.cpp
-LOCAL_C_INCLUDES := system/core/healthd/include system/core/base/include
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libhidlbase \
- libhidltransport \
- libutils \
- android.hardware.health@1.0 \
-
-include $(BUILD_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_MODULE := android.hardware.health@1.0-service
diff --git a/health/1.0/default/libhealthd/Android.bp b/health/1.0/default/libhealthd/Android.bp
new file mode 100644
index 0000000..ce02e28
--- /dev/null
+++ b/health/1.0/default/libhealthd/Android.bp
@@ -0,0 +1,10 @@
+// Copyright 2016 The Android Open Source Project
+
+cc_library_static {
+ srcs: ["healthd_board_default.cpp"],
+ name: "libhealthd.default",
+ vendor_available: true,
+ cflags: ["-Werror"],
+ include_dirs: ["system/core/base/include"],
+ header_libs: ["libhealthd_headers"],
+}
diff --git a/health/1.0/default/libhealthd/Android.mk b/health/1.0/default/libhealthd/Android.mk
deleted file mode 100644
index a5f4445..0000000
--- a/health/1.0/default/libhealthd/Android.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright 2016 The Android Open Source Project
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := healthd_board_default.cpp
-LOCAL_MODULE := libhealthd.default
-LOCAL_CFLAGS := -Werror
-LOCAL_C_INCLUDES := system/core/healthd/include system/core/base/include
-include $(BUILD_STATIC_LIBRARY)
diff --git a/health/Android.bp b/health/Android.bp
index 33f70eb..ed19a37 100644
--- a/health/Android.bp
+++ b/health/Android.bp
@@ -1,5 +1,6 @@
// This is an autogenerated file, do not edit.
subdirs = [
"1.0",
+ "1.0/default",
"1.0/vts/functional",
]