GnssBatching API, port from Fused Location
New HAL APIs for Gnss location batches,
still to be connected (default implementation)
similarly to this aspect of fused_location.h,
initially as a single client system API.
Bug: 31974439
Test: Ensured it builds and runs GPS & FLP (in Test app & maps)
Change-Id: I27d3fd2cffad25039b006e60c4496a440dc86c13
diff --git a/gnss/1.0/default/Gnss.cpp b/gnss/1.0/default/Gnss.cpp
index 5e6e65d..28a1950 100644
--- a/gnss/1.0/default/Gnss.cpp
+++ b/gnss/1.0/default/Gnss.cpp
@@ -534,6 +534,23 @@
return mGnssDebug;
}
+Return<sp<IGnssBatching>> Gnss::getExtensionGnssBatching() {
+ if (mGnssIface == nullptr) {
+ ALOGE("%s: Gnss interface is unavailable", __func__);
+ } else {
+ // TODO(b/34133439): actually get an flpLocationIface
+ const FlpLocationInterface* flpLocationIface = nullptr;
+
+ if (flpLocationIface == nullptr) {
+ ALOGE("%s: GnssBatching interface is not implemented by HAL", __func__);
+ } else {
+ mGnssBatching = new GnssBatching(flpLocationIface);
+ }
+ }
+
+ return mGnssBatching;
+}
+
IGnss* HIDL_FETCH_IGnss(const char* hal) {
hw_module_t* module;
IGnss* iface = nullptr;