summaryrefslogtreecommitdiffstats
path: root/include/hardware/gps.h
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2010-04-07 09:04:25 -0400
committerMike Lockwood <lockwood@android.com>2010-04-14 14:45:49 -0400
commitd20bbae343927bbf428243b00ecfcae7e30ef97b (patch)
treed47106b06c7352e1d4c9e03a0668ff1b442f61d0 /include/hardware/gps.h
parentb9e7ea446e6c34f1aaa2bc57b688f1a84a6e0614 (diff)
downloadhardware_libhardware-d20bbae343927bbf428243b00ecfcae7e30ef97b.zip
hardware_libhardware-d20bbae343927bbf428243b00ecfcae7e30ef97b.tar.gz
hardware_libhardware-d20bbae343927bbf428243b00ecfcae7e30ef97b.tar.bz2
Add wake lock utility functions for the GPS HAL.
Change-Id: Ia7e20dec1a658f5506004ed29632f6a720c77fab Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'include/hardware/gps.h')
-rw-r--r--include/hardware/gps.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/include/hardware/gps.h b/include/hardware/gps.h
index 11223fb..750e6ef 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;