Merge "Inject location only on CPI disabled"
This commit is contained in:
commit
3d86280b90
6 changed files with 31 additions and 27 deletions
|
@ -101,6 +101,7 @@ public:
|
||||||
const void* data);
|
const void* data);
|
||||||
inline virtual bool isInSession() { return false; }
|
inline virtual bool isInSession() { return false; }
|
||||||
virtual void shutdown();
|
virtual void shutdown();
|
||||||
|
ContextBase* getContext() const { return mContext; }
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace loc_core
|
} // namespace loc_core
|
||||||
|
|
|
@ -46,6 +46,9 @@ protected:
|
||||||
inline virtual ~LocAdapterProxyBase() {
|
inline virtual ~LocAdapterProxyBase() {
|
||||||
delete mLocAdapterBase;
|
delete mLocAdapterBase;
|
||||||
}
|
}
|
||||||
|
ContextBase* getContext() const {
|
||||||
|
return mLocAdapterBase->getContext();
|
||||||
|
}
|
||||||
public:
|
public:
|
||||||
inline virtual void handleEngineUpEvent() {};
|
inline virtual void handleEngineUpEvent() {};
|
||||||
inline virtual void handleEngineDownEvent() {};
|
inline virtual void handleEngineDownEvent() {};
|
||||||
|
|
|
@ -69,8 +69,8 @@ LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask,
|
||||||
:context),
|
:context),
|
||||||
mOwner(owner), mInternalAdapter(new LocInternalAdapter(this)),
|
mOwner(owner), mInternalAdapter(new LocInternalAdapter(this)),
|
||||||
mUlp(new UlpProxyBase()), mNavigating(false),
|
mUlp(new UlpProxyBase()), mNavigating(false),
|
||||||
mSupportsAgpsExtendedCapabilities(false),
|
mSupportsAgpsRequests(false),
|
||||||
mSupportsCPIExtendedCapabilities(false), mPowerVote(0)
|
mSupportsPositionInjection(false), mPowerVote(0)
|
||||||
{
|
{
|
||||||
memset(&mFixCriteria, 0, sizeof(mFixCriteria));
|
memset(&mFixCriteria, 0, sizeof(mFixCriteria));
|
||||||
mFixCriteria.mode = LOC_POSITION_MODE_INVALID;
|
mFixCriteria.mode = LOC_POSITION_MODE_INVALID;
|
||||||
|
@ -249,84 +249,84 @@ bool LocEngAdapter::reportXtraServer(const char* url1,
|
||||||
const char* url3,
|
const char* url3,
|
||||||
const int maxlength)
|
const int maxlength)
|
||||||
{
|
{
|
||||||
if (mSupportsAgpsExtendedCapabilities) {
|
if (mSupportsAgpsRequests) {
|
||||||
sendMsg(new LocEngReportXtraServer(mOwner, url1,
|
sendMsg(new LocEngReportXtraServer(mOwner, url1,
|
||||||
url2, url3, maxlength));
|
url2, url3, maxlength));
|
||||||
}
|
}
|
||||||
return mSupportsAgpsExtendedCapabilities;
|
return mSupportsAgpsRequests;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
bool LocEngAdapter::requestATL(int connHandle, AGpsType agps_type)
|
bool LocEngAdapter::requestATL(int connHandle, AGpsType agps_type)
|
||||||
{
|
{
|
||||||
if (mSupportsAgpsExtendedCapabilities) {
|
if (mSupportsAgpsRequests) {
|
||||||
sendMsg(new LocEngRequestATL(mOwner,
|
sendMsg(new LocEngRequestATL(mOwner,
|
||||||
connHandle, agps_type));
|
connHandle, agps_type));
|
||||||
}
|
}
|
||||||
return mSupportsAgpsExtendedCapabilities;
|
return mSupportsAgpsRequests;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
bool LocEngAdapter::releaseATL(int connHandle)
|
bool LocEngAdapter::releaseATL(int connHandle)
|
||||||
{
|
{
|
||||||
if (mSupportsAgpsExtendedCapabilities) {
|
if (mSupportsAgpsRequests) {
|
||||||
sendMsg(new LocEngReleaseATL(mOwner, connHandle));
|
sendMsg(new LocEngReleaseATL(mOwner, connHandle));
|
||||||
}
|
}
|
||||||
return mSupportsAgpsExtendedCapabilities;
|
return mSupportsAgpsRequests;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
bool LocEngAdapter::requestXtraData()
|
bool LocEngAdapter::requestXtraData()
|
||||||
{
|
{
|
||||||
if (mSupportsAgpsExtendedCapabilities) {
|
if (mSupportsAgpsRequests) {
|
||||||
sendMsg(new LocEngRequestXtra(mOwner));
|
sendMsg(new LocEngRequestXtra(mOwner));
|
||||||
}
|
}
|
||||||
return mSupportsAgpsExtendedCapabilities;
|
return mSupportsAgpsRequests;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
bool LocEngAdapter::requestTime()
|
bool LocEngAdapter::requestTime()
|
||||||
{
|
{
|
||||||
if (mSupportsAgpsExtendedCapabilities) {
|
if (mSupportsAgpsRequests) {
|
||||||
sendMsg(new LocEngRequestTime(mOwner));
|
sendMsg(new LocEngRequestTime(mOwner));
|
||||||
}
|
}
|
||||||
return mSupportsAgpsExtendedCapabilities;
|
return mSupportsAgpsRequests;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
bool LocEngAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data)
|
bool LocEngAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data)
|
||||||
{
|
{
|
||||||
if (mSupportsAgpsExtendedCapabilities) {
|
if (mSupportsAgpsRequests) {
|
||||||
notif.size = sizeof(notif);
|
notif.size = sizeof(notif);
|
||||||
notif.timeout = LOC_NI_NO_RESPONSE_TIME;
|
notif.timeout = LOC_NI_NO_RESPONSE_TIME;
|
||||||
|
|
||||||
sendMsg(new LocEngRequestNi(mOwner, notif, data));
|
sendMsg(new LocEngRequestNi(mOwner, notif, data));
|
||||||
}
|
}
|
||||||
return mSupportsAgpsExtendedCapabilities;
|
return mSupportsAgpsRequests;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
bool LocEngAdapter::requestSuplES(int connHandle)
|
bool LocEngAdapter::requestSuplES(int connHandle)
|
||||||
{
|
{
|
||||||
if (mSupportsAgpsExtendedCapabilities)
|
if (mSupportsAgpsRequests)
|
||||||
sendMsg(new LocEngRequestSuplEs(mOwner, connHandle));
|
sendMsg(new LocEngRequestSuplEs(mOwner, connHandle));
|
||||||
return mSupportsAgpsExtendedCapabilities;
|
return mSupportsAgpsRequests;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
bool LocEngAdapter::reportDataCallOpened()
|
bool LocEngAdapter::reportDataCallOpened()
|
||||||
{
|
{
|
||||||
if(mSupportsAgpsExtendedCapabilities)
|
if(mSupportsAgpsRequests)
|
||||||
sendMsg(new LocEngSuplEsOpened(mOwner));
|
sendMsg(new LocEngSuplEsOpened(mOwner));
|
||||||
return mSupportsAgpsExtendedCapabilities;
|
return mSupportsAgpsRequests;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
bool LocEngAdapter::reportDataCallClosed()
|
bool LocEngAdapter::reportDataCallClosed()
|
||||||
{
|
{
|
||||||
if(mSupportsAgpsExtendedCapabilities)
|
if(mSupportsAgpsRequests)
|
||||||
sendMsg(new LocEngSuplEsClosed(mOwner));
|
sendMsg(new LocEngSuplEsClosed(mOwner));
|
||||||
return mSupportsAgpsExtendedCapabilities;
|
return mSupportsAgpsRequests;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
|
|
|
@ -83,8 +83,8 @@ class LocEngAdapter : public LocAdapterBase {
|
||||||
static const unsigned int POWER_VOTE_VALUE = 0x10;
|
static const unsigned int POWER_VOTE_VALUE = 0x10;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool mSupportsAgpsExtendedCapabilities;
|
bool mSupportsAgpsRequests;
|
||||||
bool mSupportsCPIExtendedCapabilities;
|
bool mSupportsPositionInjection;
|
||||||
|
|
||||||
LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask,
|
LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask,
|
||||||
void* owner, ContextBase* context,
|
void* owner, ContextBase* context,
|
||||||
|
|
|
@ -287,8 +287,8 @@ static int loc_init(GpsCallbacks* callbacks)
|
||||||
|
|
||||||
retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, NULL);
|
retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, NULL);
|
||||||
loc_afw_data.adapter->requestUlp(gps_conf.CAPABILITIES);
|
loc_afw_data.adapter->requestUlp(gps_conf.CAPABILITIES);
|
||||||
loc_afw_data.adapter->mSupportsAgpsExtendedCapabilities = !loc_afw_data.adapter->hasAgpsExtendedCapabilities();
|
loc_afw_data.adapter->mSupportsAgpsRequests = !loc_afw_data.adapter->hasAgpsExtendedCapabilities();
|
||||||
loc_afw_data.adapter->mSupportsCPIExtendedCapabilities = !loc_afw_data.adapter->hasCPIExtendedCapabilities();
|
loc_afw_data.adapter->mSupportsPositionInjection = !loc_afw_data.adapter->hasCPIExtendedCapabilities();
|
||||||
|
|
||||||
if(retVal) {
|
if(retVal) {
|
||||||
LOC_LOGE("loc_eng_init() fail!");
|
LOC_LOGE("loc_eng_init() fail!");
|
||||||
|
|
|
@ -1898,7 +1898,7 @@ int loc_eng_inject_location(loc_eng_data_s_type &loc_eng_data, double latitude,
|
||||||
ENTRY_LOG_CALLFLOW();
|
ENTRY_LOG_CALLFLOW();
|
||||||
INIT_CHECK(loc_eng_data.adapter, return -1);
|
INIT_CHECK(loc_eng_data.adapter, return -1);
|
||||||
LocEngAdapter* adapter = loc_eng_data.adapter;
|
LocEngAdapter* adapter = loc_eng_data.adapter;
|
||||||
if(!adapter->mSupportsCPIExtendedCapabilities)
|
if(adapter->mSupportsPositionInjection)
|
||||||
{
|
{
|
||||||
adapter->sendMsg(new LocEngInjectLocation(adapter, latitude, longitude,
|
adapter->sendMsg(new LocEngInjectLocation(adapter, latitude, longitude,
|
||||||
accuracy));
|
accuracy));
|
||||||
|
@ -2114,7 +2114,7 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call
|
||||||
AGPS_TYPE_SUPL,
|
AGPS_TYPE_SUPL,
|
||||||
false);
|
false);
|
||||||
|
|
||||||
if (adapter->mSupportsAgpsExtendedCapabilities) {
|
if (adapter->mSupportsAgpsRequests) {
|
||||||
loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data));
|
loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data));
|
||||||
|
|
||||||
loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb,
|
loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb,
|
||||||
|
|
Loading…
Reference in a new issue