mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 15:58:43 +00:00
Merge "Stop Wake Lock thread if it is running"
This commit is contained in:
committed by
Android (Google) Code Review
commit
bc91e1388c
@@ -87,6 +87,17 @@ Return<Result> Sensors::initialize(
|
||||
const sp<ISensorsCallback>& sensorsCallback) {
|
||||
Result result = Result::OK;
|
||||
|
||||
// Ensure that all sensors are disabled
|
||||
for (auto sensor : mSensors) {
|
||||
sensor.second->activate(false /* enable */);
|
||||
}
|
||||
|
||||
// Stop the Wake Lock thread if it is currently running
|
||||
if (mReadWakeLockQueueRun.load()) {
|
||||
mReadWakeLockQueueRun = false;
|
||||
mWakeLockThread.join();
|
||||
}
|
||||
|
||||
// Save a reference to the callback
|
||||
mCallback = sensorsCallback;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user