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/location/LocationAPIClientBase.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'gps/location/LocationAPIClientBase.h') diff --git a/gps/location/LocationAPIClientBase.h b/gps/location/LocationAPIClientBase.h index a856054..c6ea05c 100644 --- a/gps/location/LocationAPIClientBase.h +++ b/gps/location/LocationAPIClientBase.h @@ -195,7 +195,7 @@ public: uint32_t locAPIStopSession(uint32_t id); uint32_t locAPIUpdateSessionOptions(uint32_t id, uint32_t sessionMode, LocationOptions& options); - void locAPIGetBatchedLocations(uint32_t id, size_t count); + uint32_t locAPIGetBatchedLocations(uint32_t id, size_t count); uint32_t locAPIAddGeofences(size_t count, uint32_t* ids, GeofenceOption* options, GeofenceInfo* data); @@ -381,7 +381,10 @@ private: class StartTrackingRequest : public LocationAPIRequest { public: StartTrackingRequest(LocationAPIClientBase& API) : mAPI(API) {} - inline void onResponse(LocationError error, uint32_t /*id*/) { + inline void onResponse(LocationError error, uint32_t id) { + if (error != LOCATION_ERROR_SUCCESS) { + mAPI.removeSession(id); + } mAPI.onStartTrackingCb(error); } LocationAPIClientBase& mAPI; @@ -411,7 +414,10 @@ private: class StartBatchingRequest : public LocationAPIRequest { public: StartBatchingRequest(LocationAPIClientBase& API) : mAPI(API) {} - inline void onResponse(LocationError error, uint32_t /*id*/) { + inline void onResponse(LocationError error, uint32_t id) { + if (error != LOCATION_ERROR_SUCCESS) { + mAPI.removeSession(id); + } mAPI.onStartBatchingCb(error); } LocationAPIClientBase& mAPI; @@ -465,13 +471,7 @@ private: public: RemoveGeofencesRequest(LocationAPIClientBase& API) : mAPI(API) {} inline void onCollectiveResponse(size_t count, LocationError* errors, uint32_t* sessions) { - uint32_t *ids = (uint32_t*)malloc(sizeof(uint32_t) * count); - for (size_t i = 0; i < count; i++) { - ids[i] = mAPI.mGeofenceBiDict.getId(sessions[i]); - mAPI.mGeofenceBiDict.rmBySession(sessions[i]); - } - mAPI.onRemoveGeofencesCb(count, errors, ids); - free(ids); + // No need to handle collectiveResponse, cbs already notified } LocationAPIClientBase& mAPI; }; -- cgit v1.2.3