diff options
author | David Christie <dnchrist@google.com> | 2015-04-12 20:57:02 -0700 |
---|---|---|
committer | David Christie <dnchrist@google.com> | 2015-04-13 17:59:39 -0700 |
commit | 5cf80e50033cbb2be14dbee1b97ae5ded648b252 (patch) | |
tree | 0a555e027114b217d20319d422a9f184c8385832 /include | |
parent | 97f76dca035bfd379f76f17bc8415ced58410d4f (diff) | |
download | hardware_libhardware-5cf80e50033cbb2be14dbee1b97ae5ded648b252.zip hardware_libhardware-5cf80e50033cbb2be14dbee1b97ae5ded648b252.tar.gz hardware_libhardware-5cf80e50033cbb2be14dbee1b97ae5ded648b252.tar.bz2 |
Add a status callback for FLP HAL batching.
-Allows GmsCore to know if location batching is
unsuccessful so it can switch to a SW solution.
Change-Id: I5a01d44fdcf6daa07d6b40cf95a674e98179bf00
Diffstat (limited to 'include')
-rw-r--r-- | include/hardware/fused_location.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/hardware/fused_location.h b/include/hardware/fused_location.h index a60280c..62cfee8 100644 --- a/include/hardware/fused_location.h +++ b/include/hardware/fused_location.h @@ -92,6 +92,17 @@ __BEGIN_DECLS #define CAPABILITY_CELL (1U<<3) /** + * Status to return in flp_status_callback when your implementation transitions + * from being unsuccessful in determining location to being successful. + */ +#define FLP_STATUS_LOCATION_AVAILABLE 0 +/** + * Status to return in flp_status_callback when your implementation transitions + * from being successful in determining location to being unsuccessful. + */ +#define FLP_STATUS_LOCATION_UNAVAILABLE 1 + +/** * This constant is used with the batched locations * APIs. Batching is mandatory when FLP implementation * is supported. If the flag is set, the hardware implementation @@ -214,6 +225,22 @@ typedef int (*flp_set_thread_event)(ThreadEvent event); */ typedef void (*flp_capabilities_callback)(int capabilities); +/** + * Callback with status information on the ability to compute location. + * To avoid waking up the application processor you should only send + * changes in status (you shouldn't call this method twice in a row + * with the same status value). As a guideline you should not call this + * more frequently then the requested batch period set with period_ns + * in FlpBatchOptions. For example if period_ns is set to 5 minutes and + * the status changes many times in that interval, you should only report + * one status change every 5 minutes. + * + * Parameters: + * status is one of FLP_STATUS_LOCATION_AVAILABLE + * or FLP_STATUS_LOCATION_UNAVAILABLE. + */ +typedef void (*flp_status_callback)(int32_t status); + /** FLP callback structure. */ typedef struct { /** set to sizeof(FlpCallbacks) */ @@ -223,6 +250,7 @@ typedef struct { flp_release_wakelock release_wakelock_cb; flp_set_thread_event set_thread_event_cb; flp_capabilities_callback flp_capabilities_cb; + flp_status_callback flp_status_cb; } FlpCallbacks; |