diff options
Diffstat (limited to 'gnss/aidl/vts/gnss_hal_test.cpp')
-rw-r--r-- | gnss/aidl/vts/gnss_hal_test.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gnss/aidl/vts/gnss_hal_test.cpp b/gnss/aidl/vts/gnss_hal_test.cpp index 0e1218e40c..64e51c7d4a 100644 --- a/gnss/aidl/vts/gnss_hal_test.cpp +++ b/gnss/aidl/vts/gnss_hal_test.cpp @@ -107,6 +107,17 @@ void GnssHalTest::SetUpGnssCallback() { } } +void GnssHalTest::TearDown() { + GnssHalTestTemplate<IGnss_V2_1>::TearDown(); + if (aidl_gnss_hal_ != nullptr) { + aidl_gnss_hal_->close(); + aidl_gnss_hal_ = nullptr; + } + + // Set to nullptr to destruct the callback event queues and warn of any unprocessed events. + aidl_gnss_cb_ = nullptr; +} + void GnssHalTest::CheckLocation(const GnssLocation& location, bool check_speed) { Utils::checkLocation(location, check_speed, /* check_more_accuracies= */ true); } @@ -436,6 +447,7 @@ void GnssHalTest::collectMeasurementIntervals(const sp<GnssMeasurementCallbackAi const int numMeasurementEvents, const int timeoutSeconds, std::vector<int>& deltasMs) { + callback->gnss_data_cbq_.reset(); // throw away the initial measurements if any int64_t lastElapsedRealtimeMillis = 0; for (int i = 0; i < numMeasurementEvents; i++) { GnssData lastGnssData; |