diff --git a/gps/Android.bp b/gps/Android.bp index ea0d991cc2d6eeecba4180928161bc8d4575cdc0..0681f6791ceaffc055f9cf313cc947cf74b25d9c 100644 --- a/gps/Android.bp +++ b/gps/Android.bp @@ -16,18 +16,6 @@ GNSS_CFLAGS = [ "-Wno-error=date-time", ] -/* Activate the following for regression testing */ -GNSS_SANITIZE = { -/* address: true,*/ - cfi: true, - misc_undefined: [ - "bounds", - "null", - "unreachable", - "integer", - ], -} - /* Activate the following for debug purposes only, comment out for production */ GNSS_SANITIZE_DIAG = { diff --git a/gps/Android.mk b/gps/Android.mk index 77d61c99e83d6aadd4753058122524167958f141..88bb0f45d6fe3fde20ccbb39e16557d2e92a92fb 100644 --- a/gps/Android.mk +++ b/gps/Android.mk @@ -36,9 +36,6 @@ endif LOCAL_PATH := $(call my-dir) include $(call all-makefiles-under,$(LOCAL_PATH)) -GNSS_SANITIZE := cfi bounds null unreachable integer -# Activate the following two lines for regression testing -#GNSS_SANITIZE += address -#GNSS_SANITIZE_DIAG := $(GNSS_SANITIZE) +GNSS_SANITIZE_DIAG := cfi bounds null unreachable integer address endif # ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) diff --git a/gps/android/1.0/Android.mk b/gps/android/1.0/Android.mk index 797ecce1cda3711a44538c1361df325f18a647a3..f63a94897d907261641cd2767e9c1fec1a579cd7 100644 --- a/gps/android/1.0/Android.mk +++ b/gps/android/1.0/Android.mk @@ -2,7 +2,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti -LOCAL_SANITIZE += $(GNSS_SANITIZE) + # activate the following line for debug purposes only, comment out for production #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VENDOR_MODULE := true @@ -58,7 +58,7 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@1.0-service-qti -LOCAL_SANITIZE += $(GNSS_SANITIZE) + # activate the following line for debug purposes only, comment out for production #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@1.0-service-qti.xml diff --git a/gps/android/1.1/Android.mk b/gps/android/1.1/Android.mk index 66abd06496887e80ccca01f41f6d6bc68d8e067d..edf85476a04de7aa1b3d4ab1eb3dc22aa70f8fe7 100644 --- a/gps/android/1.1/Android.mk +++ b/gps/android/1.1/Android.mk @@ -2,7 +2,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@1.1-impl-qti -LOCAL_SANITIZE += $(GNSS_SANITIZE) + # activate the following line for debug purposes only, comment out for production #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VENDOR_MODULE := true @@ -59,7 +59,7 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@1.1-service-qti -LOCAL_SANITIZE += $(GNSS_SANITIZE) + # activate the following line for debug purposes only, comment out for production #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@1.1-service-qti.xml diff --git a/gps/android/2.0/Android.mk b/gps/android/2.0/Android.mk index c0b91aebde507e11bc0788dc53fda1dc026da60c..e3422f9ca0c90f2c82e7cdc94fb0417671d90831 100644 --- a/gps/android/2.0/Android.mk +++ b/gps/android/2.0/Android.mk @@ -2,7 +2,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@2.0-impl-qti -LOCAL_SANITIZE += $(GNSS_SANITIZE) + # activate the following line for debug purposes only, comment out for production #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VENDOR_MODULE := true @@ -71,7 +71,7 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@2.0-service-qti -LOCAL_SANITIZE += $(GNSS_SANITIZE) + # activate the following line for debug purposes only, comment out for production #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@2.0-service-qti.xml diff --git a/gps/android/2.1/AGnss.cpp b/gps/android/2.1/AGnss.cpp index c759492cfe0f5ed65dc3e8670bc47c49c2cf9b84..ce7b3aa1e7bf49b00313285249abf7e4d1536fe6 100644 --- a/gps/android/2.1/AGnss.cpp +++ b/gps/android/2.1/AGnss.cpp @@ -32,7 +32,7 @@ namespace implementation { static AGnss* spAGnss = nullptr; -AGnss::AGnss(Gnss* gnss) : mGnss(gnss) { +AGnss::AGnss(Gnss* gnss) : mGnss(gnss), mType(LOC_AGPS_TYPE_INVALID) { spAGnss = this; } @@ -51,6 +51,9 @@ void AGnss::statusCb(AGpsExtType type, LocAGpsStatusValue status) { V2_0::IAGnssCallback::AGnssType aType; IAGnssCallback::AGnssStatusValue aStatus; + // cache the AGps Type + mType = type; + switch (type) { case LOC_AGPS_TYPE_SUPL: aType = IAGnssCallback::AGnssType::SUPL; @@ -138,18 +141,20 @@ Return<bool> AGnss::dataConnFailed() { Return<bool> AGnss::dataConnOpen(uint64_t /*networkHandle*/, const hidl_string& apn, V2_0::IAGnss::ApnIpType apnIpType) { - if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){ + if (mGnss == nullptr || mGnss->getGnssInterface() == nullptr){ LOC_LOGE("Null GNSS interface"); return false; } - /* Validate */ - if(apn.empty()){ - LOC_LOGE("Invalid APN"); - return false; + std::string apnString(apn.c_str()); + // During Emergency SUPL, an apn name of "sos" means that no + // apn was found, like in the simless case, so apn is cleared + if (LOC_AGPS_TYPE_SUPL_ES == mType && "sos" == apnString) { + LOC_LOGD("dataConnOpen APN name = [sos] cleared"); + apnString.clear(); } - LOC_LOGD("dataConnOpen APN name = [%s]", apn.c_str()); + LOC_LOGD("dataConnOpen APN name = [%s]", apnString.c_str()); AGpsBearerType bearerType; switch (apnIpType) { @@ -168,7 +173,7 @@ Return<bool> AGnss::dataConnOpen(uint64_t /*networkHandle*/, const hidl_string& } mGnss->getGnssInterface()->agpsDataConnOpen( - LOC_AGPS_TYPE_SUPL, apn.c_str(), apn.size(), (int)bearerType); + LOC_AGPS_TYPE_SUPL, apnString.c_str(), apnString.size(), (int)bearerType); return true; } diff --git a/gps/android/2.1/AGnss.h b/gps/android/2.1/AGnss.h index f6ea99713dafe6e6e1248fd44759c02e104fee4d..cf9c8a7dc68f6b6f0d2d98b471e2f50bb94227d6 100644 --- a/gps/android/2.1/AGnss.h +++ b/gps/android/2.1/AGnss.h @@ -67,6 +67,8 @@ struct AGnss : public V2_0::IAGnss { private: Gnss* mGnss = nullptr; sp<V2_0::IAGnssCallback> mAGnssCbIface = nullptr; + + AGpsExtType mType; }; } // namespace implementation diff --git a/gps/android/2.1/Android.mk b/gps/android/2.1/Android.mk index a947e4147f81ea98f42a4449b4817abba478f761..4be97a96290ae6e62b8c2a3e67488f9ad1a3270a 100644 --- a/gps/android/2.1/Android.mk +++ b/gps/android/2.1/Android.mk @@ -2,7 +2,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@2.1-impl-qti -LOCAL_SANITIZE += $(GNSS_SANITIZE) # activate the following line for debug purposes only, comment out for production #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VENDOR_MODULE := true @@ -74,7 +73,7 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@2.1-service-qti -LOCAL_SANITIZE += $(GNSS_SANITIZE) + # activate the following line for debug purposes only, comment out for production #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@2.1-service-qti.xml diff --git a/gps/android/2.1/location_api/BatchingAPIClient.cpp b/gps/android/2.1/location_api/BatchingAPIClient.cpp index 00d2ed902adc52835cf7d0587e2796423d19ad2c..0c871b775322bba866bf4b031cf33464eac8103e 100644 --- a/gps/android/2.1/location_api/BatchingAPIClient.cpp +++ b/gps/android/2.1/location_api/BatchingAPIClient.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2021, 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 @@ -33,7 +33,7 @@ #include <inttypes.h> #include <log_util.h> #include <loc_cfg.h> - +#include <thread> #include "LocationUtil.h" #include "BatchingAPIClient.h" @@ -82,10 +82,10 @@ BatchingAPIClient::~BatchingAPIClient() LOC_LOGD("%s]: ()", __FUNCTION__); } -int BatchingAPIClient::getBatchSize() -{ - LOC_LOGD("%s]: ()", __FUNCTION__); - return locAPIGetBatchSize(); +int BatchingAPIClient::getBatchSize() { + int batchSize = locAPIGetBatchSize(); + LOC_LOGd("batchSize: %d", batchSize); + return batchSize; } void BatchingAPIClient::setCallbacks() @@ -133,8 +133,10 @@ void BatchingAPIClient::gnssUpdateCallbacks_2_0(const sp<V2_0::IGnssBatchingCall } } -int BatchingAPIClient::startSession(const IGnssBatching::Options& opts) -{ +int BatchingAPIClient::startSession(const IGnssBatching::Options& opts) { + mMutex.lock(); + mState = STARTED; + mMutex.unlock(); LOC_LOGD("%s]: (%lld %d)", __FUNCTION__, static_cast<long long>(opts.periodNanos), static_cast<uint8_t>(opts.flags)); int retVal = -1; @@ -168,10 +170,13 @@ int BatchingAPIClient::updateSessionOptions(const IGnssBatching::Options& opts) return retVal; } -int BatchingAPIClient::stopSession() -{ +int BatchingAPIClient::stopSession() { + mMutex.lock(); + mState = STOPPING; + mMutex.unlock(); LOC_LOGD("%s]: ", __FUNCTION__); int retVal = -1; + locAPIGetBatchedLocations(mDefaultId, SIZE_MAX); if (locAPIStopSession(mDefaultId) == LOCATION_ERROR_SUCCESS) { retVal = 1; } @@ -184,10 +189,15 @@ void BatchingAPIClient::getBatchedLocation(int last_n_locations) locAPIGetBatchedLocations(mDefaultId, last_n_locations); } -void BatchingAPIClient::flushBatchedLocations() -{ +void BatchingAPIClient::flushBatchedLocations() { LOC_LOGD("%s]: ()", __FUNCTION__); - locAPIGetBatchedLocations(mDefaultId, SIZE_MAX); + uint32_t retVal = locAPIGetBatchedLocations(mDefaultId, SIZE_MAX); + // when flush a stopped session or one doesn't exist, just report an empty batch. + if (LOCATION_ERROR_ID_UNKNOWN == retVal) { + BatchingOptions opt = {}; + ::std::thread thd(&BatchingAPIClient::onBatchingCb, this, 0, nullptr, opt); + thd.detach(); + } } void BatchingAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) @@ -197,37 +207,68 @@ void BatchingAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMa } void BatchingAPIClient::onBatchingCb(size_t count, Location* location, - BatchingOptions /*batchOptions*/) -{ + BatchingOptions /*batchOptions*/) { + bool processReport = false; + LOC_LOGd("(count: %zu)", count); mMutex.lock(); - auto gnssBatchingCbIface(mGnssBatchingCbIface); - auto gnssBatchingCbIface_2_0(mGnssBatchingCbIface_2_0); - mMutex.unlock(); - - LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, count); - if (gnssBatchingCbIface_2_0 != nullptr && count > 0) { - hidl_vec<V2_0::GnssLocation> locationVec; - locationVec.resize(count); - for (size_t i = 0; i < count; i++) { - convertGnssLocation(location[i], locationVec[i]); - } - auto r = gnssBatchingCbIface_2_0->gnssLocationBatchCb(locationVec); - if (!r.isOk()) { - LOC_LOGE("%s] Error from gnssLocationBatchCb 2_0 description=%s", - __func__, r.description().c_str()); - } - } else if (gnssBatchingCbIface != nullptr && count > 0) { - hidl_vec<V1_0::GnssLocation> locationVec; - locationVec.resize(count); - for (size_t i = 0; i < count; i++) { - convertGnssLocation(location[i], locationVec[i]); - } - auto r = gnssBatchingCbIface->gnssLocationBatchCb(locationVec); - if (!r.isOk()) { - LOC_LOGE("%s] Error from gnssLocationBatchCb 1.0 description=%s", - __func__, r.description().c_str()); + // back to back stop() and flush() could bring twice onBatchingCb(). Each one might come first. + // Combine them both (the first goes to cache, the second in location*) before report to FW + switch (mState) { + case STOPPING: + mState = STOPPED; + for (size_t i = 0; i < count; i++) { + mBatchedLocationInCache.push_back(location[i]); + } + break; + case STARTED: + case STOPPED: // flush() always trigger report, even on a stopped session + processReport = true; + break; + default: + break; + } + // report location batch when in STARTED state or flush(), combined with cache in last stop() + if (processReport) { + auto gnssBatchingCbIface(mGnssBatchingCbIface); + auto gnssBatchingCbIface_2_0(mGnssBatchingCbIface_2_0); + size_t batchCacheCnt = mBatchedLocationInCache.size(); + LOC_LOGd("(batchCacheCnt: %zu)", batchCacheCnt); + if (gnssBatchingCbIface_2_0 != nullptr) { + hidl_vec<V2_0::GnssLocation> locationVec; + if (count+batchCacheCnt > 0) { + locationVec.resize(count+batchCacheCnt); + for (size_t i = 0; i < batchCacheCnt; ++i) { + convertGnssLocation(mBatchedLocationInCache[i], locationVec[i]); + } + for (size_t i = 0; i < count; i++) { + convertGnssLocation(location[i], locationVec[i+batchCacheCnt]); + } + } + auto r = gnssBatchingCbIface_2_0->gnssLocationBatchCb(locationVec); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssLocationBatchCb 2_0 description=%s", + __func__, r.description().c_str()); + } + } else if (gnssBatchingCbIface != nullptr) { + hidl_vec<V1_0::GnssLocation> locationVec; + if (count+batchCacheCnt > 0) { + locationVec.resize(count+batchCacheCnt); + for (size_t i = 0; i < batchCacheCnt; ++i) { + convertGnssLocation(mBatchedLocationInCache[i], locationVec[i]); + } + for (size_t i = 0; i < count; i++) { + convertGnssLocation(location[i], locationVec[i+batchCacheCnt]); + } + } + auto r = gnssBatchingCbIface->gnssLocationBatchCb(locationVec); + if (!r.isOk()) { + LOC_LOGE("%s] Error from gnssLocationBatchCb 1.0 description=%s", + __func__, r.description().c_str()); + } } + mBatchedLocationInCache.clear(); } + mMutex.unlock(); } static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out, diff --git a/gps/android/2.1/location_api/BatchingAPIClient.h b/gps/android/2.1/location_api/BatchingAPIClient.h index 08d7d237366ff06f49c28b2eca1f8803f4b407b8..2d9ab74d2018ff07df63a6cac40c63a48400105a 100755 --- a/gps/android/2.1/location_api/BatchingAPIClient.h +++ b/gps/android/2.1/location_api/BatchingAPIClient.h @@ -43,6 +43,9 @@ namespace gnss { namespace V2_1 { namespace implementation { + +enum BATCHING_STATE { STARTED, STOPPING, STOPPED }; + class BatchingAPIClient : public LocationAPIClientBase { public: @@ -72,6 +75,9 @@ private: uint32_t mDefaultId; LocationCapabilitiesMask mLocationCapabilitiesMask; sp<V2_0::IGnssBatchingCallback> mGnssBatchingCbIface_2_0; + volatile BATCHING_STATE mState = STOPPED; + + std::vector<Location> mBatchedLocationInCache; }; } // namespace implementation diff --git a/gps/android/utils/Android.bp b/gps/android/utils/Android.bp index c3dc17ae10319e7e539c76804ed82fe4701a4b73..20fea88b8407cbf59276e59c252887e1ae841054 100644 --- a/gps/android/utils/Android.bp +++ b/gps/android/utils/Android.bp @@ -3,7 +3,7 @@ cc_library_static { name: "liblocbatterylistener", vendor: true, - sanitize: GNSS_SANITIZE, + cflags: GNSS_CFLAGS + ["-DBATTERY_LISTENER_ENABLED"], local_include_dirs: ["."], diff --git a/gps/batching/Android.bp b/gps/batching/Android.bp index 9182a0a0ede646b6e10abb505d582fda8925a833..ce794d1938ae47287ff8f25f04fd4a0731d974d2 100644 --- a/gps/batching/Android.bp +++ b/gps/batching/Android.bp @@ -4,7 +4,7 @@ cc_library_shared { name: "libbatching", vendor: true, - sanitize: GNSS_SANITIZE, + shared_libs: [ "libutils", diff --git a/gps/batching/BatchingAdapter.cpp b/gps/batching/BatchingAdapter.cpp index d9f7945bb8c338c56e204e61365acdfe8e2e16e3..4f1a43cbff54a271dd7dbbe4517817765a32bda4 100644 --- a/gps/batching/BatchingAdapter.cpp +++ b/gps/batching/BatchingAdapter.cpp @@ -37,7 +37,9 @@ using namespace loc_core; BatchingAdapter::BatchingAdapter() : - LocAdapterBase(0, LocContext::getLocContext(LocContext::mLocationHalName)), + LocAdapterBase(0, + LocContext::getLocContext(LocContext::mLocationHalName), + false, nullptr, true), mOngoingTripDistance(0), mOngoingTripTBFInterval(0), mTripWithOngoingTBFDropped(false), @@ -50,6 +52,10 @@ BatchingAdapter::BatchingAdapter() : LOC_LOGD("%s]: Constructor", __func__); readConfigCommand(); setConfigCommand(); + + // at last step, let us inform adapater base that we are done + // with initialization, e.g.: ready to process handleEngineUpEvent + doneInit(); } void diff --git a/gps/core/Android.bp b/gps/core/Android.bp index ee8e8077579f3f1f79e73fe124cdc74d52de42c1..fe9f067798cd2674fcc78c32b76da1ece2412533 100644 --- a/gps/core/Android.bp +++ b/gps/core/Android.bp @@ -4,7 +4,7 @@ cc_library_shared { name: "libloc_core", vendor: true, - sanitize: GNSS_SANITIZE, + shared_libs: [ "liblog", diff --git a/gps/core/LocApiBase.cpp b/gps/core/LocApiBase.cpp index 6a0ff84b3fe6ba89378134ae2f80ead87c557f98..860da2e03820d49c5838f2487e35487f680553ee 100644 --- a/gps/core/LocApiBase.cpp +++ b/gps/core/LocApiBase.cpp @@ -1034,7 +1034,7 @@ bool ElapsedRealtimeEstimator::getCurrentTime( struct timespec sinceBootTime; struct timespec sinceBootTimeTest; bool clockGetTimeSuccess = false; - const uint32_t MAX_TIME_DELTA_VALUE_NANOS = 10000; + const uint32_t MAX_TIME_DELTA_VALUE_NANOS = 15000; const uint32_t MAX_GET_TIME_COUNT = 20; /* Attempt to get CLOCK_REALTIME and CLOCK_BOOTIME in succession without an interruption or context switch (for up to MAX_GET_TIME_COUNT times) to avoid errors in the calculation */ diff --git a/gps/core/SystemStatus.cpp b/gps/core/SystemStatus.cpp index d792577afcf67b36a5585b61a0012d14dbd58f26..fe11de07f7915b86dc52c25c456c0830bf29dd10 100644 --- a/gps/core/SystemStatus.cpp +++ b/gps/core/SystemStatus.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2021, 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 @@ -1586,6 +1586,7 @@ bool SystemStatus::eventDataItemNotify(IDataItemCore* dataitem) break; } pthread_mutex_unlock(&mMutexSystemStatus); + LOC_LOGv("DataItemId: %d, whether to record dateitem in cache: %d", dataitem->getId(), ret); return ret; } diff --git a/gps/core/SystemStatus.h b/gps/core/SystemStatus.h index 097e7ccdae2abd6ef8bc29ba4e084bb47cb6f940..638933ab9a497a8a4897c00cac46bf3187373f2a 100644 --- a/gps/core/SystemStatus.h +++ b/gps/core/SystemStatus.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2021, 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 @@ -509,9 +509,11 @@ public: for (uint8_t i = 0; rtv && i < MAX_NETWORK_HANDLES; ++i) { rtv &= (mAllNetworkHandles[i] == peer.mAllNetworkHandles[i]); } - return peer.mApn.compare(mApn); + return rtv && !peer.mApn.compare(mApn); } inline virtual SystemStatusItemBase& collate(SystemStatusItemBase& curInfo) { + LOC_LOGv("NetworkInfo: mAllTypes=%" PRIx64 " connected=%u mType=%x mApn=%s", + mAllTypes, mConnected, mType, mApn.c_str()); uint64_t allTypes = (static_cast<SystemStatusNetworkInfo&>(curInfo)).mAllTypes; string& apn = (static_cast<SystemStatusNetworkInfo&>(curInfo)).mApn; // Replace current with cached table for now and then update diff --git a/gps/etc/gnss_antenna_info.conf b/gps/etc/gnss_antenna_info.conf index 79a2aefb71e3425c7997df38df244e00eafd3c5a..e037daa5afdf14ad1de617f7e8c05f2f65529ead 100644 --- a/gps/etc/gnss_antenna_info.conf +++ b/gps/etc/gnss_antenna_info.conf @@ -80,7 +80,8 @@ # NUMBER_OF_ROWS_SGC_ and NUMBER_OF_COLUMNS_SGC_ represent the number of # rows/columns for signal gain corrections -ANTENNA_INFO_VECTOR_SIZE = 2 +# ANTENNA_INFO_VECTOR_SIZE must be non zero if antenna corrections are sent +# ANTENNA_INFO_VECTOR_SIZE = 2 CARRIER_FREQUENCY_0 = 1575.42 diff --git a/gps/etc/gps.conf b/gps/etc/gps.conf index 1bab00866718adf7c8b6062e69fc8b7df8dbeade..943f0ac571a395bddc4941ddf648d2587de86981 100644 --- a/gps/etc/gps.conf +++ b/gps/etc/gps.conf @@ -5,6 +5,8 @@ ERR_ESTIMATE=0 #NTP server NTP_SERVER=time.xtracloud.net +NTP_SERVER_2=asia.pool.ntp.org +NTP_SERVER_3=0.cn.pool.ntp.org #XTRA CA path XTRA_CA_PATH=/usr/lib/ssl-1.1/certs @@ -18,22 +20,22 @@ DEBUG_LEVEL = 2 INTERMEDIATE_POS=0 # supl version 1.0 -SUPL_VER=0x10000 +SUPL_VER=0x20004 # Emergency SUPL, 1=enable, 0=disable -#SUPL_ES=1 +SUPL_ES=0 #Choose PDN for Emergency SUPL #1 - Use emergency PDN #0 - Use regular SUPL PDN for Emergency SUPL -#USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=0 +USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=0 #SUPL_MODE is a bit mask set in config.xml per carrier by default. #If it is uncommented here, this value will overwrite the value from #config.xml. #MSA=0X2 #MSB=0X1 -#SUPL_MODE= +SUPL_MODE=3 # GPS Capabilities bit mask # SCHEDULING = 0x01 @@ -45,15 +47,15 @@ CAPABILITIES=0x17 # Accuracy threshold for intermediate positions # less accurate positions are ignored, 0 for passing all positions -# ACCURACY_THRES=5000 +ACCURACY_THRES=70 ################################ ##### AGPS server settings ##### ################################ # FOR SUPL SUPPORT, set the following -# SUPL_HOST=supl.host.com or IP -# SUPL_PORT=1234 +# SUPL_HOST=supl.qxwz.com +# SUPL_PORT=7275 # FOR MO SUPL SUPPORT, set the following # MO_SUPL_HOST=supl.host.com or IP @@ -80,7 +82,7 @@ CAPABILITIES=0x17 # 0x2: LPP Control Plane # 0x4: LPP User Plane for NR5G # 0x8: LPP Control Plane for NR5G -LPP_PROFILE = 2 +LPP_PROFILE = 0xf #################################### #Datum Type @@ -146,7 +148,7 @@ SGLTE_TARGET=0 # 0x1: RRC CPlane # 0x2: RRLP UPlane # 0x4: LLP Uplane -A_GLONASS_POS_PROTOCOL_SELECT = 0 +A_GLONASS_POS_PROTOCOL_SELECT = 0xf ################################################## # Select technology for LPPe Control Plane @@ -155,7 +157,7 @@ A_GLONASS_POS_PROTOCOL_SELECT = 0 # 0x2: WLAN AP Measurements for LPPe CP # 0x4: SRN AP measurement for CP # 0x8: Sensor Barometer Measurement LPPe CP -#LPPE_CP_TECHNOLOGY = 0 +LPPE_CP_TECHNOLOGY = 0 ################################################## # Select technology for LPPe User Plane @@ -164,7 +166,7 @@ A_GLONASS_POS_PROTOCOL_SELECT = 0 # 0x2: WLAN AP Measurements for LPPe UP # 0x4: SRN AP measurement for UP # 0x8: Sensor Barometer Measurement LPPe UP -#LPPE_UP_TECHNOLOGY = 0 +LPPE_UP_TECHNOLOGY = 0 ################################################## # AGPS_CONFIG_INJECT @@ -243,6 +245,10 @@ MISSING_PULSE_TIME_DELTA = 900 # logic incase of missing PPS pulse PROPAGATION_TIME_UNCERTAINTY = 1 +XTRA_TEST_ENABLED = 1 +XTRA_THROTTLE_ENABLED = 0 +XTRA_SYSTEM_TIME_INJECT = 1 + ####################################### # APN / IP Type Configuration # APN and IP Type to use for setting @@ -308,7 +314,7 @@ MODEM_TYPE = 1 ##################################### # This is a string that is sent to the framework # in nfwNotifyCb callback -PROXY_APP_PACKAGE_NAME = com.google.android.carrierlocation +PROXY_APP_PACKAGE_NAME = com.lbe.security.miui ##################################### # CP_MTLR_ES @@ -346,6 +352,7 @@ D_LEVEL_TIME_DEPTH = 30 D_LEVEL_MAX_CAPACITY = 300 V_LEVEL_TIME_DEPTH = 200 V_LEVEL_MAX_CAPACITY = 400 +NI_SUPL_DENY_ON_NFW_LOCKED = 0 ################################################## # Allow buffer diag log packets when diag memory allocation @@ -356,7 +363,7 @@ BUFFER_DIAG_LOGGING = 1 ####################################### # NTRIP CLIENT LIBRARY NAME ####################################### -# NTRIP_CLIENT_LIB_NAME = +NTRIP_CLIENT_LIB_NAME = libxiaomi_eDGNSS_client_wrapper.so ################################################## # Correction Data Framework settings @@ -389,3 +396,7 @@ RF_LOSS_BDS_B2A = 0 RF_LOSS_GAL = 0 RF_LOSS_GAL_E5 = 0 RF_LOSS_NAVIC = 0 + +#print more informatation for correction data debugging +#DEBUG_REF_STATION = 1 +#DEBUG_OBSERVATION = 1 diff --git a/gps/etc/lowi.conf b/gps/etc/lowi.conf index ddf38d3e136a2d6f155b7db4e185fad67c6fc6c2..b3781a20169d1a30a02a77fe085f5201cc227863 100644 --- a/gps/etc/lowi.conf +++ b/gps/etc/lowi.conf @@ -22,8 +22,9 @@ # Log level # EL_LOG_OFF = 0, EL_ERROR = 1, EL_WARNING = 2, EL_INFO = 3, EL_DEBUG = 4, EL_VERBOSE = 5, EL_LOG_ALL = 100 -LOWI_LOG_LEVEL = 4 +LOWI_LOG_LEVEL = 3 LOWI_USE_LOWI_LP = 0 LOWI_HE_RTT_SUPPORT = 1 LOWI_USE_NLMSG_FOR_CAPS = 1 LOWI_RTT_WEIGHTED_MEAN = 1 +LOWI_USE_6G_CHANNELS = 1 diff --git a/gps/etc/seccomp_policy/gnss@2.0-base.policy b/gps/etc/seccomp_policy/gnss@2.0-base.policy index 7b930374519a9c4a2d68a4e6921ec8eed5afba02..0a2e17b7194c60ecb47d974d68d64c139b122c4c 100644 --- a/gps/etc/seccomp_policy/gnss@2.0-base.policy +++ b/gps/etc/seccomp_policy/gnss@2.0-base.policy @@ -93,3 +93,27 @@ sendmsg: 1 sendto: 1 recvfrom: 1 +getsockname: 1 +nanosleep: 1 +clone: 1 +setsockopt: 1 +getsockopt: 1 +madvise: 1 + +getitimer: 1 +setitimer: 1 +getpid: 1 +bind: 1 +listen: 1 +getpeername: 1 +socketpair: 1 +wait4: 1 +chown: 1 +fchown: 1 +lchown: 1 +umask: 1 +mmap2: 1 +fstat64: 1 +fstatat64: 1 +_llseek: 1 +geteuid: 1 diff --git a/gps/geofence/Android.bp b/gps/geofence/Android.bp index 4801eb8a96ed1532c924b1a8cdbcd628c18eb1c9..bf8474ffa3e378b1933ac0dd637ac2543af7e09f 100644 --- a/gps/geofence/Android.bp +++ b/gps/geofence/Android.bp @@ -5,7 +5,7 @@ cc_library_shared { name: "libgeofencing", vendor: true, - sanitize: GNSS_SANITIZE, + srcs: [ "GeofenceAdapter.cpp", diff --git a/gps/geofence/GeofenceAdapter.cpp b/gps/geofence/GeofenceAdapter.cpp index f024e3f5dd373af75f5719f607e8adea6dc5e724..1aeea0a1510b3c114bee6b5ba7c93baddc4e59e7 100644 --- a/gps/geofence/GeofenceAdapter.cpp +++ b/gps/geofence/GeofenceAdapter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-2021, 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 @@ -38,9 +38,13 @@ using namespace loc_core; GeofenceAdapter::GeofenceAdapter() : LocAdapterBase(0, LocContext::getLocContext(LocContext::mLocationHalName), - true /*isMaster*/) + true /*isMaster*/, nullptr, true) { LOC_LOGD("%s]: Constructor", __func__); + + // at last step, let us inform adapater base that we are done + // with initialization, e.g.: ready to process handleEngineUpEvent + doneInit(); } void diff --git a/gps/gnss/Agps.cpp b/gps/gnss/Agps.cpp index 9255f88f29e96bff6e66e63fd6c32a00c3c6f6f0..0b95f9996041bf275a27632cbd678051d8eb5acd 100644 --- a/gps/gnss/Agps.cpp +++ b/gps/gnss/Agps.cpp @@ -448,7 +448,7 @@ void AgpsStateMachine::setAPN(char* apn, unsigned int len){ mAPN = NULL; } - if (NULL == apn || len <= 0 || len > MAX_APN_LEN || strlen(apn) != len) { + if (NULL == apn || len > MAX_APN_LEN || strlen(apn) != len) { LOC_LOGD("Invalid apn len (%d) or null apn", len); mAPN = NULL; mAPNLen = 0; @@ -590,7 +590,7 @@ void AgpsManager::requestATL(int connHandle, AGpsExtType agpsType, sm->setApnTypeMask(apnTypeMask); /* Invoke AGPS SM processing */ - AgpsSubscriber subscriber(connHandle, false, false, apnTypeMask); + AgpsSubscriber subscriber(connHandle, true, false, apnTypeMask); sm->setCurrentSubscriber(&subscriber); /* Send subscriber event */ sm->processAgpsEvent(AGPS_EVENT_SUBSCRIBE); diff --git a/gps/gnss/Agps.h b/gps/gnss/Agps.h index 6b43bf572370eb7f5e1b657f29964a36c3b95ddc..8a27cd9531542d6ce3e8b9eaf7235fa6d9aa048c 100644 --- a/gps/gnss/Agps.h +++ b/gps/gnss/Agps.h @@ -167,7 +167,7 @@ public: /* Getter/Setter methods */ void setAPN(char* apn, unsigned int len); - inline char* getAPN() const { return (char*)mAPN; } + inline char* getAPN() const { return mAPN; } inline uint32_t getAPNLen() const { return mAPNLen; } inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; } inline LocApnTypeMask getApnTypeMask() const { return mApnTypeMask; } diff --git a/gps/gnss/Android.bp b/gps/gnss/Android.bp index a3e8de9733a3294b1b2892f897721239e648fad6..736ea81d41acae63ab04d03db59be55587065d3c 100644 --- a/gps/gnss/Android.bp +++ b/gps/gnss/Android.bp @@ -5,7 +5,7 @@ cc_library_shared { name: "libgnss", vendor: true, - sanitize: GNSS_SANITIZE, + shared_libs: [ "libutils", diff --git a/gps/gnss/GnssAdapter.cpp b/gps/gnss/GnssAdapter.cpp index cff02985842d3b418f85b6e51833c35f10a1c64e..f3ccd99e270f088c7c8a9150757da60040ff211e 100644 --- a/gps/gnss/GnssAdapter.cpp +++ b/gps/gnss/GnssAdapter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2021 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 @@ -77,6 +77,8 @@ static void agpsCloseResultCb (bool isSuccess, AGpsExtType agpsType, void* userD typedef const CdfwInterface* (*getCdfwInterface)(); +typedef void getPdnTypeFromWds(const std::string& apnName, std::function<void(int)> pdnCb); + inline bool GnssReportLoggerUtil::isLogEnabled() { return (mLogLatency != nullptr); } @@ -889,6 +891,8 @@ GnssAdapter::setConfig() ContextBase::mGps_conf.MO_SUPL_PORT, LOC_AGPS_MO_SUPL_SERVER); + std::string moServerUrl = getMoServerUrl(); + std::string serverUrl = getServerUrl(); // inject the configurations into modem loc_gps_cfg_s gpsConf = ContextBase::mGps_conf; loc_sap_cfg_s_type sapConf = ContextBase::mSap_conf; @@ -936,8 +940,10 @@ GnssAdapter::setConfig() gnssConfigRequested.blacklistedSvIds.assign(mBlacklistedSvIds.begin(), mBlacklistedSvIds.end()); mLocApi->sendMsg(new LocApiMsg( - [this, gpsConf, sapConf, oldMoServerUrl, gnssConfigRequested] () mutable { - gnssUpdateConfig(oldMoServerUrl, gnssConfigRequested, gnssConfigRequested); + [this, gpsConf, sapConf, oldMoServerUrl, moServerUrl, + serverUrl, gnssConfigRequested] () mutable { + gnssUpdateConfig(oldMoServerUrl, moServerUrl, serverUrl, + gnssConfigRequested, gnssConfigRequested); // set nmea mask type uint32_t mask = 0; @@ -1025,6 +1031,7 @@ GnssAdapter::setConfig() } std::vector<LocationError> GnssAdapter::gnssUpdateConfig(const std::string& oldMoServerUrl, + const std::string& moServerUrl, const std::string& serverUrl, GnssConfig& gnssConfigRequested, GnssConfig& gnssConfigNeedEngineUpdate, size_t count) { loc_gps_cfg_s gpsConf = ContextBase::mGps_conf; size_t index = 0; @@ -1034,9 +1041,6 @@ std::vector<LocationError> GnssAdapter::gnssUpdateConfig(const std::string& oldM errsList.insert(errsList.begin(), count, LOCATION_ERROR_SUCCESS); } - std::string serverUrl = getServerUrl(); - std::string moServerUrl = getMoServerUrl(); - int serverUrlLen = serverUrl.length(); int moServerUrlLen = moServerUrl.length(); @@ -1424,10 +1428,14 @@ GnssAdapter::gnssUpdateConfigCommand(const GnssConfig& config) adapter.reportResponse(countOfConfigs, errs.data(), ids.data()); }); + std::string moServerUrl = adapter.getMoServerUrl(); + std::string serverUrl = adapter.getServerUrl(); mApi.sendMsg(new LocApiMsg( [&adapter, gnssConfigRequested, gnssConfigNeedEngineUpdate, - countOfConfigs, configCollectiveResponse, errs] () mutable { + moServerUrl, serverUrl, countOfConfigs, configCollectiveResponse, + errs] () mutable { std::vector<LocationError> errsList = adapter.gnssUpdateConfig("", + moServerUrl, serverUrl, gnssConfigRequested, gnssConfigNeedEngineUpdate, countOfConfigs); configCollectiveResponse->returnToSender(errsList); @@ -5214,6 +5222,38 @@ bool GnssAdapter::releaseATL(int connHandle){ return true; } +void GnssAdapter::reportPdnTypeFromWds(int pdnType, AGpsExtType agpsType, std::string apnName, + AGpsBearerType bearerType) { + LOC_LOGd("pdnType from WDS QMI: %d, agpsType: %d, apnName: %s, bearerType: %d", + pdnType, agpsType, apnName.c_str(), bearerType); + + struct MsgReportAtlPdn : public LocMsg { + GnssAdapter& mAdapter; + int mPdnType; + AgpsManager* mAgpsManager; + AGpsExtType mAgpsType; + string mApnName; + AGpsBearerType mBearerType; + + inline MsgReportAtlPdn(GnssAdapter& adapter, int pdnType, + AgpsManager* agpsManager, AGpsExtType agpsType, + const string& apnName, AGpsBearerType bearerType) : + LocMsg(), mAgpsManager(agpsManager), mAgpsType(agpsType), + mApnName(apnName), mBearerType(bearerType), + mAdapter(adapter), mPdnType(pdnType) {} + inline virtual void proc() const { + mAgpsManager->reportAtlOpenSuccess(mAgpsType, + const_cast<char*>(mApnName.c_str()), + mApnName.length(), mPdnType<=0? mBearerType:mPdnType); + } + }; + + AGpsBearerType atlPdnType = (pdnType+1) & 3; // convert WDS QMI pdn type to AgpsBearerType + sendMsg(new MsgReportAtlPdn(*this, atlPdnType, &mAgpsManager, + agpsType, apnName, bearerType)); +} + + void GnssAdapter::dataConnOpenCommand( AGpsExtType agpsType, const char* apnName, int apnLen, AGpsBearerType bearerType){ @@ -5221,17 +5261,16 @@ void GnssAdapter::dataConnOpenCommand( LOC_LOGI("GnssAdapter::frameworkDataConnOpen"); struct AgpsMsgAtlOpenSuccess: public LocMsg { - + GnssAdapter& mAdapter; AgpsManager* mAgpsManager; AGpsExtType mAgpsType; char* mApnName; - int mApnLen; AGpsBearerType mBearerType; - inline AgpsMsgAtlOpenSuccess(AgpsManager* agpsManager, AGpsExtType agpsType, - const char* apnName, int apnLen, AGpsBearerType bearerType) : + inline AgpsMsgAtlOpenSuccess(GnssAdapter& adapter, AgpsManager* agpsManager, + AGpsExtType agpsType, const char* apnName, int apnLen, AGpsBearerType bearerType) : LocMsg(), mAgpsManager(agpsManager), mAgpsType(agpsType), mApnName( - new char[apnLen + 1]), mApnLen(apnLen), mBearerType(bearerType) { + new char[apnLen + 1]), mBearerType(bearerType), mAdapter(adapter) { LOC_LOGV("AgpsMsgAtlOpenSuccess"); if (mApnName == nullptr) { @@ -5249,19 +5288,36 @@ void GnssAdapter::dataConnOpenCommand( } inline virtual void proc() const { - - LOC_LOGV("AgpsMsgAtlOpenSuccess::proc()"); - mAgpsManager->reportAtlOpenSuccess(mAgpsType, mApnName, mApnLen, mBearerType); + LOC_LOGv("AgpsMsgAtlOpenSuccess::proc()"); + string apn(mApnName); + //Use QMI WDS API to query IP Protocol from modem profile + void* libHandle = nullptr; + getPdnTypeFromWds* getPdnTypeFunc = (getPdnTypeFromWds*)dlGetSymFromLib(libHandle, + #ifdef USE_GLIB + "libloc_api_wds.so", "_Z10getPdnTypeRKNSt7__cxx1112basic_string"\ + "IcSt11char_traitsIcESaIcEEESt8functionIFviEE"); + #else + "libloc_api_wds.so", "_Z10getPdnTypeRKNSt3__112basic_stringIcNS_11char_traits"\ + "IcEENS_9allocatorIcEEEENS_8functionIFviEEE"); + #endif + + std::function<void(int)> wdsPdnTypeCb = std::bind(&GnssAdapter::reportPdnTypeFromWds, + &mAdapter, std::placeholders::_1, mAgpsType, apn, mBearerType); + if (getPdnTypeFunc != nullptr) { + LOC_LOGv("dlGetSymFromLib success"); + (*getPdnTypeFunc)(apn, wdsPdnTypeCb); + } else { + mAgpsManager->reportAtlOpenSuccess(mAgpsType, mApnName, apn.length(), mBearerType); + } } }; // Added inital length checks for apnlen check to avoid security issues // In case of failure reporting the same - if (NULL == apnName || apnLen <= 0 || apnLen > MAX_APN_LEN || - (strlen(apnName) != (unsigned)apnLen)) { + if (NULL == apnName || apnLen > MAX_APN_LEN || (strlen(apnName) != apnLen)) { LOC_LOGe("%s]: incorrect apnlen length or incorrect apnName", __func__); mAgpsManager.reportAtlClosed(agpsType); } else { - sendMsg( new AgpsMsgAtlOpenSuccess( + sendMsg( new AgpsMsgAtlOpenSuccess(*this, &mAgpsManager, agpsType, apnName, apnLen, bearerType)); } } @@ -6731,7 +6787,9 @@ GnssAdapter::reportGnssAntennaInformation(const antennaInfoCb antennaInfoCallbac } gnssAntennaInformations.push_back(std::move(gnssAntennaInfo)); } - antennaInfoCallback(gnssAntennaInformations); + if (antennaInfoVectorSize > 0) { + antennaInfoCallback(gnssAntennaInformations); + } } /* ==== DGnss Usable Reporter ========================================================= */ @@ -6768,10 +6826,15 @@ void GnssAdapter::enablePPENtripStreamCommand(const GnssNtripConnectionParams& p bool enableRTKEngine) { (void)enableRTKEngine; //future parameter, not used + if (0 == params.size || params.hostNameOrIp.empty() || params.mountPoint.empty() || + params.username.empty() || params.password.empty()) { + LOC_LOGe("Ntrip parameters are invalid!"); + return; + } struct enableNtripMsg : public LocMsg { GnssAdapter& mAdapter; - const GnssNtripConnectionParams& mParams; + const GnssNtripConnectionParams mParams; inline enableNtripMsg(GnssAdapter& adapter, const GnssNtripConnectionParams& params) : diff --git a/gps/gnss/GnssAdapter.h b/gps/gnss/GnssAdapter.h index 6b8d024b191867ba832b6b9f558cf77390ade306..d7b42757a170cdf939e8423e69523a57796b5f2f 100644 --- a/gps/gnss/GnssAdapter.h +++ b/gps/gnss/GnssAdapter.h @@ -321,7 +321,6 @@ protected: void logLatencyInfo(); public: - GnssAdapter(); virtual inline ~GnssAdapter() { } @@ -409,6 +408,8 @@ public: void deleteAidingData(const GnssAidingData &data, uint32_t sessionId); void gnssUpdateXtraThrottleCommand(const bool enabled); std::vector<LocationError> gnssUpdateConfig(const std::string& oldMoServerUrl, + const std::string& moServerUrl, + const std::string& serverUrl, GnssConfig& gnssConfigRequested, GnssConfig& gnssConfigNeedEngineUpdate, size_t count = 0); @@ -525,6 +526,8 @@ public: ( const std::unordered_map<LocationQwesFeatureType, bool> &featureMap ); + void reportPdnTypeFromWds(int pdnType, AGpsExtType agpsType, std::string apnName, + AGpsBearerType bearerType); /* ======== UTILITIES ================================================================= */ bool needReportForGnssClient(const UlpLocation& ulpLocation, diff --git a/gps/gnss/location_gnss.cpp b/gps/gnss/location_gnss.cpp index 0454a13248061651427b89cb923ba2ef75fe80b3..8f67369ee4717da8f046ba2731d7283b581995d1 100644 --- a/gps/gnss/location_gnss.cpp +++ b/gps/gnss/location_gnss.cpp @@ -519,7 +519,7 @@ static uint32_t antennaInfoInit(const antennaInfoCb antennaInfoCallback) { static void antennaInfoClose() { if (NULL != gGnssAdapter) { return gGnssAdapter->antennaInfoCloseCommand(); - } + } } static uint32_t configRobustLocation(bool enable, bool enableForE911){ diff --git a/gps/gps_vendor_product.mk b/gps/gps_vendor_product.mk index 0e578e801dbfb53e7f68c598ad79b9cd799db849..cd356841500757ffdb17c21a3a3414ac85e18042 100644 --- a/gps/gps_vendor_product.mk +++ b/gps/gps_vendor_product.mk @@ -27,6 +27,10 @@ ifneq (,$(filter $(LOC_BOARD_PLATFORM_LIST),$(TARGET_BOARD_PLATFORM))) PRODUCT_PACKAGES += gps.conf PRODUCT_PACKAGES += flp.conf PRODUCT_PACKAGES += gnss_antenna_info.conf +PRODUCT_PACKAGES += gnss@2.0-base.policy +PRODUCT_PACKAGES += gnss@2.0-xtra-daemon.policy +PRODUCT_PACKAGES += gnss@2.0-xtwifi-client.policy +PRODUCT_PACKAGES += gnss@2.0-xtwifi-inet-agent.policy PRODUCT_PACKAGES += libloc_pla_headers PRODUCT_PACKAGES += liblocation_api_headers PRODUCT_PACKAGES += libgps.utils_headers diff --git a/gps/location/Android.bp b/gps/location/Android.bp index 8532a08597806848693777b97de201aeb660a1da..fb4af2dcd19a39a976f087ae9f404f8fa6a8deda 100644 --- a/gps/location/Android.bp +++ b/gps/location/Android.bp @@ -4,7 +4,7 @@ cc_library_shared { name: "liblocation_api", vendor: true, - sanitize: GNSS_SANITIZE, + shared_libs: [ "libutils", diff --git a/gps/location/LocationAPIClientBase.cpp b/gps/location/LocationAPIClientBase.cpp index 4865a16e9a73e1ba08ccc9c1046e16f5a6491bd1..ea15a76d3002307137871c4a18fb024e359399c8 100644 --- a/gps/location/LocationAPIClientBase.cpp +++ b/gps/location/LocationAPIClientBase.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, 2020 The Linux Foundation. All rights reserved. +/* Copyright (c) 2017, 2020-2021 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 @@ -634,7 +634,7 @@ uint32_t LocationAPIClientBase::locAPIGetBatchedLocations(uint32_t id, size_t co } } else { retVal = LOCATION_ERROR_ID_UNKNOWN; - LOC_LOGE("%s:%d] invalid session: %d.", __FUNCTION__, __LINE__, id); + LOC_LOGd("unknown session id: %d, might flush() a stopped session", id); } } pthread_mutex_unlock(&mMutex); diff --git a/gps/utils/Android.bp b/gps/utils/Android.bp index 7d43d573b7407358cc011544e42b2afb88b71020..33d84401619ea4ae7e1b3d6072d45e112c7e67e4 100644 --- a/gps/utils/Android.bp +++ b/gps/utils/Android.bp @@ -4,7 +4,7 @@ cc_library_shared { name: "libgps.utils", vendor: true, - sanitize: GNSS_SANITIZE, + //# Libs shared_libs: [