Verify mPollThread is joinable before detaching

am: 65945cfb15

Change-Id: Ia4c4ef1d4e30d8854ee95c9b0cdfb44ad2bb630a
This commit is contained in:
Anthony Stange
2019-07-15 17:50:17 -07:00
committed by android-build-merger

View File

@@ -29,7 +29,9 @@ void SensorsHidlEnvironmentBase::HidlSetUp() {
void SensorsHidlEnvironmentBase::HidlTearDown() {
mStopThread = true;
mPollThread.detach();
if (mPollThread.joinable()) {
mPollThread.detach();
}
}
void SensorsHidlEnvironmentBase::catEvents(std::vector<Event>* output) {