sm7325-common: gps: update to LA.UM.9.12.r1-13500.01-SMxx50.QSSI12.0

This commit is contained in:
SGCMarkus 2022-03-26 23:27:49 +01:00
parent 616168edec
commit 81c175bd93
28 changed files with 70 additions and 201 deletions

View File

@ -16,6 +16,18 @@ GNSS_CFLAGS = [
"-Wno-error=date-time", "-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, /* Activate the following for debug purposes only,
comment out for production */ comment out for production */
GNSS_SANITIZE_DIAG = { GNSS_SANITIZE_DIAG = {

View File

@ -36,6 +36,9 @@ endif
LOCAL_PATH := $(call my-dir) LOCAL_PATH := $(call my-dir)
include $(call all-makefiles-under,$(LOCAL_PATH)) include $(call all-makefiles-under,$(LOCAL_PATH))
GNSS_SANITIZE_DIAG := cfi bounds null unreachable integer address GNSS_SANITIZE := cfi bounds null unreachable integer
# Activate the following two lines for regression testing
#GNSS_SANITIZE += address
#GNSS_SANITIZE_DIAG := $(GNSS_SANITIZE)
endif # ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) endif # ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),)

View File

@ -2,7 +2,7 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti 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 # activate the following line for debug purposes only, comment out for production
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
LOCAL_VENDOR_MODULE := true LOCAL_VENDOR_MODULE := true
@ -58,7 +58,7 @@ include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.gnss@1.0-service-qti 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 # activate the following line for debug purposes only, comment out for production
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@1.0-service-qti.xml LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@1.0-service-qti.xml

View File

@ -2,7 +2,7 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.gnss@1.1-impl-qti 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 # activate the following line for debug purposes only, comment out for production
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
LOCAL_VENDOR_MODULE := true LOCAL_VENDOR_MODULE := true
@ -59,7 +59,7 @@ include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.gnss@1.1-service-qti 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 # activate the following line for debug purposes only, comment out for production
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@1.1-service-qti.xml LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@1.1-service-qti.xml

View File

@ -2,7 +2,7 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.gnss@2.0-impl-qti 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 # activate the following line for debug purposes only, comment out for production
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
LOCAL_VENDOR_MODULE := true LOCAL_VENDOR_MODULE := true
@ -71,7 +71,7 @@ include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.gnss@2.0-service-qti 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 # activate the following line for debug purposes only, comment out for production
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@2.0-service-qti.xml LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@2.0-service-qti.xml

View File

@ -32,7 +32,7 @@ namespace implementation {
static AGnss* spAGnss = nullptr; static AGnss* spAGnss = nullptr;
AGnss::AGnss(Gnss* gnss) : mGnss(gnss), mType(LOC_AGPS_TYPE_INVALID) { AGnss::AGnss(Gnss* gnss) : mGnss(gnss) {
spAGnss = this; spAGnss = this;
} }
@ -51,9 +51,6 @@ void AGnss::statusCb(AGpsExtType type, LocAGpsStatusValue status) {
V2_0::IAGnssCallback::AGnssType aType; V2_0::IAGnssCallback::AGnssType aType;
IAGnssCallback::AGnssStatusValue aStatus; IAGnssCallback::AGnssStatusValue aStatus;
// cache the AGps Type
mType = type;
switch (type) { switch (type) {
case LOC_AGPS_TYPE_SUPL: case LOC_AGPS_TYPE_SUPL:
aType = IAGnssCallback::AGnssType::SUPL; aType = IAGnssCallback::AGnssType::SUPL;
@ -141,20 +138,18 @@ Return<bool> AGnss::dataConnFailed() {
Return<bool> AGnss::dataConnOpen(uint64_t /*networkHandle*/, const hidl_string& apn, Return<bool> AGnss::dataConnOpen(uint64_t /*networkHandle*/, const hidl_string& apn,
V2_0::IAGnss::ApnIpType apnIpType) { V2_0::IAGnss::ApnIpType apnIpType) {
if (mGnss == nullptr || mGnss->getGnssInterface() == nullptr){ if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
LOC_LOGE("Null GNSS interface"); LOC_LOGE("Null GNSS interface");
return false; return false;
} }
std::string apnString(apn.c_str()); /* Validate */
// During Emergency SUPL, an apn name of "sos" means that no if(apn.empty()){
// apn was found, like in the simless case, so apn is cleared LOC_LOGE("Invalid APN");
if (LOC_AGPS_TYPE_SUPL_ES == mType && "sos" == apnString) { return false;
LOC_LOGD("dataConnOpen APN name = [sos] cleared");
apnString.clear();
} }
LOC_LOGD("dataConnOpen APN name = [%s]", apnString.c_str()); LOC_LOGD("dataConnOpen APN name = [%s]", apn.c_str());
AGpsBearerType bearerType; AGpsBearerType bearerType;
switch (apnIpType) { switch (apnIpType) {
@ -173,7 +168,7 @@ Return<bool> AGnss::dataConnOpen(uint64_t /*networkHandle*/, const hidl_string&
} }
mGnss->getGnssInterface()->agpsDataConnOpen( mGnss->getGnssInterface()->agpsDataConnOpen(
LOC_AGPS_TYPE_SUPL, apnString.c_str(), apnString.size(), (int)bearerType); LOC_AGPS_TYPE_SUPL, apn.c_str(), apn.size(), (int)bearerType);
return true; return true;
} }

View File

@ -67,8 +67,6 @@ struct AGnss : public V2_0::IAGnss {
private: private:
Gnss* mGnss = nullptr; Gnss* mGnss = nullptr;
sp<V2_0::IAGnssCallback> mAGnssCbIface = nullptr; sp<V2_0::IAGnssCallback> mAGnssCbIface = nullptr;
AGpsExtType mType;
}; };
} // namespace implementation } // namespace implementation

View File

@ -2,6 +2,7 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.gnss@2.1-impl-qti 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 # activate the following line for debug purposes only, comment out for production
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
LOCAL_VENDOR_MODULE := true LOCAL_VENDOR_MODULE := true
@ -73,7 +74,7 @@ include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.gnss@2.1-service-qti 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 # activate the following line for debug purposes only, comment out for production
#LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG)
LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@2.1-service-qti.xml LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@2.1-service-qti.xml

View File

@ -3,7 +3,7 @@ cc_library_static {
name: "liblocbatterylistener", name: "liblocbatterylistener",
vendor: true, vendor: true,
sanitize: GNSS_SANITIZE,
cflags: GNSS_CFLAGS + ["-DBATTERY_LISTENER_ENABLED"], cflags: GNSS_CFLAGS + ["-DBATTERY_LISTENER_ENABLED"],
local_include_dirs: ["."], local_include_dirs: ["."],

View File

@ -4,7 +4,7 @@ cc_library_shared {
name: "libbatching", name: "libbatching",
vendor: true, vendor: true,
sanitize: GNSS_SANITIZE,
shared_libs: [ shared_libs: [
"libutils", "libutils",

View File

@ -37,9 +37,7 @@
using namespace loc_core; using namespace loc_core;
BatchingAdapter::BatchingAdapter() : BatchingAdapter::BatchingAdapter() :
LocAdapterBase(0, LocAdapterBase(0, LocContext::getLocContext(LocContext::mLocationHalName)),
LocContext::getLocContext(LocContext::mLocationHalName),
false, nullptr, true),
mOngoingTripDistance(0), mOngoingTripDistance(0),
mOngoingTripTBFInterval(0), mOngoingTripTBFInterval(0),
mTripWithOngoingTBFDropped(false), mTripWithOngoingTBFDropped(false),
@ -52,10 +50,6 @@ BatchingAdapter::BatchingAdapter() :
LOC_LOGD("%s]: Constructor", __func__); LOC_LOGD("%s]: Constructor", __func__);
readConfigCommand(); readConfigCommand();
setConfigCommand(); setConfigCommand();
// at last step, let us inform adapater base that we are done
// with initialization, e.g.: ready to process handleEngineUpEvent
doneInit();
} }
void void

View File

@ -4,7 +4,7 @@ cc_library_shared {
name: "libloc_core", name: "libloc_core",
vendor: true, vendor: true,
sanitize: GNSS_SANITIZE,
shared_libs: [ shared_libs: [
"liblog", "liblog",

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
@ -1586,7 +1586,6 @@ bool SystemStatus::eventDataItemNotify(IDataItemCore* dataitem)
break; break;
} }
pthread_mutex_unlock(&mMutexSystemStatus); pthread_mutex_unlock(&mMutexSystemStatus);
LOC_LOGv("DataItemId: %d, whether to record dateitem in cache: %d", dataitem->getId(), ret);
return ret; return ret;
} }

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
@ -509,11 +509,9 @@ public:
for (uint8_t i = 0; rtv && i < MAX_NETWORK_HANDLES; ++i) { for (uint8_t i = 0; rtv && i < MAX_NETWORK_HANDLES; ++i) {
rtv &= (mAllNetworkHandles[i] == peer.mAllNetworkHandles[i]); rtv &= (mAllNetworkHandles[i] == peer.mAllNetworkHandles[i]);
} }
return rtv & peer.mApn.compare(mApn); return peer.mApn.compare(mApn);
} }
inline virtual SystemStatusItemBase& collate(SystemStatusItemBase& curInfo) { 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; uint64_t allTypes = (static_cast<SystemStatusNetworkInfo&>(curInfo)).mAllTypes;
string& apn = (static_cast<SystemStatusNetworkInfo&>(curInfo)).mApn; string& apn = (static_cast<SystemStatusNetworkInfo&>(curInfo)).mApn;
// Replace current with cached table for now and then update // Replace current with cached table for now and then update

View File

@ -93,27 +93,3 @@ sendmsg: 1
sendto: 1 sendto: 1
recvfrom: 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

View File

@ -32,7 +32,7 @@
fdatasync: 1 fdatasync: 1
getdents64: 1 getdents64: 1
gettimeofday: 1 gettimeofday: 1
ioctl: 1 #ioctl: arg1 == _IOC(_IOC_NONE || arg1 == _IOC(_IOC_READ || arg1 == VSOC_MAYBE_SEND_INTERRUPT_TO_HOST
lseek: 1 lseek: 1
madvise: 1 madvise: 1
mkdirat: 1 mkdirat: 1
@ -43,31 +43,3 @@ timerfd_settime: 1
epoll_create1: 1 epoll_create1: 1
epoll_pwait: 1 epoll_pwait: 1
epoll_ctl: 1 epoll_ctl: 1
sched_getaffinity: 1
gettid: 1
fchown: 1
fchmod: 1
fchmodat: 1
getsockopt: 1
fchownat: 1
fstat: 1
fstatfs: 1
newfstatat: 1
sendmsg: 1
recvmsg: 1
gettimeofday: 1
setsockopt: 1
rt_tgsigqueueinfo: 1
ioctl: 1
mmap: 1
getuid32: 1
getuid: 1
fstat64: 1
fstatat64: 1
mkdir: 1
rmdir: 1
creat: 1
chmod: 1
lseek: 1
geteuid32: 1

View File

@ -31,13 +31,3 @@
unlinkat: 1 unlinkat: 1
sched_getaffinity: 1 sched_getaffinity: 1
newfstatat: 1
fchmodat: 1
madvise: 1
mmap: 1
getuid: 1
getuid32: 1
fstat64: 1
fstatat64: 1
gettimeofday: 1
getdents64: 1

View File

@ -5,7 +5,7 @@ cc_library_shared {
name: "libgeofencing", name: "libgeofencing",
vendor: true, vendor: true,
sanitize: GNSS_SANITIZE,
srcs: [ srcs: [
"GeofenceAdapter.cpp", "GeofenceAdapter.cpp",

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2013-2021, The Linux Foundation. All rights reserved. /* Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
@ -38,13 +38,9 @@ using namespace loc_core;
GeofenceAdapter::GeofenceAdapter() : GeofenceAdapter::GeofenceAdapter() :
LocAdapterBase(0, LocAdapterBase(0,
LocContext::getLocContext(LocContext::mLocationHalName), LocContext::getLocContext(LocContext::mLocationHalName),
true /*isMaster*/, nullptr, true) true /*isMaster*/)
{ {
LOC_LOGD("%s]: Constructor", __func__); 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 void

View File

@ -448,7 +448,7 @@ void AgpsStateMachine::setAPN(char* apn, unsigned int len){
mAPN = NULL; mAPN = NULL;
} }
if (NULL == apn || len > MAX_APN_LEN || strlen(apn) != len) { if (NULL == apn || len <= 0 || len > MAX_APN_LEN || strlen(apn) != len) {
LOC_LOGD("Invalid apn len (%d) or null apn", len); LOC_LOGD("Invalid apn len (%d) or null apn", len);
mAPN = NULL; mAPN = NULL;
mAPNLen = 0; mAPNLen = 0;
@ -590,7 +590,7 @@ void AgpsManager::requestATL(int connHandle, AGpsExtType agpsType,
sm->setApnTypeMask(apnTypeMask); sm->setApnTypeMask(apnTypeMask);
/* Invoke AGPS SM processing */ /* Invoke AGPS SM processing */
AgpsSubscriber subscriber(connHandle, true, false, apnTypeMask); AgpsSubscriber subscriber(connHandle, false, false, apnTypeMask);
sm->setCurrentSubscriber(&subscriber); sm->setCurrentSubscriber(&subscriber);
/* Send subscriber event */ /* Send subscriber event */
sm->processAgpsEvent(AGPS_EVENT_SUBSCRIBE); sm->processAgpsEvent(AGPS_EVENT_SUBSCRIBE);

View File

@ -167,7 +167,7 @@ public:
/* Getter/Setter methods */ /* Getter/Setter methods */
void setAPN(char* apn, unsigned int len); void setAPN(char* apn, unsigned int len);
inline char* getAPN() const { return mAPN; } inline char* getAPN() const { return (char*)mAPN; }
inline uint32_t getAPNLen() const { return mAPNLen; } inline uint32_t getAPNLen() const { return mAPNLen; }
inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; } inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; }
inline LocApnTypeMask getApnTypeMask() const { return mApnTypeMask; } inline LocApnTypeMask getApnTypeMask() const { return mApnTypeMask; }

View File

@ -5,7 +5,7 @@ cc_library_shared {
name: "libgnss", name: "libgnss",
vendor: true, vendor: true,
sanitize: GNSS_SANITIZE,
shared_libs: [ shared_libs: [
"libutils", "libutils",

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
@ -77,8 +77,6 @@ static void agpsCloseResultCb (bool isSuccess, AGpsExtType agpsType, void* userD
typedef const CdfwInterface* (*getCdfwInterface)(); typedef const CdfwInterface* (*getCdfwInterface)();
typedef void getPdnTypeFromWds(const std::string& apnName, std::function<void(int)> pdnCb);
inline bool GnssReportLoggerUtil::isLogEnabled() { inline bool GnssReportLoggerUtil::isLogEnabled() {
return (mLogLatency != nullptr); return (mLogLatency != nullptr);
} }
@ -891,8 +889,6 @@ GnssAdapter::setConfig()
ContextBase::mGps_conf.MO_SUPL_PORT, ContextBase::mGps_conf.MO_SUPL_PORT,
LOC_AGPS_MO_SUPL_SERVER); LOC_AGPS_MO_SUPL_SERVER);
std::string moServerUrl = getMoServerUrl();
std::string serverUrl = getServerUrl();
// inject the configurations into modem // inject the configurations into modem
loc_gps_cfg_s gpsConf = ContextBase::mGps_conf; loc_gps_cfg_s gpsConf = ContextBase::mGps_conf;
loc_sap_cfg_s_type sapConf = ContextBase::mSap_conf; loc_sap_cfg_s_type sapConf = ContextBase::mSap_conf;
@ -940,10 +936,8 @@ GnssAdapter::setConfig()
gnssConfigRequested.blacklistedSvIds.assign(mBlacklistedSvIds.begin(), gnssConfigRequested.blacklistedSvIds.assign(mBlacklistedSvIds.begin(),
mBlacklistedSvIds.end()); mBlacklistedSvIds.end());
mLocApi->sendMsg(new LocApiMsg( mLocApi->sendMsg(new LocApiMsg(
[this, gpsConf, sapConf, oldMoServerUrl, moServerUrl, [this, gpsConf, sapConf, oldMoServerUrl, gnssConfigRequested] () mutable {
serverUrl, gnssConfigRequested] () mutable { gnssUpdateConfig(oldMoServerUrl, gnssConfigRequested, gnssConfigRequested);
gnssUpdateConfig(oldMoServerUrl, moServerUrl, serverUrl,
gnssConfigRequested, gnssConfigRequested);
// set nmea mask type // set nmea mask type
uint32_t mask = 0; uint32_t mask = 0;
@ -1031,7 +1025,6 @@ GnssAdapter::setConfig()
} }
std::vector<LocationError> GnssAdapter::gnssUpdateConfig(const std::string& oldMoServerUrl, std::vector<LocationError> GnssAdapter::gnssUpdateConfig(const std::string& oldMoServerUrl,
const std::string& moServerUrl, const std::string& serverUrl,
GnssConfig& gnssConfigRequested, GnssConfig& gnssConfigNeedEngineUpdate, size_t count) { GnssConfig& gnssConfigRequested, GnssConfig& gnssConfigNeedEngineUpdate, size_t count) {
loc_gps_cfg_s gpsConf = ContextBase::mGps_conf; loc_gps_cfg_s gpsConf = ContextBase::mGps_conf;
size_t index = 0; size_t index = 0;
@ -1041,6 +1034,9 @@ std::vector<LocationError> GnssAdapter::gnssUpdateConfig(const std::string& oldM
errsList.insert(errsList.begin(), count, LOCATION_ERROR_SUCCESS); errsList.insert(errsList.begin(), count, LOCATION_ERROR_SUCCESS);
} }
std::string serverUrl = getServerUrl();
std::string moServerUrl = getMoServerUrl();
int serverUrlLen = serverUrl.length(); int serverUrlLen = serverUrl.length();
int moServerUrlLen = moServerUrl.length(); int moServerUrlLen = moServerUrl.length();
@ -1428,14 +1424,10 @@ GnssAdapter::gnssUpdateConfigCommand(const GnssConfig& config)
adapter.reportResponse(countOfConfigs, errs.data(), ids.data()); adapter.reportResponse(countOfConfigs, errs.data(), ids.data());
}); });
std::string moServerUrl = adapter.getMoServerUrl();
std::string serverUrl = adapter.getServerUrl();
mApi.sendMsg(new LocApiMsg( mApi.sendMsg(new LocApiMsg(
[&adapter, gnssConfigRequested, gnssConfigNeedEngineUpdate, [&adapter, gnssConfigRequested, gnssConfigNeedEngineUpdate,
moServerUrl, serverUrl, countOfConfigs, configCollectiveResponse, countOfConfigs, configCollectiveResponse, errs] () mutable {
errs] () mutable {
std::vector<LocationError> errsList = adapter.gnssUpdateConfig("", std::vector<LocationError> errsList = adapter.gnssUpdateConfig("",
moServerUrl, serverUrl,
gnssConfigRequested, gnssConfigNeedEngineUpdate, countOfConfigs); gnssConfigRequested, gnssConfigNeedEngineUpdate, countOfConfigs);
configCollectiveResponse->returnToSender(errsList); configCollectiveResponse->returnToSender(errsList);
@ -5222,38 +5214,6 @@ bool GnssAdapter::releaseATL(int connHandle){
return true; 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( void GnssAdapter::dataConnOpenCommand(
AGpsExtType agpsType, AGpsExtType agpsType,
const char* apnName, int apnLen, AGpsBearerType bearerType){ const char* apnName, int apnLen, AGpsBearerType bearerType){
@ -5261,16 +5221,17 @@ void GnssAdapter::dataConnOpenCommand(
LOC_LOGI("GnssAdapter::frameworkDataConnOpen"); LOC_LOGI("GnssAdapter::frameworkDataConnOpen");
struct AgpsMsgAtlOpenSuccess: public LocMsg { struct AgpsMsgAtlOpenSuccess: public LocMsg {
GnssAdapter& mAdapter;
AgpsManager* mAgpsManager; AgpsManager* mAgpsManager;
AGpsExtType mAgpsType; AGpsExtType mAgpsType;
char* mApnName; char* mApnName;
int mApnLen;
AGpsBearerType mBearerType; AGpsBearerType mBearerType;
inline AgpsMsgAtlOpenSuccess(GnssAdapter& adapter, AgpsManager* agpsManager, inline AgpsMsgAtlOpenSuccess(AgpsManager* agpsManager, AGpsExtType agpsType,
AGpsExtType agpsType, const char* apnName, int apnLen, AGpsBearerType bearerType) : const char* apnName, int apnLen, AGpsBearerType bearerType) :
LocMsg(), mAgpsManager(agpsManager), mAgpsType(agpsType), mApnName( LocMsg(), mAgpsManager(agpsManager), mAgpsType(agpsType), mApnName(
new char[apnLen + 1]), mBearerType(bearerType), mAdapter(adapter) { new char[apnLen + 1]), mApnLen(apnLen), mBearerType(bearerType) {
LOC_LOGV("AgpsMsgAtlOpenSuccess"); LOC_LOGV("AgpsMsgAtlOpenSuccess");
if (mApnName == nullptr) { if (mApnName == nullptr) {
@ -5288,36 +5249,19 @@ void GnssAdapter::dataConnOpenCommand(
} }
inline virtual void proc() const { inline virtual void proc() const {
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, LOC_LOGV("AgpsMsgAtlOpenSuccess::proc()");
&mAdapter, std::placeholders::_1, mAgpsType, apn, mBearerType); mAgpsManager->reportAtlOpenSuccess(mAgpsType, mApnName, mApnLen, 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 // Added inital length checks for apnlen check to avoid security issues
// In case of failure reporting the same // In case of failure reporting the same
if (NULL == apnName || apnLen > MAX_APN_LEN || (strlen(apnName) != apnLen)) { if (NULL == apnName || apnLen <= 0 || apnLen > MAX_APN_LEN ||
(strlen(apnName) != (unsigned)apnLen)) {
LOC_LOGe("%s]: incorrect apnlen length or incorrect apnName", __func__); LOC_LOGe("%s]: incorrect apnlen length or incorrect apnName", __func__);
mAgpsManager.reportAtlClosed(agpsType); mAgpsManager.reportAtlClosed(agpsType);
} else { } else {
sendMsg( new AgpsMsgAtlOpenSuccess(*this, sendMsg( new AgpsMsgAtlOpenSuccess(
&mAgpsManager, agpsType, apnName, apnLen, bearerType)); &mAgpsManager, agpsType, apnName, apnLen, bearerType));
} }
} }
@ -6787,9 +6731,7 @@ GnssAdapter::reportGnssAntennaInformation(const antennaInfoCb antennaInfoCallbac
} }
gnssAntennaInformations.push_back(std::move(gnssAntennaInfo)); gnssAntennaInformations.push_back(std::move(gnssAntennaInfo));
} }
if (antennaInfoVectorSize > 0) {
antennaInfoCallback(gnssAntennaInformations); antennaInfoCallback(gnssAntennaInformations);
}
} }
/* ==== DGnss Usable Reporter ========================================================= */ /* ==== DGnss Usable Reporter ========================================================= */

View File

@ -321,6 +321,7 @@ protected:
void logLatencyInfo(); void logLatencyInfo();
public: public:
GnssAdapter(); GnssAdapter();
virtual inline ~GnssAdapter() { } virtual inline ~GnssAdapter() { }
@ -408,8 +409,6 @@ public:
void deleteAidingData(const GnssAidingData &data, uint32_t sessionId); void deleteAidingData(const GnssAidingData &data, uint32_t sessionId);
void gnssUpdateXtraThrottleCommand(const bool enabled); void gnssUpdateXtraThrottleCommand(const bool enabled);
std::vector<LocationError> gnssUpdateConfig(const std::string& oldMoServerUrl, std::vector<LocationError> gnssUpdateConfig(const std::string& oldMoServerUrl,
const std::string& moServerUrl,
const std::string& serverUrl,
GnssConfig& gnssConfigRequested, GnssConfig& gnssConfigRequested,
GnssConfig& gnssConfigNeedEngineUpdate, size_t count = 0); GnssConfig& gnssConfigNeedEngineUpdate, size_t count = 0);
@ -526,8 +525,6 @@ public:
( (
const std::unordered_map<LocationQwesFeatureType, bool> &featureMap const std::unordered_map<LocationQwesFeatureType, bool> &featureMap
); );
void reportPdnTypeFromWds(int pdnType, AGpsExtType agpsType, std::string apnName,
AGpsBearerType bearerType);
/* ======== UTILITIES ================================================================= */ /* ======== UTILITIES ================================================================= */
bool needReportForGnssClient(const UlpLocation& ulpLocation, bool needReportForGnssClient(const UlpLocation& ulpLocation,

View File

@ -14,7 +14,7 @@ LOC_BOARD_PLATFORM_LIST += msmnile
LOC_BOARD_PLATFORM_LIST += sdmshrike LOC_BOARD_PLATFORM_LIST += sdmshrike
LOC_BOARD_PLATFORM_LIST += $(MSMSTEPPE) LOC_BOARD_PLATFORM_LIST += $(MSMSTEPPE)
LOC_BOARD_PLATFORM_LIST += $(TRINKET) LOC_BOARD_PLATFORM_LIST += $(TRINKET)
LOC_BOARD_PLATFORM_LIST += lahaina LOC_BOARD_PLATFORM_LIST += kona
LOC_BOARD_PLATFORM_LIST += atoll LOC_BOARD_PLATFORM_LIST += atoll
LOC_BOARD_PLATFORM_LIST += lito LOC_BOARD_PLATFORM_LIST += lito
LOC_BOARD_PLATFORM_LIST += bengal LOC_BOARD_PLATFORM_LIST += bengal
@ -27,10 +27,6 @@ ifneq (,$(filter $(LOC_BOARD_PLATFORM_LIST),$(TARGET_BOARD_PLATFORM)))
PRODUCT_PACKAGES += gps.conf PRODUCT_PACKAGES += gps.conf
PRODUCT_PACKAGES += flp.conf PRODUCT_PACKAGES += flp.conf
PRODUCT_PACKAGES += gnss_antenna_info.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 += libloc_pla_headers
PRODUCT_PACKAGES += liblocation_api_headers PRODUCT_PACKAGES += liblocation_api_headers
PRODUCT_PACKAGES += libgps.utils_headers PRODUCT_PACKAGES += libgps.utils_headers

View File

@ -4,7 +4,7 @@ cc_library_shared {
name: "liblocation_api", name: "liblocation_api",
vendor: true, vendor: true,
sanitize: GNSS_SANITIZE,
shared_libs: [ shared_libs: [
"libutils", "libutils",

View File

@ -4,7 +4,7 @@ cc_library_shared {
name: "libgps.utils", name: "libgps.utils",
vendor: true, vendor: true,
sanitize: GNSS_SANITIZE,
//# Libs //# Libs
shared_libs: [ shared_libs: [