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: Id7fb72c42dc67f89ceef93d937241e1584b853e7
This commit is contained in:
parent
0260d7d1ee
commit
279a5ae37e
1 changed files with 2 additions and 0 deletions
|
@ -737,6 +737,8 @@ TEST_P(SensorsHidlTest, NoStaleEvents) {
|
|||
callback.waitForEvents(sensors, kFiveHundredMs + (5 * maxMinDelay));
|
||||
activateAllSensors(false);
|
||||
|
||||
getEnvironment()->unregisterCallback();
|
||||
|
||||
for (const SensorInfoType& sensor : sensors) {
|
||||
// Skip sensors that did not previously report an event
|
||||
if (lastEventTimestampMap.find(sensor.sensorHandle) == lastEventTimestampMap.end()) {
|
||||
|
|
Loading…
Reference in a new issue