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.ACCURACY_THRES = 0;
|
||||
mGps_conf.NMEA_PROVIDER = 0;
|
||||
mGps_conf.GPS_LOCK = 0;
|
||||
mGps_conf.GPS_LOCK = 0x03;
|
||||
mGps_conf.SUPL_VER = 0x10000;
|
||||
mGps_conf.SUPL_MODE = 0x1;
|
||||
mGps_conf.SUPL_ES = 0;
|
||||
|
|
|
@ -42,8 +42,9 @@ namespace loc_core {
|
|||
// But if getLocApi(targetEnumType target) is overriden,
|
||||
// the right locApi should get created.
|
||||
LocAdapterBase::LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
|
||||
ContextBase* context, LocAdapterProxyBase *adapterProxyBase) :
|
||||
mEvtMask(mask), mContext(context),
|
||||
ContextBase* context, bool isMaster,
|
||||
LocAdapterProxyBase *adapterProxyBase) :
|
||||
mIsMaster(isMaster), mEvtMask(mask), mContext(context),
|
||||
mLocApi(context->getLocApi()), mLocAdapterProxyBase(adapterProxyBase),
|
||||
mMsgTask(context->getMsgTask())
|
||||
{
|
||||
|
|
|
@ -59,6 +59,7 @@ class LocAdapterProxyBase;
|
|||
class LocAdapterBase {
|
||||
private:
|
||||
static uint32_t mSessionIdCounter;
|
||||
const bool mIsMaster;
|
||||
protected:
|
||||
LOC_API_ADAPTER_EVENT_MASK_T mEvtMask;
|
||||
ContextBase* mContext;
|
||||
|
@ -66,12 +67,18 @@ protected:
|
|||
LocAdapterProxyBase* mLocAdapterProxyBase;
|
||||
const MsgTask* mMsgTask;
|
||||
inline LocAdapterBase(const MsgTask* msgTask) :
|
||||
mEvtMask(0), mContext(NULL), mLocApi(NULL),
|
||||
mIsMaster(false), mEvtMask(0), mContext(NULL), mLocApi(NULL),
|
||||
mLocAdapterProxyBase(NULL), mMsgTask(msgTask) {}
|
||||
LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
|
||||
ContextBase* context, bool isMaster,
|
||||
LocAdapterProxyBase *adapterProxyBase = NULL);
|
||||
public:
|
||||
inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); }
|
||||
LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
|
||||
ContextBase* context, LocAdapterProxyBase *adapterProxyBase = NULL);
|
||||
inline LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
|
||||
ContextBase* context,
|
||||
LocAdapterProxyBase *adapterProxyBase = NULL) :
|
||||
LocAdapterBase(mask, context, false, adapterProxyBase) {}
|
||||
|
||||
inline LOC_API_ADAPTER_EVENT_MASK_T
|
||||
checkMask(LOC_API_ADAPTER_EVENT_MASK_T mask) const {
|
||||
return mEvtMask & mask;
|
||||
|
@ -111,6 +118,11 @@ public:
|
|||
}
|
||||
|
||||
uint32_t generateSessionId();
|
||||
|
||||
inline bool isAdapterMaster() {
|
||||
return mIsMaster;
|
||||
}
|
||||
|
||||
virtual void handleEngineUpEvent();
|
||||
virtual void handleEngineDownEvent();
|
||||
inline virtual void setPositionModeCommand(LocPosMode& posMode) {
|
||||
|
|
|
@ -163,6 +163,18 @@ LOC_API_ADAPTER_EVENT_MASK_T LocApiBase::getEvtMask()
|
|||
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 inSession = false;
|
||||
|
@ -578,10 +590,6 @@ void LocApiBase::
|
|||
uint32_t /*slotBitMask*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
int LocApiBase::
|
||||
getGpsLock()
|
||||
DEFAULT_IMPL(-1)
|
||||
|
||||
LocationError LocApiBase::
|
||||
setXtraVersionCheckSync(uint32_t /*check*/)
|
||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||
|
|
|
@ -121,6 +121,7 @@ protected:
|
|||
inline virtual ~LocApiBase() { close(); }
|
||||
bool isInSession();
|
||||
const LOC_API_ADAPTER_EVENT_MASK_T mExcludedMask;
|
||||
bool isMaster();
|
||||
|
||||
public:
|
||||
inline void sendMsg(const LocMsg* msg) const {
|
||||
|
@ -247,12 +248,6 @@ public:
|
|||
void updateEvtMask();
|
||||
|
||||
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);
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@ INTERMEDIATE_POS=0
|
|||
# should be locked when user turns off GPS on Settings
|
||||
# Set bit 0x1 if MO GPS functionalities are to be locked
|
||||
# Set bit 0x2 if NI GPS functionalities are to be locked
|
||||
# default - non is locked for backward compatibility
|
||||
#GPS_LOCK = 0
|
||||
# default – both MO and NI locked for maximal privacy
|
||||
#GPS_LOCK = 3
|
||||
|
||||
# supl version 1.0
|
||||
SUPL_VER=0x10000
|
||||
|
|
|
@ -65,7 +65,7 @@ GnssAdapter::GnssAdapter() :
|
|||
LocDualContext::getLocFgContext(NULL,
|
||||
NULL,
|
||||
LocDualContext::mLocationHalName,
|
||||
false)),
|
||||
false), true, nullptr),
|
||||
mEngHubProxy(new EngineHubProxyBase()),
|
||||
mLocPositionMode(),
|
||||
mGnssSvIdUsedInPosition(),
|
||||
|
@ -755,6 +755,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
|||
index++;
|
||||
uint32_t newGpsLock = mAdapter.convertGpsLock(gnssConfigRequested.gpsLock);
|
||||
ContextBase::mGps_conf.GPS_LOCK = newGpsLock;
|
||||
if (0 == ContextBase::mGps_conf.GPS_LOCK) {
|
||||
ContextBase::mGps_conf.GPS_LOCK = 3;
|
||||
}
|
||||
if (0 != mAdapter.getPowerVoteId()) {
|
||||
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_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) {
|
||||
|
|
Loading…
Reference in a new issue