Stop Gnss measurements session when closed

Gnss measurements session that is started to
collect Gnss measurements needs to be stoped
when closed.
Also remove the ability for an MSA tracking
session to be started when Gnss measurments is
started because MSA tracking is power hungry
and it wouldn't provide measurements either

Change-Id: I9b20f73bd412fc68d96dad2dc38399c144922ea0
CRs-fixed: 2039306
This commit is contained in:
Dante Russo 2017-05-10 16:47:00 -07:00
parent f4f9b5c5a6
commit f354bdfa62

View file

@ -109,8 +109,8 @@ MeasurementAPIClient::measurementSetCallback(const sp<IGnssMeasurementCallback>&
} }
if (mLocationCapabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSB_BIT) if (mLocationCapabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSB_BIT)
mLocationOptions.mode = GNSS_SUPL_MODE_MSB; mLocationOptions.mode = GNSS_SUPL_MODE_MSB;
else if (mLocationCapabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSA_BIT) else
mLocationOptions.mode = GNSS_SUPL_MODE_MSA; mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE;
LOC_LOGD("%s]: start tracking session", __FUNCTION__); LOC_LOGD("%s]: start tracking session", __FUNCTION__);
locAPIStartTracking(mLocationOptions); locAPIStartTracking(mLocationOptions);
@ -123,6 +123,7 @@ void MeasurementAPIClient::measurementClose() {
pthread_mutex_lock(&mLock); pthread_mutex_lock(&mLock);
mGnssMeasurementCbIface = nullptr; mGnssMeasurementCbIface = nullptr;
pthread_mutex_unlock(&mLock); pthread_mutex_unlock(&mLock);
locAPIStopTracking();
} }
// callbacks // callbacks