Add intervalMillis to IGnssMeasurement (hardware/interfaces)
Bug: 206670536
Test: atest VtsHalGnssTargetTest
Change-Id: I911fc3c0fd6010ddb20265e1551a7cb3b75216d7
diff --git a/gnss/aidl/default/GnssMeasurementInterface.cpp b/gnss/aidl/default/GnssMeasurementInterface.cpp
index 9e4f7c7..2c7241b 100644
--- a/gnss/aidl/default/GnssMeasurementInterface.cpp
+++ b/gnss/aidl/default/GnssMeasurementInterface.cpp
@@ -56,11 +56,29 @@
return ndk::ScopedAStatus::ok();
}
+ndk::ScopedAStatus GnssMeasurementInterface::setCallbackWithOptions(
+ const std::shared_ptr<IGnssMeasurementCallback>& callback, const Options& options) {
+ ALOGD("setCallbackWithOptions: fullTracking:%d, corrVec:%d, intervalMs:%d",
+ (int)options.enableFullTracking, (int)options.enableCorrVecOutputs, options.intervalMs);
+ std::unique_lock<std::mutex> lock(mMutex);
+ sCallback = callback;
+
+ if (mIsActive) {
+ ALOGW("GnssMeasurement callback already set. Resetting the callback...");
+ stop();
+ }
+ mMinIntervalMillis = options.intervalMs;
+ start(options.enableCorrVecOutputs);
+
+ return ndk::ScopedAStatus::ok();
+}
+
ndk::ScopedAStatus GnssMeasurementInterface::close() {
ALOGD("close");
stop();
std::unique_lock<std::mutex> lock(mMutex);
sCallback = nullptr;
+ mMinIntervalMillis = 1000;
return ndk::ScopedAStatus::ok();
}