Merge "Return NULL AGPS interface on APQ target."

This commit is contained in:
Linux Build Service Account 2013-08-11 23:10:22 -07:00 committed by Gerrit - the friendly Code Review server
commit e3c48121c1
2 changed files with 31 additions and 1 deletions

View file

@ -571,7 +571,19 @@ const void* loc_get_extension(const char* name)
}
else if (strcmp(name, AGPS_INTERFACE) == 0)
{
ret_val = &sLocEngAGpsInterface;
//Return an interface to AGPS only if MSA or MSB capabilities
//are present. If the target is an APQ, these masks are
//cleared in get_gps_interface() and the below logic will
//return NULL as the interface for AGPS
if((gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) ||
(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB) ) {
LOC_LOGD("%s:%d]: AGPS capabilities found\n", __func__, __LINE__);
ret_val = &sLocEngAGpsInterface;
}
else {
LOC_LOGD("%s:%d]: Returning NULL AgpsInterface\n", __func__, __LINE__);
ret_val = NULL;
}
}
else if (strcmp(name, GPS_NI_INTERFACE) == 0)
{

View file

@ -1454,6 +1454,13 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks,
loc_eng_data.generateNmea = false;
}
//Disable AGPS if capabilities are not present
if(!(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) &&
!(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA)) {
event &= ~(LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST |
LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST);
}
loc_eng_data.adapter =
new LocEngAdapter(event, &loc_eng_data,
(MsgTask::tCreate)callbacks->create_thread_cb);
@ -1950,6 +1957,17 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call
EXIT_LOG(%s, VOID_RET);
return;
}
//Proceed to create AGPS framework only if MSA or MSB capabilities
//are present. If the target is an APQ, these masks are
//cleared in get_gps_interface()
if(!(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) &&
!(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB) ) {
LOC_LOGD("%s:%d]: No AGPS capabilities found. Returning\n",
__func__, __LINE__);
return;
}
loc_eng_data.agps_status_cb = callbacks->status_cb;
loc_eng_data.agnss_nif = new AgpsStateMachine(servicerTypeAgps,