Handle updating the carrier configuration
Set GPS_LOCK for cases where the modem has two SIMs Change-Id: I2745b9469b2f755b0a24be2a7f4ae514c35a37cb CRs-fixed: 2018029
This commit is contained in:
parent
f7981a3c11
commit
b150a53ee3
7 changed files with 39 additions and 20 deletions
|
@ -104,7 +104,7 @@ void ContextBase::readConfig()
|
||||||
mGps_conf.INTERMEDIATE_POS = 0;
|
mGps_conf.INTERMEDIATE_POS = 0;
|
||||||
mGps_conf.ACCURACY_THRES = 0;
|
mGps_conf.ACCURACY_THRES = 0;
|
||||||
mGps_conf.NMEA_PROVIDER = 0;
|
mGps_conf.NMEA_PROVIDER = 0;
|
||||||
mGps_conf.GPS_LOCK = 0;
|
mGps_conf.GPS_LOCK = 0x03;
|
||||||
mGps_conf.SUPL_VER = 0x10000;
|
mGps_conf.SUPL_VER = 0x10000;
|
||||||
mGps_conf.SUPL_MODE = 0x1;
|
mGps_conf.SUPL_MODE = 0x1;
|
||||||
mGps_conf.SUPL_ES = 0;
|
mGps_conf.SUPL_ES = 0;
|
||||||
|
|
|
@ -42,8 +42,9 @@ namespace loc_core {
|
||||||
// But if getLocApi(targetEnumType target) is overriden,
|
// But if getLocApi(targetEnumType target) is overriden,
|
||||||
// the right locApi should get created.
|
// the right locApi should get created.
|
||||||
LocAdapterBase::LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
|
LocAdapterBase::LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
|
||||||
ContextBase* context, LocAdapterProxyBase *adapterProxyBase) :
|
ContextBase* context, bool isMaster,
|
||||||
mEvtMask(mask), mContext(context),
|
LocAdapterProxyBase *adapterProxyBase) :
|
||||||
|
mIsMaster(isMaster), mEvtMask(mask), mContext(context),
|
||||||
mLocApi(context->getLocApi()), mLocAdapterProxyBase(adapterProxyBase),
|
mLocApi(context->getLocApi()), mLocAdapterProxyBase(adapterProxyBase),
|
||||||
mMsgTask(context->getMsgTask())
|
mMsgTask(context->getMsgTask())
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,6 +59,7 @@ class LocAdapterProxyBase;
|
||||||
class LocAdapterBase {
|
class LocAdapterBase {
|
||||||
private:
|
private:
|
||||||
static uint32_t mSessionIdCounter;
|
static uint32_t mSessionIdCounter;
|
||||||
|
const bool mIsMaster;
|
||||||
protected:
|
protected:
|
||||||
LOC_API_ADAPTER_EVENT_MASK_T mEvtMask;
|
LOC_API_ADAPTER_EVENT_MASK_T mEvtMask;
|
||||||
ContextBase* mContext;
|
ContextBase* mContext;
|
||||||
|
@ -66,12 +67,18 @@ protected:
|
||||||
LocAdapterProxyBase* mLocAdapterProxyBase;
|
LocAdapterProxyBase* mLocAdapterProxyBase;
|
||||||
const MsgTask* mMsgTask;
|
const MsgTask* mMsgTask;
|
||||||
inline LocAdapterBase(const MsgTask* msgTask) :
|
inline LocAdapterBase(const MsgTask* msgTask) :
|
||||||
mEvtMask(0), mContext(NULL), mLocApi(NULL),
|
mIsMaster(false), mEvtMask(0), mContext(NULL), mLocApi(NULL),
|
||||||
mLocAdapterProxyBase(NULL), mMsgTask(msgTask) {}
|
mLocAdapterProxyBase(NULL), mMsgTask(msgTask) {}
|
||||||
|
LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
|
||||||
|
ContextBase* context, bool isMaster,
|
||||||
|
LocAdapterProxyBase *adapterProxyBase = NULL);
|
||||||
public:
|
public:
|
||||||
inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); }
|
inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); }
|
||||||
LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
|
inline LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
|
||||||
ContextBase* context, LocAdapterProxyBase *adapterProxyBase = NULL);
|
ContextBase* context,
|
||||||
|
LocAdapterProxyBase *adapterProxyBase = NULL) :
|
||||||
|
LocAdapterBase(mask, context, false, adapterProxyBase) {}
|
||||||
|
|
||||||
inline LOC_API_ADAPTER_EVENT_MASK_T
|
inline LOC_API_ADAPTER_EVENT_MASK_T
|
||||||
checkMask(LOC_API_ADAPTER_EVENT_MASK_T mask) const {
|
checkMask(LOC_API_ADAPTER_EVENT_MASK_T mask) const {
|
||||||
return mEvtMask & mask;
|
return mEvtMask & mask;
|
||||||
|
@ -111,6 +118,11 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t generateSessionId();
|
uint32_t generateSessionId();
|
||||||
|
|
||||||
|
inline bool isAdapterMaster() {
|
||||||
|
return mIsMaster;
|
||||||
|
}
|
||||||
|
|
||||||
virtual void handleEngineUpEvent();
|
virtual void handleEngineUpEvent();
|
||||||
virtual void handleEngineDownEvent();
|
virtual void handleEngineDownEvent();
|
||||||
inline virtual void setPositionModeCommand(LocPosMode& posMode) {
|
inline virtual void setPositionModeCommand(LocPosMode& posMode) {
|
||||||
|
|
|
@ -163,6 +163,18 @@ LOC_API_ADAPTER_EVENT_MASK_T LocApiBase::getEvtMask()
|
||||||
return mask & ~mExcludedMask;
|
return mask & ~mExcludedMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool LocApiBase::isMaster()
|
||||||
|
{
|
||||||
|
bool isMaster = false;
|
||||||
|
|
||||||
|
for (int i = 0;
|
||||||
|
!isMaster && i < MAX_ADAPTERS && NULL != mLocAdapters[i];
|
||||||
|
i++) {
|
||||||
|
isMaster |= mLocAdapters[i]->isAdapterMaster();
|
||||||
|
}
|
||||||
|
return isMaster;
|
||||||
|
}
|
||||||
|
|
||||||
bool LocApiBase::isInSession()
|
bool LocApiBase::isInSession()
|
||||||
{
|
{
|
||||||
bool inSession = false;
|
bool inSession = false;
|
||||||
|
@ -578,10 +590,6 @@ void LocApiBase::
|
||||||
uint32_t /*slotBitMask*/)
|
uint32_t /*slotBitMask*/)
|
||||||
DEFAULT_IMPL()
|
DEFAULT_IMPL()
|
||||||
|
|
||||||
int LocApiBase::
|
|
||||||
getGpsLock()
|
|
||||||
DEFAULT_IMPL(-1)
|
|
||||||
|
|
||||||
LocationError LocApiBase::
|
LocationError LocApiBase::
|
||||||
setXtraVersionCheckSync(uint32_t /*check*/)
|
setXtraVersionCheckSync(uint32_t /*check*/)
|
||||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||||
|
|
|
@ -121,6 +121,7 @@ protected:
|
||||||
inline virtual ~LocApiBase() { close(); }
|
inline virtual ~LocApiBase() { close(); }
|
||||||
bool isInSession();
|
bool isInSession();
|
||||||
const LOC_API_ADAPTER_EVENT_MASK_T mExcludedMask;
|
const LOC_API_ADAPTER_EVENT_MASK_T mExcludedMask;
|
||||||
|
bool isMaster();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
inline void sendMsg(const LocMsg* msg) const {
|
inline void sendMsg(const LocMsg* msg) const {
|
||||||
|
@ -247,12 +248,6 @@ public:
|
||||||
void updateEvtMask();
|
void updateEvtMask();
|
||||||
|
|
||||||
virtual LocationError setGpsLockSync(GnssConfigGpsLock lock);
|
virtual LocationError setGpsLockSync(GnssConfigGpsLock lock);
|
||||||
/*
|
|
||||||
Returns
|
|
||||||
Current value of GPS Lock on success
|
|
||||||
-1 on failure
|
|
||||||
*/
|
|
||||||
virtual int getGpsLock(void);
|
|
||||||
|
|
||||||
virtual LocationError setXtraVersionCheckSync(uint32_t check);
|
virtual LocationError setXtraVersionCheckSync(uint32_t check);
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,8 @@ INTERMEDIATE_POS=0
|
||||||
# should be locked when user turns off GPS on Settings
|
# should be locked when user turns off GPS on Settings
|
||||||
# Set bit 0x1 if MO GPS functionalities are to be locked
|
# Set bit 0x1 if MO GPS functionalities are to be locked
|
||||||
# Set bit 0x2 if NI GPS functionalities are to be locked
|
# Set bit 0x2 if NI GPS functionalities are to be locked
|
||||||
# default - non is locked for backward compatibility
|
# default – both MO and NI locked for maximal privacy
|
||||||
#GPS_LOCK = 0
|
#GPS_LOCK = 3
|
||||||
|
|
||||||
# supl version 1.0
|
# supl version 1.0
|
||||||
SUPL_VER=0x10000
|
SUPL_VER=0x10000
|
||||||
|
|
|
@ -65,7 +65,7 @@ GnssAdapter::GnssAdapter() :
|
||||||
LocDualContext::getLocFgContext(NULL,
|
LocDualContext::getLocFgContext(NULL,
|
||||||
NULL,
|
NULL,
|
||||||
LocDualContext::mLocationHalName,
|
LocDualContext::mLocationHalName,
|
||||||
false)),
|
false), true, nullptr),
|
||||||
mEngHubProxy(new EngineHubProxyBase()),
|
mEngHubProxy(new EngineHubProxyBase()),
|
||||||
mLocPositionMode(),
|
mLocPositionMode(),
|
||||||
mGnssSvIdUsedInPosition(),
|
mGnssSvIdUsedInPosition(),
|
||||||
|
@ -755,6 +755,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
||||||
index++;
|
index++;
|
||||||
uint32_t newGpsLock = mAdapter.convertGpsLock(gnssConfigRequested.gpsLock);
|
uint32_t newGpsLock = mAdapter.convertGpsLock(gnssConfigRequested.gpsLock);
|
||||||
ContextBase::mGps_conf.GPS_LOCK = newGpsLock;
|
ContextBase::mGps_conf.GPS_LOCK = newGpsLock;
|
||||||
|
if (0 == ContextBase::mGps_conf.GPS_LOCK) {
|
||||||
|
ContextBase::mGps_conf.GPS_LOCK = 3;
|
||||||
|
}
|
||||||
if (0 != mAdapter.getPowerVoteId()) {
|
if (0 != mAdapter.getPowerVoteId()) {
|
||||||
gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT);
|
gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT);
|
||||||
}
|
}
|
||||||
|
@ -1744,7 +1747,7 @@ GnssAdapter::updateClientsEventMask()
|
||||||
mask |= LOC_API_ADAPTER_BIT_GNSS_SV_POLYNOMIAL_REPORT;
|
mask |= LOC_API_ADAPTER_BIT_GNSS_SV_POLYNOMIAL_REPORT;
|
||||||
mask |= LOC_API_ADAPTER_BIT_PARSED_UNPROPAGATED_POSITION_REPORT;
|
mask |= LOC_API_ADAPTER_BIT_PARSED_UNPROPAGATED_POSITION_REPORT;
|
||||||
|
|
||||||
LOC_LOGD("%s]: Auto usecase, Enable MEAS/POLY - mask 0x%" PRIu64 "", __func__, mask);
|
LOC_LOGD("%s]: Auto usecase, Enable MEAS/POLY - mask 0x%" PRIx64 "", __func__, mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mAgpsCbInfo.statusV4Cb != NULL) {
|
if (mAgpsCbInfo.statusV4Cb != NULL) {
|
||||||
|
|
Loading…
Reference in a new issue