diff --git a/sensors/2.0/vts/functional/VtsHalSensorsV2_0TargetTest.cpp b/sensors/2.0/vts/functional/VtsHalSensorsV2_0TargetTest.cpp index 540529d8eb..d0ebe4d36f 100644 --- a/sensors/2.0/vts/functional/VtsHalSensorsV2_0TargetTest.cpp +++ b/sensors/2.0/vts/functional/VtsHalSensorsV2_0TargetTest.cpp @@ -898,6 +898,8 @@ TEST_P(SensorsHidlTest, NoStaleEvents) { callback.waitForEvents(sensors, kFiveHundredMs + (5 * maxMinDelay)); activateAllSensors(false); + getEnvironment()->unregisterCallback(); + for (const SensorInfo& sensor : sensors) { // Skip sensors that did not previously report an event if (lastEventTimestampMap.find(sensor.sensorHandle) == lastEventTimestampMap.end()) {