diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 33fe1eb2..4f0eb3ba 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -972,8 +972,12 @@ SIDE EFFECTS static int loc_xtra_inject_data(char* data, int length) { ENTRY_LOG(); - int ret_val = loc_eng_xtra_inject_data(loc_afw_data, data, length); - + int ret_val = -1; + if( (data != NULL) && ((unsigned int)length <= XTRA_DATA_MAX_SIZE)) + ret_val = loc_eng_xtra_inject_data(loc_afw_data, data, length); + else + LOC_LOGE("%s, Could not inject XTRA data. Buffer address: %p, length: %d", + __func__, data, length); EXIT_LOG(%d, ret_val); return ret_val; } diff --git a/loc_api/libloc_api_50001/loc.h b/loc_api/libloc_api_50001/loc.h index 7e268273..63528664 100644 --- a/loc_api/libloc_api_50001/loc.h +++ b/loc_api/libloc_api_50001/loc.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011,2014 The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -39,6 +39,8 @@ extern "C" { #include #include +#define XTRA_DATA_MAX_SIZE 100000 /*bytes*/ + typedef void (*loc_location_cb_ext) (UlpLocation* location, void* locExt); typedef void (*loc_sv_status_cb_ext) (GpsSvStatus* sv_status, void* svExt); typedef void* (*loc_ext_parser)(void* data); diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp index d46747ac..8dbe885e 100644 --- a/utils/loc_target.cpp +++ b/utils/loc_target.cpp @@ -46,6 +46,7 @@ #define MSM8930_ID_2 "116" #define APQ8030_ID_1 "157" #define APQ8074_ID_1 "184" +#define PDS_ID_1 "178" #define LINE_LEN 100 #define STR_LIQUID "Liquid" @@ -206,8 +207,12 @@ unsigned int loc_get_target(void) } else { read_a_line(id_dep, rd_id, LINE_LEN); } - - if( !memcmp(baseband, STR_APQ, LENGTH(STR_APQ)) ){ + if( !memcmp(rd_hw_platform, STR_MTP, LENGTH(STR_MTP)) ){ + 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)) && IS_STR_END(rd_id[LENGTH(MPQ8064_ID_1)]) ) gTarget = TARGET_MPQ; diff --git a/utils/loc_target.h b/utils/loc_target.h index 9aa525fc..208a34cb 100644 --- a/utils/loc_target.h +++ b/utils/loc_target.h @@ -35,6 +35,7 @@ #define TARGET_MPQ TARGET_SET(GNSS_NONE,NO_SSC) #define TARGET_MSM_NO_SSC TARGET_SET(GNSS_MSM, NO_SSC) #define TARGET_QCA1530 TARGET_SET(GNSS_QCA1530, NO_SSC) +#define TARGET_PDS TARGET_SET(GNSS_PDS, NO_SSC) #define TARGET_UNKNOWN TARGET_SET(GNSS_UNKNOWN, NO_SSC) #define getTargetGnssType(target) (target>>1) @@ -60,6 +61,7 @@ typedef enum { GNSS_GSS, GNSS_MDM, GNSS_QCA1530, + GNSS_PDS, GNSS_UNKNOWN }GNSS_TARGET;