diff options
author | Mike Lockwood <lockwood@android.com> | 2010-04-07 09:04:25 -0400 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2010-04-14 14:45:49 -0400 |
commit | d20bbae343927bbf428243b00ecfcae7e30ef97b (patch) | |
tree | d47106b06c7352e1d4c9e03a0668ff1b442f61d0 | |
parent | b9e7ea446e6c34f1aaa2bc57b688f1a84a6e0614 (diff) | |
download | libhardware-d20bbae343927bbf428243b00ecfcae7e30ef97b.tar.gz |
Add wake lock utility functions for the GPS HAL.
Change-Id: Ia7e20dec1a658f5506004ed29632f6a720c77fab
Signed-off-by: Mike Lockwood <lockwood@android.com>
-rw-r--r-- | include/hardware/gps.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/include/hardware/gps.h b/include/hardware/gps.h index 11223fb4..750e6efe 100644 --- a/include/hardware/gps.h +++ b/include/hardware/gps.h @@ -263,12 +263,23 @@ typedef void (* gps_sv_status_callback)(GpsSvStatus* sv_info); /** Callback for reporting NMEA sentences. */ typedef void (* gps_nmea_callback)(GpsUtcTime timestamp, const char* nmea, int length); +/** Callback utility for acquiring the GPS wakelock. + This can be used to prevent the CPU from suspending while handling GPS events. */ +typedef void (* gps_acquire_wakelock)(); + +/** Callback utility for releasing the GPS wakelock. */ +typedef void (* gps_release_wakelock)(); + /** GPS callback structure. */ typedef struct { - gps_location_callback location_cb; - gps_status_callback status_cb; - gps_sv_status_callback sv_status_cb; - gps_nmea_callback nmea_cb; + /** set to sizeof(GpsCallbacks) */ + size_t size; + gps_location_callback location_cb; + gps_status_callback status_cb; + gps_sv_status_callback sv_status_cb; + gps_nmea_callback nmea_cb; + gps_acquire_wakelock acquire_wakelock_cb; + gps_release_wakelock release_wakelock_cb; } GpsCallbacks; |