From b37098920fc32a6f2d3e1143f56b7265a6f63f5f Mon Sep 17 00:00:00 2001 From: Saurabh Srivastava Date: Thu, 22 Dec 2016 01:17:04 +0530 Subject: [PATCH] Moving conf files to /vendor/etc Moving all vendor specific conf files to /vendor/etc instead of current /etc folder CRs-Fixed: 1099981 Change-Id: I4495d8527941959be0847c4722ea8b68ee6c87ee --- core/ContextBase.cpp | 6 ++-- core/loc_gps.h | 2 +- etc/Android.mk | 2 +- .../loc_pla/include/platform_lib_macros.h | 12 +++++++ .../loc_pla/src/platform_lib_log_util.cpp | 36 +++++++++++++++++++ 5 files changed, 52 insertions(+), 6 deletions(-) diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index a9858e22..565f70c2 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -145,10 +145,8 @@ void ContextBase::readConfig() /* inject supl config to modem with config values from config.xml or gps.conf, default 1 */ mGps_conf.AGPS_CONFIG_INJECT = 1; - const char* GPS_CONF_FILE = "/etc/gps.conf"; - const char* SAP_CONF_FILE = "/etc/sap.conf"; - UTIL_READ_CONF(GPS_CONF_FILE, mGps_conf_table); - UTIL_READ_CONF(SAP_CONF_FILE, mSap_conf_table); + UTIL_READ_CONF(LOC_PATH_GPS_CONF, mGps_conf_table); + UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table); } uint32_t ContextBase::getCarrierCapabilities() { diff --git a/core/loc_gps.h b/core/loc_gps.h index cdb1af67..2e495b82 100644 --- a/core/loc_gps.h +++ b/core/loc_gps.h @@ -2187,7 +2187,7 @@ typedef struct { * Deliver GNSS configuration contents to HAL. * Parameters: * config_data - a pointer to a char array which holds what usually is expected from - file(/etc/gps.conf), i.e., a sequence of UTF8 strings separated by '\n'. + file(/vendor/etc/gps.conf), i.e., a sequence of UTF8 strings separated by '\n'. * length - total number of UTF8 characters in configuraiton data. * * IMPORTANT: diff --git a/etc/Android.mk b/etc/Android.mk index 025d3f74..d9eb0e10 100644 --- a/etc/Android.mk +++ b/etc/Android.mk @@ -5,7 +5,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := gps.conf LOCAL_MODULE_TAGS := optional LOCAL_MODULE_CLASS := ETC -LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/ +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/ LOCAL_SRC_FILES := gps.conf include $(BUILD_PREBUILT) diff --git a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h index c712122e..d0795eb6 100644 --- a/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h +++ b/utils/platform_lib_abstractions/loc_pla/include/platform_lib_macros.h @@ -66,6 +66,18 @@ extern "C" { #endif /* USE_GLIB */ + +// Below are the location conf file paths +extern const char LOC_PATH_GPS_CONF[]; +extern const char LOC_PATH_IZAT_CONF[]; +extern const char LOC_PATH_FLP_CONF[]; +extern const char LOC_PATH_LOWI_CONF[]; +extern const char LOC_PATH_SAP_CONF[]; +extern const char LOC_PATH_APDR_CONF[]; +extern const char LOC_PATH_XTWIFI_CONF[]; +extern const char LOC_PATH_QUIPC_CONF[]; + + #ifdef __cplusplus } #endif /*__cplusplus */ diff --git a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp index ef23201a..3cb51a30 100644 --- a/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp +++ b/utils/platform_lib_abstractions/loc_pla/src/platform_lib_log_util.cpp @@ -26,6 +26,7 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "platform_lib_log_util.h" +#include "platform_lib_macros.h" char * get_timestamp(char *str, unsigned long buf_size) { @@ -40,3 +41,38 @@ char * get_timestamp(char *str, unsigned long buf_size) return str; } +// Below are the location conf file paths +#ifdef __ANDROID__ + +#define LOC_PATH_GPS_CONF_STR "/vendor/etc/gps.conf" +#define LOC_PATH_IZAT_CONF_STR "/vendor/etc/izat.conf" +#define LOC_PATH_FLP_CONF_STR "/vendor/etc/flp.conf" +#define LOC_PATH_LOWI_CONF_STR "/vendor/etc/lowi.conf" +#define LOC_PATH_SAP_CONF_STR "/vendor/etc/sap.conf" +#define LOC_PATH_APDR_CONF_STR "/vendor/etc/apdr.conf" +#define LOC_PATH_XTWIFI_CONF_STR "/vendor/etc/xtwifi.conf" +#define LOC_PATH_QUIPC_CONF_STR "/vendor/etc/quipc.conf" + +#else + +#define LOC_PATH_GPS_CONF_STR "/etc/gps.conf" +#define LOC_PATH_IZAT_CONF_STR "/etc/izat.conf" +#define LOC_PATH_FLP_CONF_STR "/etc/flp.conf" +#define LOC_PATH_LOWI_CONF_STR "/etc/lowi.conf" +#define LOC_PATH_SAP_CONF_STR "/etc/sap.conf" +#define LOC_PATH_APDR_CONF_STR "/etc/apdr.conf" +#define LOC_PATH_XTWIFI_CONF_STR "/etc/xtwifi.conf" +#define LOC_PATH_QUIPC_CONF_STR "/etc/quipc.conf" + +#endif // __ANDROID__ + +// Reference below arrays wherever needed to avoid duplicating +// same conf path string over and again in location code. +const char LOC_PATH_GPS_CONF[] = LOC_PATH_GPS_CONF_STR; +const char LOC_PATH_IZAT_CONF[] = LOC_PATH_IZAT_CONF_STR; +const char LOC_PATH_FLP_CONF[] = LOC_PATH_FLP_CONF_STR; +const char LOC_PATH_LOWI_CONF[] = LOC_PATH_LOWI_CONF_STR; +const char LOC_PATH_SAP_CONF[] = LOC_PATH_SAP_CONF_STR; +const char LOC_PATH_APDR_CONF[] = LOC_PATH_APDR_CONF_STR; +const char LOC_PATH_XTWIFI_CONF[] = LOC_PATH_XTWIFI_CONF_STR; +const char LOC_PATH_QUIPC_CONF[] = LOC_PATH_QUIPC_CONF_STR;