Merge "gps: report session begin/end on gps start/stop"

This commit is contained in:
Linux Build Service Account 2012-10-01 10:33:13 -07:00 committed by Gerrit - the friendly Code Review server
commit de8ce86fe4

View file

@ -536,6 +536,7 @@ static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data)
ret_val == LOC_API_ADAPTER_ERR_ENGINE_DOWN)
{
loc_eng_data.client_handle->setInSession(TRUE);
loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_BEGIN);
}
}
@ -589,8 +590,7 @@ static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data)
if (loc_eng_data.client_handle->isInSession()) {
ret_val = loc_eng_data.client_handle->stopFix();
if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS &&
loc_eng_data.fix_session_status != GPS_STATUS_SESSION_BEGIN)
if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS)
{
loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_END);
}
@ -787,14 +787,6 @@ static void loc_inform_gps_status(loc_eng_data_s_type &loc_eng_data, GpsStatusVa
{
CALLBACK_LOG_CALLFLOW("status_cb", %s, loc_get_gps_status_name(gs.status));
loc_eng_data.status_cb(&gs);
// Restore session begin if needed
if (status == GPS_STATUS_ENGINE_ON && last_status == GPS_STATUS_SESSION_BEGIN)
{
GpsStatus gs_sess_begin = { sizeof(gs_sess_begin),GPS_STATUS_SESSION_BEGIN };
CALLBACK_LOG_CALLFLOW("status_cb", %s, loc_get_gps_status_name(gs_sess_begin.status));
loc_eng_data.status_cb(&gs_sess_begin);
}
}
last_status = status;