AGPS config inject can be configured out

a parameter can be added to gps.conf so as to prevent carrier
dependent AGPS configs to be injected to modem. This is mainly
for test purposes.

Change-Id: Ia053bf523329fe7c1abf0696b9bffcc6a7d56a53
CRs-Fixed: 998059
This commit is contained in:
Kevin Tang 2016-04-08 19:56:27 -07:00
parent 17e8653d96
commit 54794a45e6
3 changed files with 35 additions and 5 deletions

View file

@ -59,6 +59,7 @@ typedef struct loc_gps_cfg_s
uint32_t GPS_LOCK; uint32_t GPS_LOCK;
uint32_t A_GLONASS_POS_PROTOCOL_SELECT; uint32_t A_GLONASS_POS_PROTOCOL_SELECT;
uint32_t AGPS_CERT_WRITABLE_MASK; uint32_t AGPS_CERT_WRITABLE_MASK;
uint32_t AGPS_CONFIG_INJECT;
uint32_t LPPE_CP_TECHNOLOGY; uint32_t LPPE_CP_TECHNOLOGY;
uint32_t LPPE_UP_TECHNOLOGY; uint32_t LPPE_UP_TECHNOLOGY;
} loc_gps_cfg_s_type; } loc_gps_cfg_s_type;

View file

@ -123,3 +123,18 @@ LPPE_CP_TECHNOLOGY = 0
# 0x1: DBH for LPPe UP # 0x1: DBH for LPPe UP
# 0x2: WLAN AP Measurements for LPPe UP # 0x2: WLAN AP Measurements for LPPe UP
LPPE_UP_TECHNOLOGY = 0 LPPE_UP_TECHNOLOGY = 0
##################################################
# AGPS_CONFIG_INJECT
##################################################
# enable/disable injection of AGPS configurations:
# SUPL_VER
# SUPL_HOST
# SUPL_PORT
# C2K_HOST
# C2K_PORT
# LPP_PROFILE
# A_GLONASS_POS_PROTOCOL_SELECT
# 0: disable
# 1: enable
AGPS_CONFIG_INJECT = 1

View file

@ -100,6 +100,7 @@ static const loc_param_s_type gps_conf_table[] =
{"XTRA_SERVER_2", &gps_conf.XTRA_SERVER_2, NULL, 's'}, {"XTRA_SERVER_2", &gps_conf.XTRA_SERVER_2, NULL, 's'},
{"XTRA_SERVER_3", &gps_conf.XTRA_SERVER_3, NULL, 's'}, {"XTRA_SERVER_3", &gps_conf.XTRA_SERVER_3, NULL, 's'},
{"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL", &gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'}, {"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL", &gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'},
{"AGPS_CONFIG_INJECT", &gps_conf.AGPS_CONFIG_INJECT, NULL, 'n'},
}; };
static const loc_param_s_type sap_conf_table[] = static const loc_param_s_type sap_conf_table[] =
@ -176,6 +177,9 @@ static void loc_default_parameters(void)
/* None of the 10 slots for agps certificates are writable by default */ /* None of the 10 slots for agps certificates are writable by default */
gps_conf.AGPS_CERT_WRITABLE_MASK = 0; gps_conf.AGPS_CERT_WRITABLE_MASK = 0;
/* inject supl config to modem with config values from config.xml or gps.conf, default 1 */
gps_conf.AGPS_CONFIG_INJECT = 1;
} }
// 2nd half of init(), singled out for // 2nd half of init(), singled out for
@ -403,7 +407,9 @@ struct LocEngSetServerIpv4 : public LocMsg {
locallog(); locallog();
} }
inline virtual void proc() const { inline virtual void proc() const {
mAdapter->setServer(mNlAddr, mPort, mServerType); if (gps_conf.AGPS_CONFIG_INJECT) {
mAdapter->setServer(mNlAddr, mPort, mServerType);
}
} }
inline void locallog() const { inline void locallog() const {
LOC_LOGV("LocEngSetServerIpv4 - addr: %x, port: %d, type: %s", LOC_LOGV("LocEngSetServerIpv4 - addr: %x, port: %d, type: %s",
@ -434,7 +440,9 @@ struct LocEngSetServerUrl : public LocMsg {
delete[] mUrl; delete[] mUrl;
} }
inline virtual void proc() const { inline virtual void proc() const {
mAdapter->setServer(mUrl, mLen); if (gps_conf.AGPS_CONFIG_INJECT) {
mAdapter->setServer(mUrl, mLen);
}
} }
inline void locallog() const { inline void locallog() const {
LOC_LOGV("LocEngSetServerUrl - url: %s", mUrl); LOC_LOGV("LocEngSetServerUrl - url: %s", mUrl);
@ -455,7 +463,9 @@ struct LocEngAGlonassProtocol : public LocMsg {
locallog(); locallog();
} }
inline virtual void proc() const { inline virtual void proc() const {
mAdapter->setAGLONASSProtocol(mAGlonassProtocl); if (gps_conf.AGPS_CONFIG_INJECT) {
mAdapter->setAGLONASSProtocol(mAGlonassProtocl);
}
} }
inline void locallog() const { inline void locallog() const {
LOC_LOGV("A-GLONASS protocol: 0x%lx", mAGlonassProtocl); LOC_LOGV("A-GLONASS protocol: 0x%lx", mAGlonassProtocl);
@ -499,7 +509,9 @@ struct LocEngSuplVer : public LocMsg {
locallog(); locallog();
} }
inline virtual void proc() const { inline virtual void proc() const {
mAdapter->setSUPLVersion(mSuplVer); if (gps_conf.AGPS_CONFIG_INJECT) {
mAdapter->setSUPLVersion(mSuplVer);
}
} }
inline void locallog() const { inline void locallog() const {
LOC_LOGV("SUPL Version: %d", mSuplVer); LOC_LOGV("SUPL Version: %d", mSuplVer);
@ -563,7 +575,9 @@ struct LocEngLppConfig : public LocMsg {
locallog(); locallog();
} }
inline virtual void proc() const { inline virtual void proc() const {
mAdapter->setLPPConfig(mLppConfig); if (gps_conf.AGPS_CONFIG_INJECT) {
mAdapter->setLPPConfig(mLppConfig);
}
} }
inline void locallog() const { inline void locallog() const {
LOC_LOGV("LocEngLppConfig - profile: %d", mLppConfig); LOC_LOGV("LocEngLppConfig - profile: %d", mLppConfig);