diff options
author | Wei Chen <weic@codeaurora.org> | 2018-11-15 09:41:26 -0800 |
---|---|---|
committer | Wei Chen <weic@codeaurora.org> | 2018-11-27 17:07:19 -0800 |
commit | e232986d84deb7178d1a57cc7f1e4d24cbaeeb3c (patch) | |
tree | 882a2a704ea4d27c8a40f0f1b2d661e5c96b5087 /location/location_interface.h | |
parent | 9b0abcc59d3ea840c38b131d2c4d1c14028f29e1 (diff) | |
download | gps-e232986d84deb7178d1a57cc7f1e4d24cbaeeb3c.tar.gz |
GPS location API: support destroy with callback for completion
Support Location API destroy function with callback. Location
API client that passes callback to Location API need to wait
for the destroy complete callback to be invoked before releasing
the memory that holds the callback
Change-Id: I29b1c6d46feb79c789e6f1ec1500c941b022a3ac
CRs-fixed: 2349398
Diffstat (limited to 'location/location_interface.h')
-rw-r--r-- | location/location_interface.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/location/location_interface.h b/location/location_interface.h index e9e2fe8..480bbdb 100644 --- a/location/location_interface.h +++ b/location/location_interface.h @@ -46,12 +46,14 @@ typedef std::function<void( uint64_t gnssEnergyConsumedFromFirstBoot )> GnssEnergyConsumedCallback; +typedef void (*removeClientCompleteCallback)(LocationAPI* client); + struct GnssInterface { size_t size; void (*initialize)(void); void (*deinitialize)(void); void (*addClient)(LocationAPI* client, const LocationCallbacks& callbacks); - void (*removeClient)(LocationAPI* client); + void (*removeClient)(LocationAPI* client, removeClientCompleteCallback rmClientCb); void (*requestCapabilities)(LocationAPI* client); uint32_t (*startTracking)(LocationAPI* client, TrackingOptions&); void (*updateTrackingOptions)(LocationAPI* client, uint32_t id, TrackingOptions&); @@ -87,7 +89,7 @@ struct FlpInterface { void (*initialize)(void); void (*deinitialize)(void); void (*addClient)(LocationAPI* client, const LocationCallbacks& callbacks); - void (*removeClient)(LocationAPI* client); + void (*removeClient)(LocationAPI* client, removeClientCompleteCallback rmClientCb); void (*requestCapabilities)(LocationAPI* client); uint32_t (*startTracking)(LocationAPI* client, TrackingOptions&); void (*updateTrackingOptions)(LocationAPI* client, uint32_t id, TrackingOptions&); @@ -104,7 +106,7 @@ struct GeofenceInterface { void (*initialize)(void); void (*deinitialize)(void); void (*addClient)(LocationAPI* client, const LocationCallbacks& callbacks); - void (*removeClient)(LocationAPI* client); + void (*removeClient)(LocationAPI* client, removeClientCompleteCallback rmClientCb); void (*requestCapabilities)(LocationAPI* client); uint32_t* (*addGeofences)(LocationAPI* client, size_t count, GeofenceOption*, GeofenceInfo*); void (*removeGeofences)(LocationAPI* client, size_t count, uint32_t* ids); |