Write to Wake Lock FMQ
Write the number of WAKE_UP sensor events handled by the Sensor
Service to the Wake Lock FMQ. This allows the Sensors HAL to release
its wake lock for events once the Sensor Service holds a wake lock for
the events.
Bug: 111070257
Test: Compile, configured system to use sensors@2.0 and ensured that
a_sns_test received events
Test: Ensured device with sensors@1.0 receives events as expected
Change-Id: Ide091012bdaeb2e6a9fc4f5a43ddbb298dbf3416
diff --git a/services/sensorservice/SensorDevice.cpp b/services/sensorservice/SensorDevice.cpp
index f307297..ebc7eb1 100644
--- a/services/sensorservice/SensorDevice.cpp
+++ b/services/sensorservice/SensorDevice.cpp
@@ -361,6 +361,12 @@
return Return<void>();
}
+void SensorDevice::writeWakeLockHandled(uint32_t count) {
+ if (mSensors->supportsMessageQueues() && !mWakeLockQueue->write(&count)) {
+ ALOGW("Failed to write wake lock handled");
+ }
+}
+
void SensorDevice::autoDisable(void *ident, int handle) {
Mutex::Autolock _l(mLock);
ssize_t activationIndex = mActivationCount.indexOfKey(handle);