From f354bdfa6263b7ddda347f0373310a44d703659c Mon Sep 17 00:00:00 2001 From: Dante Russo Date: Wed, 10 May 2017 16:47:00 -0700 Subject: [PATCH] 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 --- android/location_api/MeasurementAPIClient.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/android/location_api/MeasurementAPIClient.cpp b/android/location_api/MeasurementAPIClient.cpp index 8e6f48c6..074fbeb9 100644 --- a/android/location_api/MeasurementAPIClient.cpp +++ b/android/location_api/MeasurementAPIClient.cpp @@ -109,8 +109,8 @@ MeasurementAPIClient::measurementSetCallback(const sp& } if (mLocationCapabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSB_BIT) mLocationOptions.mode = GNSS_SUPL_MODE_MSB; - else if (mLocationCapabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSA_BIT) - mLocationOptions.mode = GNSS_SUPL_MODE_MSA; + else + mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE; LOC_LOGD("%s]: start tracking session", __FUNCTION__); locAPIStartTracking(mLocationOptions); @@ -123,6 +123,7 @@ void MeasurementAPIClient::measurementClose() { pthread_mutex_lock(&mLock); mGnssMeasurementCbIface = nullptr; pthread_mutex_unlock(&mLock); + locAPIStopTracking(); } // callbacks