SUPL_MODE needs to be factored in for ULP
GpsLocationProvider gets SUPL_MODE, and passes is to GPS HAL along with other configs upon sim hot swap. GPS HAL needs to parse it out and factor in that information in for ULP so that ULP can make correct decision w.r.t. position mode when gnss positioning is needed. Change-Id: I1a14dd9d9e47b5d7ea072ae08ee99bbb7c69dbe0 CRs-Fixed: 749794
This commit is contained in:
parent
3a6d7924d6
commit
1ca544cfb5
5 changed files with 55 additions and 10 deletions
|
@ -62,6 +62,7 @@ extern "C" {
|
|||
#define ULP_LOCATION_IS_FROM_GEOFENCE 0X0008
|
||||
/** Positioin is from Hardware FLP */
|
||||
#define ULP_LOCATION_IS_FROM_HW_FLP 0x0010
|
||||
#define ULP_LOCATION_IS_FROM_NLP 0x0020
|
||||
|
||||
#define ULP_MIN_INTERVAL_INVALID 0xffffffff
|
||||
|
||||
|
|
|
@ -54,8 +54,8 @@ USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1
|
|||
#SUPL_MODE is a bit mask set in config.xml per carrier by default.
|
||||
#If it is uncommented here, this value will over write the value from
|
||||
#config.xml.
|
||||
#MSA=0X1
|
||||
#MSB=0X2
|
||||
#MSA=0X2
|
||||
#MSB=0X1
|
||||
#SUPL_MODE=
|
||||
|
||||
# GPS Capabilities bit mask
|
||||
|
|
|
@ -335,7 +335,7 @@ static int loc_init(GpsCallbacks* callbacks)
|
|||
loc_afw_data.adapter->mSupportsPositionInjection = !loc_afw_data.adapter->hasCPIExtendedCapabilities();
|
||||
loc_afw_data.adapter->mSupportsTimeInjection = !loc_afw_data.adapter->hasCPIExtendedCapabilities();
|
||||
loc_afw_data.adapter->setGpsLockMsg(0);
|
||||
loc_afw_data.adapter->requestUlp(gps_conf.CAPABILITIES);
|
||||
loc_afw_data.adapter->requestUlp(getCarrierCapabilities());
|
||||
|
||||
if(retVal) {
|
||||
LOC_LOGE("loc_eng_init() fail!");
|
||||
|
|
|
@ -101,6 +101,7 @@ static loc_param_s_type gps_conf_table[] =
|
|||
{"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'},
|
||||
{"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'},
|
||||
{"AGPS_CERT_WRITABLE_MASK", &gps_conf.AGPS_CERT_WRITABLE_MASK, NULL, 'n'},
|
||||
{"SUPL_MODE", &gps_conf.SUPL_MODE, NULL, 'n'},
|
||||
{"INTERMEDIATE_POS", &gps_conf.INTERMEDIATE_POS, NULL, 'n'},
|
||||
{"ACCURACY_THRES", &gps_conf.ACCURACY_THRES, NULL, 'n'},
|
||||
{"NMEA_PROVIDER", &gps_conf.NMEA_PROVIDER, NULL, 'n'},
|
||||
|
@ -142,6 +143,7 @@ static void loc_default_parameters(void)
|
|||
gps_conf.NMEA_PROVIDER = 0;
|
||||
gps_conf.GPS_LOCK = 0;
|
||||
gps_conf.SUPL_VER = 0x10000;
|
||||
gps_conf.SUPL_MODE = 0x3;
|
||||
gps_conf.CAPABILITIES = 0x7;
|
||||
/* LTE Positioning Profile configuration is disable by default*/
|
||||
gps_conf.LPP_PROFILE = 0;
|
||||
|
@ -514,6 +516,24 @@ struct LocEngSuplVer : public LocMsg {
|
|||
}
|
||||
};
|
||||
|
||||
struct LocEngSuplMode : public LocMsg {
|
||||
UlpProxyBase* mUlp;
|
||||
|
||||
inline LocEngSuplMode(UlpProxyBase* ulp) :
|
||||
LocMsg(), mUlp(ulp)
|
||||
{
|
||||
locallog();
|
||||
}
|
||||
inline virtual void proc() const {
|
||||
mUlp->setCapabilities(getCarrierCapabilities());
|
||||
}
|
||||
inline void locallog() const {
|
||||
}
|
||||
inline virtual void log() const {
|
||||
locallog();
|
||||
}
|
||||
};
|
||||
|
||||
// case LOC_ENG_MSG_LPP_CONFIG:
|
||||
struct LocEngLppConfig : public LocMsg {
|
||||
LocEngAdapter* mAdapter;
|
||||
|
@ -1586,6 +1606,24 @@ struct LocEngInstallAGpsCert : public LocMsg {
|
|||
}
|
||||
#define INIT_CHECK(ctx, ret) STATE_CHECK(ctx, "instance not initialized", ret)
|
||||
|
||||
uint32_t getCarrierCapabilities() {
|
||||
#define carrierMSA (uint32_t)0x2
|
||||
#define carrierMSB (uint32_t)0x1
|
||||
#define gpsConfMSA (uint32_t)0x4
|
||||
#define gpsConfMSB (uint32_t)0x2
|
||||
uint32_t capabilities = gps_conf.CAPABILITIES;
|
||||
if ((gps_conf.SUPL_MODE & carrierMSA) != carrierMSA) {
|
||||
capabilities &= ~gpsConfMSA;
|
||||
}
|
||||
if ((gps_conf.SUPL_MODE & carrierMSB) != carrierMSB) {
|
||||
capabilities &= ~gpsConfMSB;
|
||||
}
|
||||
|
||||
LOC_LOGV("getCarrierCapabilities: CAPABILITIES %x, SUPL_MODE %x, carrier capabilities %x",
|
||||
gps_conf.CAPABILITIES, gps_conf.SUPL_MODE, capabilities);
|
||||
return capabilities;
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
FUNCTION loc_eng_init
|
||||
|
||||
|
@ -2626,15 +2664,17 @@ void loc_eng_configuration_update (loc_eng_data_s_type &loc_eng_data,
|
|||
adapter->sendMsg(new LocEngAGlonassProtocol(adapter,
|
||||
gps_conf.A_GLONASS_POS_PROTOCOL_SELECT));
|
||||
}
|
||||
if (NULL != loc_eng_data.set_capabilities_cb) {
|
||||
gps_conf.CAPABILITIES &= gps_conf_old.CAPABILITIES;
|
||||
if (gps_conf.CAPABILITIES != gps_conf_old.CAPABILITIES) {
|
||||
loc_eng_data.set_capabilities_cb(gps_conf.CAPABILITIES);
|
||||
}
|
||||
if (gps_conf_old.SUPL_MODE != gps_conf.SUPL_MODE) {
|
||||
adapter->sendMsg(new LocEngSuplMode(adapter->getUlpProxy()));
|
||||
}
|
||||
}
|
||||
|
||||
gps_conf.CAPABILITIES = gps_conf_old.CAPABILITIES;
|
||||
gps_conf_old.SUPL_VER = gps_conf.SUPL_VER;
|
||||
gps_conf_old.LPP_PROFILE = gps_conf.LPP_PROFILE;
|
||||
gps_conf_old.A_GLONASS_POS_PROTOCOL_SELECT = gps_conf.A_GLONASS_POS_PROTOCOL_SELECT;
|
||||
gps_conf_old.SUPL_MODE = gps_conf.SUPL_MODE;
|
||||
gps_conf = gps_conf_old;
|
||||
|
||||
}
|
||||
|
||||
EXIT_LOG(%s, VOID_RET);
|
||||
|
|
|
@ -148,6 +148,7 @@ typedef struct loc_gps_cfg_s
|
|||
uint32_t INTERMEDIATE_POS;
|
||||
uint32_t ACCURACY_THRES;
|
||||
uint32_t SUPL_VER;
|
||||
uint32_t SUPL_MODE;
|
||||
uint32_t CAPABILITIES;
|
||||
uint32_t LPP_PROFILE;
|
||||
uint32_t XTRA_VERSION_CHECK;
|
||||
|
@ -156,7 +157,7 @@ typedef struct loc_gps_cfg_s
|
|||
char XTRA_SERVER_3[MAX_XTRA_SERVER_URL_LENGTH];
|
||||
uint32_t USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL;
|
||||
uint32_t NMEA_PROVIDER;
|
||||
uint8_t GPS_LOCK;
|
||||
uint32_t GPS_LOCK;
|
||||
uint32_t A_GLONASS_POS_PROTOCOL_SELECT;
|
||||
uint32_t AGPS_CERT_WRITABLE_MASK;
|
||||
} loc_gps_cfg_s_type;
|
||||
|
@ -197,6 +198,9 @@ typedef struct
|
|||
extern loc_gps_cfg_s_type gps_conf;
|
||||
extern loc_sap_cfg_s_type sap_conf;
|
||||
|
||||
|
||||
uint32_t getCarrierCapabilities();
|
||||
|
||||
//loc_eng functions
|
||||
int loc_eng_init(loc_eng_data_s_type &loc_eng_data,
|
||||
LocCallbacks* callbacks,
|
||||
|
|
Loading…
Reference in a new issue