axolotl: gps: Convert remaining Android.mk to bp
Change-Id: I75e6af92795fe755a48557aa06106406b14c6750
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 1bb7393..153cd67 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -141,7 +141,6 @@
# GPS
BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default
-LOC_HIDL_VERSION := 3.0
# Graphics
TARGET_USES_GRALLOC1 := true
diff --git a/gps/Android.mk b/gps/Android.mk
deleted file mode 100644
index 10a3610..0000000
--- a/gps/Android.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),)
-
-# Set required flags
-GNSS_CFLAGS := \
- -Werror \
- -Wno-undefined-bool-conversion
-
-GNSS_HIDL_VERSION = 2.0
-
-GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8937
-GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8953
-GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8998
-GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += apq8098_latv
-GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm710
-GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += qcs605
-GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm845
-GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm660
-
-ifneq (,$(filter $(GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST),$(TARGET_BOARD_PLATFORM)))
-GNSS_HIDL_LEGACY_MEASURMENTS = true
-endif
-
-LOCAL_PATH := $(call my-dir)
-include $(call all-makefiles-under,$(LOCAL_PATH))
-
-endif # ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),)
diff --git a/gps/android/2.0/Android.bp b/gps/android/2.0/Android.bp
new file mode 100644
index 0000000..cb23a47
--- /dev/null
+++ b/gps/android/2.0/Android.bp
@@ -0,0 +1,91 @@
+cc_library_shared {
+ name: "android.hardware.gnss@2.0-impl-qti",
+ vendor: true,
+ relative_install_path: "hw",
+ srcs: [
+ "AGnss.cpp",
+ "Gnss.cpp",
+ "AGnssRil.cpp",
+ "GnssMeasurement.cpp",
+ "GnssConfiguration.cpp",
+ "GnssBatching.cpp",
+ "GnssGeofencing.cpp",
+ "GnssNi.cpp",
+ "GnssDebug.cpp",
+ "MeasurementCorrections.cpp",
+ "GnssVisibilityControl.cpp",
+ ] + [
+ "location_api/GnssAPIClient.cpp",
+ "location_api/MeasurementAPIClient.cpp",
+ "location_api/GeofenceAPIClient.cpp",
+ "location_api/BatchingAPIClient.cpp",
+ "location_api/LocationUtil.cpp",
+ ],
+
+ local_include_dirs: ["location_api"],
+
+ header_libs: [
+ "libgps.utils_headers",
+ "libloc_core_headers",
+ "libloc_pla_headers",
+ "liblocation_api_headers",
+ "liblocbatterylistener_headers",
+ ],
+
+ shared_libs: [
+ "liblog",
+ "libhidlbase",
+ "libcutils",
+ "libutils",
+ "android.hardware.gnss@1.0",
+ "android.hardware.gnss@1.1",
+ "android.hardware.gnss@2.0",
+ "android.hardware.gnss.measurement_corrections@1.0",
+ "android.hardware.gnss.visibility_control@1.0",
+ "android.hardware.health@1.0",
+ "android.hardware.health@2.0",
+ "android.hardware.power@1.2",
+ "libbase",
+ ] + [
+ "libloc_core",
+ "libgps.utils",
+ "libdl",
+ "liblocation_api",
+ ],
+
+ cflags: ["-DGNSS_HIDL_LEGACY_MEASURMENTS"] + GNSS_CFLAGS,
+ static_libs: ["liblocbatterylistener"] + ["libhealthhalutils"],
+}
+
+cc_binary {
+ name: "android.hardware.gnss@2.0-service-qti",
+ vintf_fragments: ["android.hardware.gnss@2.0-service-qti.xml"],
+ vendor: true,
+ relative_install_path: "hw",
+ init_rc: ["android.hardware.gnss@2.0-service-qti.rc"],
+ srcs: ["service.cpp"],
+
+ header_libs: [
+ "libgps.utils_headers",
+ "libloc_core_headers",
+ "libloc_pla_headers",
+ "liblocation_api_headers",
+ ],
+
+ shared_libs: [
+ "liblog",
+ "libcutils",
+ "libdl",
+ "libbase",
+ "libutils",
+ "libgps.utils",
+ "libqti_vndfwk_detect",
+ ] + [
+ "libhidlbase",
+ "android.hardware.gnss@1.0",
+ "android.hardware.gnss@1.1",
+ "android.hardware.gnss@2.0",
+ ],
+
+ cflags: GNSS_CFLAGS + ["-DLOC_HIDL_VERSION=\"3.0\""],
+}
diff --git a/gps/android/2.0/Android.mk b/gps/android/2.0/Android.mk
deleted file mode 100644
index b6790c5..0000000
--- a/gps/android/2.0/Android.mk
+++ /dev/null
@@ -1,112 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.gnss@2.0-impl-qti
-LOCAL_SANITIZE += $(GNSS_SANITIZE)
-# activate the following line for debug purposes only, comment out for production
-#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
-LOCAL_VENDOR_MODULE := true
-LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_SRC_FILES := \
- AGnss.cpp \
- Gnss.cpp \
- AGnssRil.cpp \
- GnssMeasurement.cpp \
- GnssConfiguration.cpp \
- GnssBatching.cpp \
- GnssGeofencing.cpp \
- GnssNi.cpp \
- GnssDebug.cpp \
- ../measurement_corrections/1.0/MeasurementCorrections.cpp \
- ../visibility_control/1.0/GnssVisibilityControl.cpp
-
-LOCAL_SRC_FILES += \
- location_api/GnssAPIClient.cpp \
- location_api/MeasurementAPIClient.cpp \
- location_api/GeofenceAPIClient.cpp \
- location_api/BatchingAPIClient.cpp \
- location_api/LocationUtil.cpp \
-
-ifeq ($(GNSS_HIDL_LEGACY_MEASURMENTS),true)
-LOCAL_CFLAGS += \
- -DGNSS_HIDL_LEGACY_MEASURMENTS
-endif
-
-LOCAL_C_INCLUDES:= \
- $(LOCAL_PATH)/location_api \
- $(LOCAL_PATH)/../measurement_corrections/1.0 \
- $(LOCAL_PATH)/../visibility_control/1.0
-LOCAL_HEADER_LIBRARIES := \
- libgps.utils_headers \
- libloc_core_headers \
- libloc_pla_headers \
- liblocation_api_headers \
- liblocbatterylistener_headers
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libhidlbase \
- libcutils \
- libutils \
- android.hardware.gnss@1.0 \
- android.hardware.gnss@1.1 \
- android.hardware.gnss@2.0 \
- android.hardware.gnss.measurement_corrections@1.0 \
- android.hardware.gnss.visibility_control@1.0 \
- android.hardware.health@1.0 \
- android.hardware.health@2.0 \
- android.hardware.power@1.2 \
- libbase
-
-LOCAL_SHARED_LIBRARIES += \
- libloc_core \
- libgps.utils \
- libdl \
- liblocation_api \
-
-LOCAL_CFLAGS += $(GNSS_CFLAGS)
-LOCAL_STATIC_LIBRARIES := liblocbatterylistener
-LOCAL_STATIC_LIBRARIES += libhealthhalutils
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.gnss@2.0-service-qti
-LOCAL_SANITIZE += $(GNSS_SANITIZE)
-# activate the following line for debug purposes only, comment out for production
-#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
-LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@2.0-service-qti.xml
-LOCAL_VENDOR_MODULE := true
-LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_INIT_RC := android.hardware.gnss@2.0-service-qti.rc
-LOCAL_SRC_FILES := \
- service.cpp \
-
-LOCAL_HEADER_LIBRARIES := \
- libgps.utils_headers \
- libloc_core_headers \
- libloc_pla_headers \
- liblocation_api_headers
-
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libcutils \
- libdl \
- libbase \
- libutils \
- libgps.utils \
- libqti_vndfwk_detect \
-
-LOCAL_SHARED_LIBRARIES += \
- libhidlbase \
- android.hardware.gnss@1.0 \
- android.hardware.gnss@1.1 \
- android.hardware.gnss@2.0 \
-
-LOCAL_CFLAGS += $(GNSS_CFLAGS)
-
-ifneq ($(LOC_HIDL_VERSION),)
-LOCAL_CFLAGS += -DLOC_HIDL_VERSION='"$(LOC_HIDL_VERSION)"'
-endif
-
-include $(BUILD_EXECUTABLE)
diff --git a/gps/android/visibility_control/1.0/GnssVisibilityControl.cpp b/gps/android/2.0/GnssVisibilityControl.cpp
similarity index 100%
rename from gps/android/visibility_control/1.0/GnssVisibilityControl.cpp
rename to gps/android/2.0/GnssVisibilityControl.cpp
diff --git a/gps/android/visibility_control/1.0/GnssVisibilityControl.h b/gps/android/2.0/GnssVisibilityControl.h
similarity index 100%
rename from gps/android/visibility_control/1.0/GnssVisibilityControl.h
rename to gps/android/2.0/GnssVisibilityControl.h
diff --git a/gps/android/measurement_corrections/1.0/MeasurementCorrections.cpp b/gps/android/2.0/MeasurementCorrections.cpp
similarity index 100%
rename from gps/android/measurement_corrections/1.0/MeasurementCorrections.cpp
rename to gps/android/2.0/MeasurementCorrections.cpp
diff --git a/gps/android/measurement_corrections/1.0/MeasurementCorrections.h b/gps/android/2.0/MeasurementCorrections.h
similarity index 100%
rename from gps/android/measurement_corrections/1.0/MeasurementCorrections.h
rename to gps/android/2.0/MeasurementCorrections.h
diff --git a/gps/android/Android.mk b/gps/android/Android.mk
deleted file mode 100644
index e220773..0000000
--- a/gps/android/Android.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),)
-include $(CLEAR_VARS)
-DIR_LIST := $(LOCAL_PATH)
-ifeq ($(GNSS_HIDL_VERSION),2.0)
-include $(DIR_LIST)/2.0/Android.mk
-else
-ifeq ($(GNSS_HIDL_VERSION),1.1)
-include $(DIR_LIST)/1.1/Android.mk
-else
-include $(DIR_LIST)/1.0/Android.mk
-endif #GNSS HIDL 1.1
-endif #GNSS HIDL 2.0
-endif #BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE
diff --git a/gps/android/utils/Android.bp b/gps/android/utils/Android.bp
index 80efb91..1d6c2d2 100644
--- a/gps/android/utils/Android.bp
+++ b/gps/android/utils/Android.bp
@@ -32,5 +32,6 @@
cc_library_headers {
name: "liblocbatterylistener_headers",
+ vendor: true,
export_include_dirs: ["."],
}