Changes to conditionally check and inject coarse position
Changes to GPS HAL to determine if wiper available before it does CPI injection. Change-Id: Ic481c020bf51ae55b001ab28a0b1caaa5de47cdd
This commit is contained in:
parent
3e5e65938d
commit
b5ed3d8505
6 changed files with 13 additions and 4 deletions
|
@ -57,6 +57,7 @@ public:
|
|||
inline LocApiBase* getLocApi() { return mLocApi; }
|
||||
inline LocApiProxyBase* getLocApiProxy() { return mLocApiProxy; }
|
||||
inline bool hasAgpsExt() { return mLBSProxy->hasAgpsExt(); }
|
||||
inline bool hasCPIExt() { return mLBSProxy->hasCPIExt(); }
|
||||
inline void requestUlp(LocAdapterBase* adapter,
|
||||
unsigned long capabilities) {
|
||||
mLBSProxy->requestUlp(adapter, capabilities);
|
||||
|
|
|
@ -50,6 +50,7 @@ public:
|
|||
inline virtual void requestUlp(LocAdapterBase* adapter,
|
||||
unsigned long capabilities) const {}
|
||||
inline virtual bool hasAgpsExt() const { return false; }
|
||||
inline virtual bool hasCPIExt() const { return false; }
|
||||
};
|
||||
|
||||
typedef LBSProxyBase* (getLBSProxy_t)();
|
||||
|
|
|
@ -78,7 +78,7 @@ LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask,
|
|||
:context),
|
||||
mOwner(owner), mInternalAdapter(new LocInternalAdapter(this)),
|
||||
mUlp(new UlpProxyBase()), mNavigating(false),
|
||||
mAgpsEnabled(false)
|
||||
mAgpsEnabled(false), mCPIEnabled(false)
|
||||
{
|
||||
memset(&mFixCriteria, 0, sizeof(mFixCriteria));
|
||||
mFixCriteria.mode = LOC_POSITION_MODE_INVALID;
|
||||
|
@ -291,3 +291,4 @@ void LocEngAdapter::handleEngineUpEvent()
|
|||
{
|
||||
sendMsg(new LocEngUp(mOwner));
|
||||
}
|
||||
|
||||
|
|
|
@ -76,6 +76,7 @@ class LocEngAdapter : public LocAdapterBase {
|
|||
|
||||
public:
|
||||
bool mAgpsEnabled;
|
||||
bool mCPIEnabled;
|
||||
|
||||
LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask,
|
||||
void* owner,ContextBase* context,
|
||||
|
@ -90,6 +91,7 @@ public:
|
|||
inline UlpProxyBase* getUlpProxy() { return mUlp; }
|
||||
inline void* getOwner() { return mOwner; }
|
||||
inline bool hasAgpsExt() { return mContext->hasAgpsExt(); }
|
||||
inline bool hasCPIExt() { return mContext->hasCPIExt(); }
|
||||
inline const MsgTask* getMsgTask() { return mMsgTask; }
|
||||
|
||||
inline enum loc_api_adapter_err
|
||||
|
|
|
@ -277,7 +277,7 @@ static int loc_init(GpsCallbacks* callbacks)
|
|||
retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, NULL);
|
||||
loc_afw_data.adapter->requestUlp(gps_conf.CAPABILITIES);
|
||||
loc_afw_data.adapter->mAgpsEnabled = !loc_afw_data.adapter->hasAgpsExt();
|
||||
|
||||
loc_afw_data.adapter->mCPIEnabled = !loc_afw_data.adapter->hasCPIExt();
|
||||
|
||||
EXIT_LOG(%d, retVal);
|
||||
return retVal;
|
||||
|
@ -463,6 +463,7 @@ static int loc_inject_location(double latitude, double longitude, float accuracy
|
|||
{
|
||||
static bool initialized = false;
|
||||
static bool enable_cpi = true;
|
||||
accuracy = 1000;
|
||||
ENTRY_LOG();
|
||||
|
||||
if(!initialized)
|
||||
|
|
|
@ -1845,8 +1845,11 @@ int loc_eng_inject_location(loc_eng_data_s_type &loc_eng_data, double latitude,
|
|||
ENTRY_LOG_CALLFLOW();
|
||||
INIT_CHECK(loc_eng_data.adapter, return -1);
|
||||
LocEngAdapter* adapter = loc_eng_data.adapter;
|
||||
adapter->sendMsg(new LocEngInjectLocation(adapter, latitude, longitude,
|
||||
accuracy));
|
||||
if(!adapter->mCPIEnabled)
|
||||
{
|
||||
adapter->sendMsg(new LocEngInjectLocation(adapter, latitude, longitude,
|
||||
accuracy));
|
||||
}
|
||||
|
||||
EXIT_LOG(%d, 0);
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue