sm7325-common: gps: update to LA.UM.9.12.r1-13500.01-SMxx50.QSSI12.0
This commit is contained in:
parent
616168edec
commit
81c175bd93
28 changed files with 70 additions and 201 deletions
|
|
@ -448,7 +448,7 @@ void AgpsStateMachine::setAPN(char* apn, unsigned int len){
|
|||
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);
|
||||
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, true, false, apnTypeMask);
|
||||
AgpsSubscriber subscriber(connHandle, false, false, apnTypeMask);
|
||||
sm->setCurrentSubscriber(&subscriber);
|
||||
/* Send subscriber event */
|
||||
sm->processAgpsEvent(AGPS_EVENT_SUBSCRIBE);
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ public:
|
|||
|
||||
/* Getter/Setter methods */
|
||||
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 void setBearer(AGpsBearerType bearer) { mBearer = bearer; }
|
||||
inline LocApnTypeMask getApnTypeMask() const { return mApnTypeMask; }
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ cc_library_shared {
|
|||
name: "libgnss",
|
||||
vendor: true,
|
||||
|
||||
|
||||
sanitize: GNSS_SANITIZE,
|
||||
|
||||
shared_libs: [
|
||||
"libutils",
|
||||
|
|
|
|||
|
|
@ -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
|
||||
* 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 void getPdnTypeFromWds(const std::string& apnName, std::function<void(int)> pdnCb);
|
||||
|
||||
inline bool GnssReportLoggerUtil::isLogEnabled() {
|
||||
return (mLogLatency != nullptr);
|
||||
}
|
||||
|
|
@ -891,8 +889,6 @@ 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;
|
||||
|
|
@ -940,10 +936,8 @@ GnssAdapter::setConfig()
|
|||
gnssConfigRequested.blacklistedSvIds.assign(mBlacklistedSvIds.begin(),
|
||||
mBlacklistedSvIds.end());
|
||||
mLocApi->sendMsg(new LocApiMsg(
|
||||
[this, gpsConf, sapConf, oldMoServerUrl, moServerUrl,
|
||||
serverUrl, gnssConfigRequested] () mutable {
|
||||
gnssUpdateConfig(oldMoServerUrl, moServerUrl, serverUrl,
|
||||
gnssConfigRequested, gnssConfigRequested);
|
||||
[this, gpsConf, sapConf, oldMoServerUrl, gnssConfigRequested] () mutable {
|
||||
gnssUpdateConfig(oldMoServerUrl, gnssConfigRequested, gnssConfigRequested);
|
||||
|
||||
// set nmea mask type
|
||||
uint32_t mask = 0;
|
||||
|
|
@ -1031,7 +1025,6 @@ 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;
|
||||
|
|
@ -1041,6 +1034,9 @@ 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();
|
||||
|
||||
|
|
@ -1428,14 +1424,10 @@ 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,
|
||||
moServerUrl, serverUrl, countOfConfigs, configCollectiveResponse,
|
||||
errs] () mutable {
|
||||
countOfConfigs, configCollectiveResponse, errs] () mutable {
|
||||
std::vector<LocationError> errsList = adapter.gnssUpdateConfig("",
|
||||
moServerUrl, serverUrl,
|
||||
gnssConfigRequested, gnssConfigNeedEngineUpdate, countOfConfigs);
|
||||
|
||||
configCollectiveResponse->returnToSender(errsList);
|
||||
|
|
@ -5222,38 +5214,6 @@ 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){
|
||||
|
|
@ -5261,16 +5221,17 @@ 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(GnssAdapter& adapter, AgpsManager* agpsManager,
|
||||
AGpsExtType agpsType, const char* apnName, int apnLen, AGpsBearerType bearerType) :
|
||||
inline AgpsMsgAtlOpenSuccess(AgpsManager* agpsManager, AGpsExtType agpsType,
|
||||
const char* apnName, int apnLen, AGpsBearerType bearerType) :
|
||||
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");
|
||||
if (mApnName == nullptr) {
|
||||
|
|
@ -5288,36 +5249,19 @@ void GnssAdapter::dataConnOpenCommand(
|
|||
}
|
||||
|
||||
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,
|
||||
&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);
|
||||
}
|
||||
LOC_LOGV("AgpsMsgAtlOpenSuccess::proc()");
|
||||
mAgpsManager->reportAtlOpenSuccess(mAgpsType, mApnName, mApnLen, mBearerType);
|
||||
}
|
||||
};
|
||||
// Added inital length checks for apnlen check to avoid security issues
|
||||
// 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__);
|
||||
mAgpsManager.reportAtlClosed(agpsType);
|
||||
} else {
|
||||
sendMsg( new AgpsMsgAtlOpenSuccess(*this,
|
||||
sendMsg( new AgpsMsgAtlOpenSuccess(
|
||||
&mAgpsManager, agpsType, apnName, apnLen, bearerType));
|
||||
}
|
||||
}
|
||||
|
|
@ -6787,9 +6731,7 @@ GnssAdapter::reportGnssAntennaInformation(const antennaInfoCb antennaInfoCallbac
|
|||
}
|
||||
gnssAntennaInformations.push_back(std::move(gnssAntennaInfo));
|
||||
}
|
||||
if (antennaInfoVectorSize > 0) {
|
||||
antennaInfoCallback(gnssAntennaInformations);
|
||||
}
|
||||
antennaInfoCallback(gnssAntennaInformations);
|
||||
}
|
||||
|
||||
/* ==== DGnss Usable Reporter ========================================================= */
|
||||
|
|
|
|||
|
|
@ -321,6 +321,7 @@ protected:
|
|||
void logLatencyInfo();
|
||||
|
||||
public:
|
||||
|
||||
GnssAdapter();
|
||||
virtual inline ~GnssAdapter() { }
|
||||
|
||||
|
|
@ -408,8 +409,6 @@ 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);
|
||||
|
||||
|
|
@ -526,8 +525,6 @@ 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,
|
||||
|
|
|
|||
|
|
@ -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){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue