From 3b6f6bb075d305d7bc3fc6b67dfd337d094c8efe Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Tue, 5 Sep 2017 13:46:00 -0400 Subject: [PATCH] msm8974-common: sensors: Adjust for our usecase * Rename hals.conf -> _hals.conf so legitimate MultiHAL won't attempt to load our HALs. * Rename multihal -> multihal-samsung8974 so soong doesn't complain about duplicate package names. * Remove USE_SENSOR_MULTI_HAL flag requirement so we can actually build it. * Use TARGET_BOARD_PLATFORM variable in package name because it's a common tree. Change-Id: Ifa8c20747e3f0bf9bae8b42dd4c499cf6d770e27 --- sensors/Android.bp | 2 +- sensors/Android.mk | 11 +---------- sensors/multihal.h | 4 ++-- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/sensors/Android.bp b/sensors/Android.bp index 1b5f26d..4510abc 100644 --- a/sensors/Android.bp +++ b/sensors/Android.bp @@ -1,5 +1,5 @@ cc_library_static { - name: "multihal", + name: "multihal-samsung8974", vendor: true, srcs: [ "multihal.cpp", diff --git a/sensors/Android.mk b/sensors/Android.mk index 9942d39..6d65d20 100644 --- a/sensors/Android.mk +++ b/sensors/Android.mk @@ -16,12 +16,9 @@ LOCAL_PATH := $(call my-dir) -ifeq ($(USE_SENSOR_MULTI_HAL),true) -ifneq ($(PRODUCT_FULL_TREBLE),true) - include $(CLEAR_VARS) -LOCAL_MODULE := sensors.$(TARGET_DEVICE) +LOCAL_MODULE := sensors.$(TARGET_BOARD_PLATFORM) LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_PROPRIETARY_MODULE := true @@ -45,10 +42,4 @@ LOCAL_STRIP_MODULE := false include $(BUILD_SHARED_LIBRARY) -else -$(warning Treble enabled device have built-in sensor multihal support. \ - USE_SENSOR_MULTI_HAL should not be set.) -endif # PRODUCT_FULL_TREBLE -endif # USE_SENSOR_MULTI_HAL - include $(call all-makefiles-under, $(LOCAL_PATH)) diff --git a/sensors/multihal.h b/sensors/multihal.h index 234f2f0..e4fbe7e 100644 --- a/sensors/multihal.h +++ b/sensors/multihal.h @@ -19,10 +19,10 @@ #include #include -static const char* MULTI_HAL_CONFIG_FILE_PATH = "/vendor/etc/sensors/hals.conf"; +static const char* MULTI_HAL_CONFIG_FILE_PATH = "/vendor/etc/sensors/_hals.conf"; // Depracated because system partition HAL config file does not satisfy treble requirements. -static const char* DEPRECATED_MULTI_HAL_CONFIG_FILE_PATH = "/system/etc/sensors/hals.conf"; +static const char* DEPRECATED_MULTI_HAL_CONFIG_FILE_PATH = "/system/etc/sensors/_hals.conf"; struct sensors_module_t *get_multi_hal_module_info(void);