mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Add the missing unregisterCallback call
The sensor reading thread continues producing event and refers to the already destroyed callback object which causes a crash in SensorsHidlEnvironmentBase::addEvent. Bug: 153754380 Test: atest VtsHalSensorsV2_0TargetTest Signed-off-by: Roman Kiryanov <rkir@google.com> Change-Id: I3017afe670e5a53d0d7444b3d5b34ba34f3567e3 Merged-In: Id7fb72c42dc67f89ceef93d937241e1584b853e7
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user