From 122f2ed00414cf416b67c6dee10131b0f3e28bea Mon Sep 17 00:00:00 2001 From: Bruno Martins Date: Wed, 14 Mar 2018 23:42:25 +0000 Subject: msm8996-common: Update GPS HIDL HAL from upstream * Tag: LA.UM.6.6.r1-06700-89xx.0 Change-Id: If746b12bcbc3e414aa9ba9f421040edd0f815638 --- gps/android/location_api/MeasurementAPIClient.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gps/android/location_api/MeasurementAPIClient.cpp') diff --git a/gps/android/location_api/MeasurementAPIClient.cpp b/gps/android/location_api/MeasurementAPIClient.cpp index dd7ceac..731c7ed 100644 --- a/gps/android/location_api/MeasurementAPIClient.cpp +++ b/gps/android/location_api/MeasurementAPIClient.cpp @@ -66,7 +66,9 @@ MeasurementAPIClient::measurementSetCallback(const sp& { LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); + mMutex.lock(); mGnssMeasurementCbIface = callback; + mMutex.unlock(); LocationCallbacks locationCallbacks; memset(&locationCallbacks, 0, sizeof(LocationCallbacks)); @@ -116,10 +118,14 @@ void MeasurementAPIClient::onGnssMeasurementsCb( LOC_LOGD("%s]: (count: %zu active: %zu)", __FUNCTION__, gnssMeasurementsNotification.count, mTracking); if (mTracking) { - if (mGnssMeasurementCbIface != nullptr) { + mMutex.lock(); + auto gnssMeasurementCbIface(mGnssMeasurementCbIface); + mMutex.unlock(); + + if (gnssMeasurementCbIface != nullptr) { IGnssMeasurementCallback::GnssData gnssData; convertGnssData(gnssMeasurementsNotification, gnssData); - auto r = mGnssMeasurementCbIface->GnssMeasurementCb(gnssData); + auto r = gnssMeasurementCbIface->GnssMeasurementCb(gnssData); if (!r.isOk()) { LOC_LOGE("%s] Error from GnssMeasurementCb description=%s", __func__, r.description().c_str()); -- cgit v1.2.3