From e5c53750f06e9d9739b45ec108260ead7ff80941 Mon Sep 17 00:00:00 2001 From: Isaac Chen Date: Mon, 31 Dec 2018 10:55:08 +0100 Subject: wayne-common: Synchorize gps to P * QC Tag: LA.UM.7.2.r1-04900-sdm660.0 Signed-off-by: Isaac Chen Change-Id: I34383e8fbf394b774f83f8d662873e8786ff1bbf --- gps/location/LocationAPIClientBase.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'gps/location/LocationAPIClientBase.h') diff --git a/gps/location/LocationAPIClientBase.h b/gps/location/LocationAPIClientBase.h index c6ea05c..4bd1466 100644 --- a/gps/location/LocationAPIClientBase.h +++ b/gps/location/LocationAPIClientBase.h @@ -36,6 +36,8 @@ #include #include "LocationAPI.h" +#include +#include enum SESSION_MODE { SESSION_MODE_NONE = 0, @@ -469,11 +471,24 @@ private: class RemoveGeofencesRequest : public LocationAPIRequest { public: - RemoveGeofencesRequest(LocationAPIClientBase& API) : mAPI(API) {} + RemoveGeofencesRequest(LocationAPIClientBase& API, + BiDict* removedGeofenceBiDict) : + mAPI(API), mRemovedGeofenceBiDict(removedGeofenceBiDict) {} inline void onCollectiveResponse(size_t count, LocationError* errors, uint32_t* sessions) { - // No need to handle collectiveResponse, cbs already notified + if (nullptr != mRemovedGeofenceBiDict) { + uint32_t *ids = (uint32_t*)malloc(sizeof(uint32_t) * count); + for (size_t i = 0; i < count; i++) { + ids[i] = mRemovedGeofenceBiDict->getId(sessions[i]); + } + mAPI.onRemoveGeofencesCb(count, errors, ids); + free(ids); + delete(mRemovedGeofenceBiDict); + } else { + LOC_LOGE("%s:%d] Unable to access removed geofences data.", __FUNCTION__, __LINE__); + } } LocationAPIClientBase& mAPI; + BiDict* mRemovedGeofenceBiDict; }; class ModifyGeofencesRequest : public LocationAPIRequest { -- cgit v1.2.3