diff options
author | Dante Russo <drusso@codeaurora.org> | 2017-10-03 14:38:42 -0700 |
---|---|---|
committer | Dante Russo <drusso@codeaurora.org> | 2017-10-10 14:56:34 -0700 |
commit | 34ce2a68730afc925438ba191514db7b10432821 (patch) | |
tree | 0fb8863219740282cf08d729e98b3eba53021731 /location/LocationAPIClientBase.h | |
parent | 39526894cfaafab8b9fc6714956c4f6df0bcc329 (diff) | |
download | gps-34ce2a68730afc925438ba191514db7b10432821.tar.gz |
Fix support for batching without batch full event
Additional fixes:
-fix issue where if StartTracking or
StartBatching fails at QMI LOC layer, then the
session is stuck and Tracking or Batching cannot
be stoped or started again.
-fix getBatchedLocation API to return an error
if the id given is not valid, as caller
will not get a response callback in this case.
CRs-fixed 2118838
Change-Id: I389fc862836450f0081f6394c971b33614373841
Diffstat (limited to 'location/LocationAPIClientBase.h')
-rw-r--r-- | location/LocationAPIClientBase.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/location/LocationAPIClientBase.h b/location/LocationAPIClientBase.h index 78c8fa6..c6ea05c 100644 --- a/location/LocationAPIClientBase.h +++ b/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; |