GNSS Batching - Default implementation
Connecting GnssBatching from fused_location.h
through to the IGnss(Batching).hal
Test: Basic regular GNSS and batched GNSS
functional tests on Pixel
Change-Id: I3ff72c626acece891fd9e5ef2802b3489dac5dd2
diff --git a/gnss/1.0/default/Gnss.h b/gnss/1.0/default/Gnss.h
index 36947c1..63614fa 100644
--- a/gnss/1.0/default/Gnss.h
+++ b/gnss/1.0/default/Gnss.h
@@ -53,7 +53,6 @@
* IGnssCallback interface to be passed into the conventional implementation of the GNSS HAL.
*/
struct Gnss : public IGnss {
- // TODO: Add flp_device_t, either in ctor, or later attach?
Gnss(gps_device_t* gnss_device);
~Gnss();
@@ -109,11 +108,27 @@
static void setSystemInfoCb(const LegacyGnssSystemInfo* info);
/*
+ * Wakelock consolidation, only needed for dual use of a gps.h & fused_location.h HAL
+ *
+ * Ensures that if the last call from either legacy .h was to acquire a wakelock, that a
+ * wakelock is held. Otherwise releases it.
+ */
+ static void acquireWakelockFused();
+ static void releaseWakelockFused();
+
+ /*
* Holds function pointers to the callback methods.
*/
static GpsCallbacks sGnssCb;
private:
+ // for wakelock consolidation, see above
+ static void acquireWakelockGnss();
+ static void releaseWakelockGnss();
+ static void updateWakelock();
+ static bool sWakelockHeldGnss;
+ static bool sWakelockHeldFused;
+
sp<GnssXtra> mGnssXtraIface = nullptr;
sp<AGnssRil> mGnssRil = nullptr;
sp<GnssGeofencing> mGnssGeofencingIface = nullptr;