diff options
author | Bruno Martins <bgcngm@gmail.com> | 2018-03-14 23:42:25 +0000 |
---|---|---|
committer | Cosme Domínguez Díaz <cosme.ddiaz@gmail.com> | 2018-03-16 00:50:43 +0100 |
commit | 122f2ed00414cf416b67c6dee10131b0f3e28bea (patch) | |
tree | 04057c48ef75a874573f880e5ea3a3ede58fdd95 /gps/location/LocationAPIClientBase.h | |
parent | d725d2ed80359098e6b1952f942421cabd844b2a (diff) |
msm8996-common: Update GPS HIDL HAL from upstream
* Tag: LA.UM.6.6.r1-06700-89xx.0
Change-Id: If746b12bcbc3e414aa9ba9f421040edd0f815638
Diffstat (limited to 'gps/location/LocationAPIClientBase.h')
-rw-r--r-- | gps/location/LocationAPIClientBase.h | 20 |
1 files changed, 10 insertions, 10 deletions
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; }; |