Merge 19920b80e2 on remote branch

Change-Id: Ic1c355378caf0749e58076df2118c873b6c6f172
This commit is contained in:
Linux Build Service Account 2015-03-30 05:36:01 -06:00
commit e7fa3e15ae
8 changed files with 34 additions and 17 deletions

View file

@ -19,7 +19,7 @@ LOCAL_SRC_FILES += \
linked_list.c \ linked_list.c \
loc_target.cpp \ loc_target.cpp \
loc_timer.c \ loc_timer.c \
../platform_lib_abstractions/elapsed_millis_since_boot.cpp \ platform_lib_abstractions/elapsed_millis_since_boot.cpp \
loc_misc_utils.cpp loc_misc_utils.cpp
LOCAL_CFLAGS += \ LOCAL_CFLAGS += \
@ -34,7 +34,7 @@ LOCAL_LDFLAGS += -Wl,--export-dynamic
## Includes ## Includes
LOCAL_C_INCLUDES:= \ LOCAL_C_INCLUDES:= \
$(LOCAL_PATH)/../platform_lib_abstractions $(LOCAL_PATH)/platform_lib_abstractions
LOCAL_COPY_HEADERS_TO:= gps.utils/ LOCAL_COPY_HEADERS_TO:= gps.utils/
LOCAL_COPY_HEADERS:= \ LOCAL_COPY_HEADERS:= \
@ -45,9 +45,9 @@ LOCAL_COPY_HEADERS:= \
msg_q.h \ msg_q.h \
loc_target.h \ loc_target.h \
loc_timer.h \ loc_timer.h \
../platform_lib_abstractions/platform_lib_includes.h \ platform_lib_abstractions/platform_lib_includes.h \
../platform_lib_abstractions/platform_lib_time.h \ platform_lib_abstractions/platform_lib_time.h \
../platform_lib_abstractions/platform_lib_macros.h \ platform_lib_abstractions/platform_lib_macros.h \
loc_misc_utils.h loc_misc_utils.h
LOCAL_MODULE := libgps.utils LOCAL_MODULE := libgps.utils

View file

@ -329,9 +329,14 @@ int loc_update_conf(const char* conf_data, int32_t length,
if (conf_data && length && config_table && table_length) { if (conf_data && length && config_table && table_length) {
// make a copy, so we do not tokenize the original data // make a copy, so we do not tokenize the original data
char* conf_copy = (char*)malloc(length+1); char* conf_copy = (char*)malloc(length+1);
if(conf_copy !=NULL)
{
memcpy(conf_copy, conf_data, length); memcpy(conf_copy, conf_data, length);
// we hard NULL the end of string to be safe // we hard NULL the end of string to be safe
conf_copy[length] = 0; conf_copy[length] = 0;
}
// start with one record off // start with one record off
uint32_t num_params = table_length - 1; uint32_t num_params = table_length - 1;
char* saveptr = NULL; char* saveptr = NULL;

View file

@ -46,7 +46,6 @@
#define MSM8930_ID_2 "116" #define MSM8930_ID_2 "116"
#define APQ8030_ID_1 "157" #define APQ8030_ID_1 "157"
#define APQ8074_ID_1 "184" #define APQ8074_ID_1 "184"
#define PDS_ID_1 "178"
#define LINE_LEN 100 #define LINE_LEN 100
#define STR_LIQUID "Liquid" #define STR_LIQUID "Liquid"
@ -213,12 +212,8 @@ unsigned int loc_get_target(void)
gTarget = TARGET_AUTO; gTarget = TARGET_AUTO;
goto detected; goto detected;
} }
if( !memcmp(rd_hw_platform, STR_MTP, LENGTH(STR_MTP)) ){ if( !memcmp(baseband, STR_APQ, LENGTH(STR_APQ)) ){
if( !memcmp(rd_id, PDS_ID_1, LENGTH(PDS_ID_1))
&& IS_STR_END(rd_id[LENGTH(PDS_ID_1)]) )
gTarget = TARGET_PDS;
}
else if( !memcmp(baseband, STR_APQ, LENGTH(STR_APQ)) ){
if( !memcmp(rd_id, MPQ8064_ID_1, LENGTH(MPQ8064_ID_1)) if( !memcmp(rd_id, MPQ8064_ID_1, LENGTH(MPQ8064_ID_1))
&& IS_STR_END(rd_id[LENGTH(MPQ8064_ID_1)]) ) && IS_STR_END(rd_id[LENGTH(MPQ8064_ID_1)]) )
gTarget = TARGET_MPQ; gTarget = TARGET_MPQ;
@ -249,3 +244,17 @@ detected:
LOC_LOGD("HAL: %s returned %d", __FUNCTION__, gTarget); LOC_LOGD("HAL: %s returned %d", __FUNCTION__, gTarget);
return gTarget; return gTarget;
} }
/*Reads the property ro.lean to identify if this is a lean target
Returns:
0 if not a lean and mean target
1 if this is a lean and mean target
*/
int loc_identify_lean_target()
{
int ret = 0;
char lean_target[PROPERTY_VALUE_MAX];
property_get("ro.lean", lean_target, "");
LOC_LOGD("%s:%d]: lean target: %s\n", __func__, __LINE__, lean_target);
return !(strncmp(lean_target, "true", PROPERTY_VALUE_MAX));
}

View file

@ -35,7 +35,6 @@
#define TARGET_MPQ TARGET_SET(GNSS_NONE,NO_SSC) #define TARGET_MPQ TARGET_SET(GNSS_NONE,NO_SSC)
#define TARGET_MSM_NO_SSC TARGET_SET(GNSS_MSM, NO_SSC) #define TARGET_MSM_NO_SSC TARGET_SET(GNSS_MSM, NO_SSC)
#define TARGET_QCA1530 TARGET_SET(GNSS_QCA1530, NO_SSC) #define TARGET_QCA1530 TARGET_SET(GNSS_QCA1530, NO_SSC)
#define TARGET_PDS TARGET_SET(GNSS_PDS, NO_SSC)
#define TARGET_AUTO TARGET_SET(GNSS_AUTO, NO_SSC) #define TARGET_AUTO TARGET_SET(GNSS_AUTO, NO_SSC)
#define TARGET_UNKNOWN TARGET_SET(GNSS_UNKNOWN, NO_SSC) #define TARGET_UNKNOWN TARGET_SET(GNSS_UNKNOWN, NO_SSC)
#define getTargetGnssType(target) (target>>1) #define getTargetGnssType(target) (target>>1)
@ -53,6 +52,11 @@ void loc_get_target_baseband(char *baseband, int array_length);
/*The character array passed to this function should have length /*The character array passed to this function should have length
of atleast PROPERTY_VALUE_MAX*/ of atleast PROPERTY_VALUE_MAX*/
void loc_get_platform_name(char *platform_name, int array_length); void loc_get_platform_name(char *platform_name, int array_length);
/*Reads the property ro.lean to identify if this is a lean target
Returns:
0 if not a lean and mean target
1 if this is a lean and mean target*/
int loc_identify_lean_target();
/* Please remember to update 'target_name' in loc_log.cpp, /* Please remember to update 'target_name' in loc_log.cpp,
if do any changes to this enum. */ if do any changes to this enum. */
@ -62,7 +66,6 @@ typedef enum {
GNSS_GSS, GNSS_GSS,
GNSS_MDM, GNSS_MDM,
GNSS_QCA1530, GNSS_QCA1530,
GNSS_PDS,
GNSS_AUTO, GNSS_AUTO,
GNSS_UNKNOWN GNSS_UNKNOWN
}GNSS_TARGET; }GNSS_TARGET;