Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2019c16 authored by Wally Yau's avatar Wally Yau
Browse files

Detach pollThread only if it is joinable

sensor HAL is not required for Android TV. Hence, ISensors returned
from getService() was null and pollThread was not associated with
any thread of execution.

Bug: 120910004
Test: run vts -m VtsHalSensorsV1_0Target
Change-Id: If16af7313ff7bb22e5ca16c03a0fee0b8d733335
parent eb73bff2
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -105,8 +105,10 @@ void SensorsHidlEnvironment::HidlTearDown() {
    if (stopThread) {
        *stopThread = true;
    }
    if (pollThread.joinable()) {
        pollThread.detach();
    }
}

void SensorsHidlEnvironment::resetHal() {
  // wait upto 100ms * 10 = 1s for hidl service.