Fixes loc_ext and AFW concurrency issues

Part of changes so that loc_ext stack gets its own QMI_LOC client.
CRs-Fixed: 565281

Change-Id: I7dda3cd8e90e699f11391ea621a785f775978e41
This commit is contained in:
Satheesh Jayakumar 2013-09-27 15:14:44 -07:00
parent 673b23822f
commit e9d4048168
5 changed files with 13 additions and 10 deletions

View file

@ -67,12 +67,15 @@ void LocInternalAdapter::setUlpProxy(UlpProxyBase* ulp) {
}
LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask,
void* owner,
void* owner, ContextBase* context,
MsgTask::tCreate tCreator) :
LocAdapterBase(mask,
LocDualContext::getLocFgContext(
tCreator,
LocDualContext::mLocationHalName)),
//Get the AFW context if VzW context has not already been intialized in
//loc_ext
context == NULL?
LocDualContext::getLocFgContext(tCreator,
LocDualContext::mLocationHalName)
:context),
mOwner(owner), mInternalAdapter(new LocInternalAdapter(this)),
mUlp(new UlpProxyBase()), mNavigating(false),
mAgpsEnabled(false)

View file

@ -78,7 +78,7 @@ public:
bool mAgpsEnabled;
LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask,
void* owner,
void* owner,ContextBase* context,
MsgTask::tCreate tCreator);
virtual ~LocEngAdapter();

View file

@ -274,7 +274,7 @@ static int loc_init(GpsCallbacks* callbacks)
gps_loc_cb = callbacks->location_cb;
gps_sv_cb = callbacks->sv_status_cb;
retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event);
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();

View file

@ -1455,7 +1455,7 @@ SIDE EFFECTS
===========================================================================*/
int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks,
LOC_API_ADAPTER_EVENT_MASK_T event)
LOC_API_ADAPTER_EVENT_MASK_T event, ContextBase* context)
{
int ret_val = 0;
@ -1507,12 +1507,11 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks,
}
loc_eng_data.adapter =
new LocEngAdapter(event, &loc_eng_data,
new LocEngAdapter(event, &loc_eng_data, context,
(MsgTask::tCreate)callbacks->create_thread_cb);
LOC_LOGD("loc_eng_init created client, id = %p\n",
loc_eng_data.adapter);
loc_eng_data.adapter->sendMsg(new LocEngInit(&loc_eng_data));
EXIT_LOG(%d, ret_val);

View file

@ -178,7 +178,8 @@ extern loc_sap_cfg_s_type sap_conf;
int loc_eng_init(loc_eng_data_s_type &loc_eng_data,
LocCallbacks* callbacks,
LOC_API_ADAPTER_EVENT_MASK_T event);
LOC_API_ADAPTER_EVENT_MASK_T event,
ContextBase* context);
int loc_eng_start(loc_eng_data_s_type &loc_eng_data);
int loc_eng_stop(loc_eng_data_s_type &loc_eng_data);
void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data);