msm8974-common: gps: Fix race condition when GPS app is closed around an SSR event

Fix race condition to get avoid stuck in modem if GPS application
is closed right around a SSR event.This fix will prevent resume the
session once HAL loc_stop has been called.

Change-Id: I4e5c3f09c097b835d8a685a8b465eb86dd06cd7a
CRs-Fixed: 1058559
This commit is contained in:
Harikrishnan Hariharan 2016-08-30 02:13:29 +05:30 committed by Kevin F. Haggerty
parent 6b9221934a
commit 2a42d86692
No known key found for this signature in database
GPG Key ID: 6D95512933112729

View File

@ -1978,7 +1978,6 @@ static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data)
int ret_val = LOC_API_ADAPTER_ERR_SUCCESS;
if (loc_eng_data.adapter->isInSession()) {
ret_val = loc_eng_data.adapter->stopFix();
loc_eng_data.adapter->setInSession(FALSE);
}
@ -2862,7 +2861,7 @@ void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data)
if (loc_eng_data.adapter->isInSession()) {
// This sets the copy in adapter to modem
loc_eng_data.adapter->setInSession(false);
loc_eng_data.adapter->sendMsg(new LocEngStartFix(loc_eng_data.adapter));
loc_eng_start_handler(loc_eng_data);
}
EXIT_LOG(%s, VOID_RET);
}