Adds an empty chreGnssConfigurePassiveLocationListener impl
Bug: 174590024
Test: Compile
Change-Id: I08332c42c6108a9174edff4c6bb8ef46a4c78fd7
diff --git a/core/gnss_manager.cc b/core/gnss_manager.cc
index 7808482..e9ba461 100644
--- a/core/gnss_manager.cc
+++ b/core/gnss_manager.cc
@@ -98,6 +98,12 @@
SystemCallbackType::GnssRequestResyncEvent, nullptr /* data */, callback);
}
+bool GnssManager::configurePassiveLocationListener(Nanoapp * /* nanoapp */,
+ bool /* enable */) {
+ // TODO(b/174590024): Implement this
+ return false;
+}
+
void GnssManager::handleRequestStateResyncCallbackSync() {
mLocationSession.handleRequestStateResyncCallbackSync();
mMeasurementSession.handleRequestStateResyncCallbackSync();
diff --git a/core/include/chre/core/gnss_manager.h b/core/include/chre/core/gnss_manager.h
index 8fbbb43..c66827d 100644
--- a/core/include/chre/core/gnss_manager.h
+++ b/core/include/chre/core/gnss_manager.h
@@ -416,6 +416,15 @@
void handleRequestStateResyncCallbackSync();
/**
+ * @param nanoapp The nanoapp invoking
+ * chreGnssConfigurePassiveLocationListener.
+ * @param enable true to enable the configuration.
+ *
+ * @return true if the configuration succeeded.
+ */
+ bool configurePassiveLocationListener(Nanoapp *nanoapp, bool enable);
+
+ /**
* Prints state in a string buffer. Must only be called from the context of
* the main CHRE thread.
*
diff --git a/platform/shared/chre_api_gnss.cc b/platform/shared/chre_api_gnss.cc
index c4617f8..98a9453 100644
--- a/platform/shared/chre_api_gnss.cc
+++ b/platform/shared/chre_api_gnss.cc
@@ -86,3 +86,14 @@
return false;
#endif // CHRE_GNSS_SUPPORT_ENABLED
}
+
+DLL_EXPORT bool chreGnssConfigurePassiveLocationListener(bool enable) {
+#ifdef CHRE_GNSS_SUPPORT_ENABLED
+ chre::Nanoapp *nanoapp = EventLoopManager::validateChreApiCall(__func__);
+ return chre::EventLoopManagerSingleton::get()
+ ->getGnssManager()
+ .configurePassiveLocationListener(nanoapp, enable);
+#else
+ return false;
+#endif // CHRE_GNSS_SUPPORT_ENABLED
+}