From 88c17ef7d77438f929b4a4f2c49271a2961904a0 Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Tue, 1 Dec 2015 17:01:19 -0800 Subject: [PATCH 1/4] Add support for dynamic TBF updating This change adds the support for checking if modem support dynamic TBF updating. Change-Id: Ib6bf917f84d1224e296e91b4fb33b41d6e2c2531 CRs-Fixed: 923601 --- core/gps_extended_c.h | 1 + 1 file changed, 1 insertion(+) diff --git a/core/gps_extended_c.h b/core/gps_extended_c.h index 27deb442..cc7d31ec 100644 --- a/core/gps_extended_c.h +++ b/core/gps_extended_c.h @@ -416,6 +416,7 @@ typedef enum loc_api_adapter_msg_to_check_supported { LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING, // DBT 2.0 LOC_API_ADAPTER_MESSAGE_ADAPTIVE_LOCATION_BATCHING, // Batching 1.5 LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_LOCATION_BATCHING, // Batching 2.0 + LOC_API_ADAPTER_MESSAGE_UPDATE_TBF_ON_THE_FLY, // Updating Tracking TBF On The Fly LOC_API_ADAPTER_MESSAGE_MAX } LocCheckingMessagesID; From 1c118323524158054651cd061b5d09b8584c2fe8 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 29 Dec 2015 22:35:36 -0800 Subject: [PATCH 2/4] Sub milli sec part in the relevant NMEA Strings NMEA Strings should introduce the sub milli sec part in the relevant NMEA Strings for NHZ Sessions Change-Id: I9bac4caa26e87741e5e82e16a8047af20ac8012b CRs-Fixed: 951144 --- loc_api/libloc_api_50001/loc_eng_nmea.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/loc_api/libloc_api_50001/loc_eng_nmea.cpp index 126a97f0..2868c0e8 100644 --- a/loc_api/libloc_api_50001/loc_eng_nmea.cpp +++ b/loc_api/libloc_api_50001/loc_eng_nmea.cpp @@ -136,6 +136,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, int utcHours = pTm->tm_hour; int utcMinutes = pTm->tm_min; int utcSeconds = pTm->tm_sec; + int utcMSeconds = (location.gpsLocation.timestamp)%1000; if (generate_nmea) { // ------------------ @@ -281,8 +282,8 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker = sentence; lengthRemaining = sizeof(sentence); - length = snprintf(pMarker, lengthRemaining, "$GPRMC,%02d%02d%02d,A," , - utcHours, utcMinutes, utcSeconds); + length = snprintf(pMarker, lengthRemaining, "$GPRMC,%02d%02d%02d.%02d,A," , + utcHours, utcMinutes, utcSeconds,utcMSeconds/10); if (length < 0 || length >= lengthRemaining) { @@ -434,8 +435,8 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, pMarker = sentence; lengthRemaining = sizeof(sentence); - length = snprintf(pMarker, lengthRemaining, "$GPGGA,%02d%02d%02d," , - utcHours, utcMinutes, utcSeconds); + length = snprintf(pMarker, lengthRemaining, "$GPGGA,%02d%02d%02d.%02d," , + utcHours, utcMinutes, utcSeconds, utcMSeconds/10); if (length < 0 || length >= lengthRemaining) { From fbbbb4f391228e0a24bb16f7bcce23b55ae11d75 Mon Sep 17 00:00:00 2001 From: Ruifeng Xu Date: Mon, 9 Nov 2015 16:15:07 -0800 Subject: [PATCH 3/4] Xtra client always reports carrier as 'unknown' The problem was caused by populating the carrier upon phone bootup when the the property maybe not initialized yet. This module is updated to remove the populating code of carrier in phone bootup. Change-Id: I9c3f970aa0f0ca0805fdc2e04aa809329b6a2676 CRs-fixed: 935146 --- loc_api/libloc_api_50001/LocEngAdapter.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 35447d48..3e5a6b55 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -101,7 +101,6 @@ void LocEngAdapter::setXtraUserAgent() { char release[PROPERTY_VALUE_MAX]; char manufacture[PROPERTY_VALUE_MAX]; char model[PROPERTY_VALUE_MAX]; - char carrier[PROPERTY_VALUE_MAX]; char board[PROPERTY_VALUE_MAX]; char brand[PROPERTY_VALUE_MAX]; char chipsetsn[CHIPSET_SERIAL_NUMBER_MAX_LEN]; @@ -111,13 +110,12 @@ void LocEngAdapter::setXtraUserAgent() { property_get("ro.build.version.release", release, defVal); property_get("ro.product.manufacturer", manufacture, defVal); property_get("ro.product.model", model, defVal); - property_get("ro.carrier", carrier, defVal); property_get("ro.product.board", board, defVal); property_get("ro.product.brand", brand, defVal); getChipsetSerialNo(chipsetsn, sizeof(chipsetsn), defVal); - snprintf(userAgent, sizeof(userAgent), "A/%s/%s/%s/%s/%s/QCX3/s%u/-/%s/-/%s/-/-/-", - release, manufacture, model, board, carrier, + snprintf(userAgent, sizeof(userAgent), "A/%s/%s/%s/%s/-/QCX3/s%u/-/%s/-/%s/-/-/-", + release, manufacture, model, board, mContext->getIzatDevId(), chipsetsn, brand); for (int i = 0; i < sizeof(userAgent) && userAgent[i]; i++) { From 9b9d777c636d9bbe17a34e9b07e3fa630beb62a6 Mon Sep 17 00:00:00 2001 From: Ruifeng Xu Date: Fri, 28 Aug 2015 16:54:16 -0700 Subject: [PATCH 4/4] encode field separator characters Replace all separator characters ('/','+','|','%') in the raw string by their corresponding encodings (%2F","%2B","%7C", "%25") Change-Id: I3c895adc2ce1cef36032a25e3c6fd63e70350607 CRs-fixed: 881265 --- loc_api/libloc_api_50001/LocEngAdapter.cpp | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 3e5a6b55..592662df 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -114,6 +114,12 @@ void LocEngAdapter::setXtraUserAgent() { property_get("ro.product.brand", brand, defVal); getChipsetSerialNo(chipsetsn, sizeof(chipsetsn), defVal); + encodeInPlace(release, PROPERTY_VALUE_MAX); + encodeInPlace(manufacture, PROPERTY_VALUE_MAX); + encodeInPlace(model, PROPERTY_VALUE_MAX); + encodeInPlace(board, PROPERTY_VALUE_MAX); + encodeInPlace(brand, PROPERTY_VALUE_MAX); + snprintf(userAgent, sizeof(userAgent), "A/%s/%s/%s/%s/-/QCX3/s%u/-/%s/-/%s/-/-/-", release, manufacture, model, board, mContext->getIzatDevId(), chipsetsn, brand); @@ -197,6 +203,56 @@ void LocEngAdapter::setXtraUserAgent() { return; } + /** + * encode the given string value such that all separator characters ('/','+','|','%') + * in the string are repaced by their corresponding encodings (%2F","%2B","%7C", "%25") + */ + static void encodeInPlace(char value[], const int size) { + char buffer[size]; + + struct ENCODE { + const char ch; + const char *code; + }; + + const ENCODE encodings[] = { {'/', "%2F"}, {'+', "%2B"}, {'|', "%7C",}, {'%', "%25"} }; + const int nencodings = (int)sizeof(encodings) / sizeof(encodings[0]); + + int inpos = 0, outpos = 0; + while(value[inpos] != '\0' && outpos < size - 1) { + // check if escaped character + int escchar = 0; + while(escchar < nencodings && encodings[escchar].ch != value[inpos]) { + escchar++; + } + + if (escchar == nencodings) { + // non escaped character + buffer[outpos++] = value[inpos++]; + continue; + } + + // escaped character + int codepos = 0; + #define NUM_CHARS_IN_CODE 3 + + if (outpos + NUM_CHARS_IN_CODE >= size) { + // skip last character if there is insufficient space + break; + } + + while(outpos < size - 1 && codepos < NUM_CHARS_IN_CODE) { + buffer[outpos++] = encodings[escchar].code[codepos++]; + } + inpos++; + } + + // copy to ouput + value[outpos] = '\0'; + while(--outpos >= 0) { + value[outpos] = buffer[outpos]; + } + } }; sendMsg(new LocSetXtraUserAgent(mContext));