summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Komsiyski <vladokom@google.com>2023-06-14 15:58:50 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2023-06-14 15:58:50 +0000
commit92745f7aebcb25584b97d3c29bc94148d03ad5db (patch)
tree05085877a581af994a4b7006d71d2b3410eb19af
parent094946bd8c1a8f205417a21755023118857950f7 (diff)
parent3b9574a68afb242d573f062ce8e0a99a452d5842 (diff)
downloadnative-92745f7aebcb25584b97d3c29bc94148d03ad5db.tar.gz
Merge "Handle runtime sensor events even if there are no real ones." into udc-dev
-rw-r--r--services/sensorservice/SensorService.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp
index 398d60242b..90d75414d6 100644
--- a/services/sensorservice/SensorService.cpp
+++ b/services/sensorservice/SensorService.cpp
@@ -1055,7 +1055,12 @@ bool SensorService::threadLoop() {
if (count < 0) {
if(count == DEAD_OBJECT && device.isReconnecting()) {
device.reconnect();
- continue;
+ // There are no "real" events at this point, but do not skip the rest of the loop
+ // if there are pending runtime events.
+ Mutex::Autolock _l(&mLock);
+ if (mRuntimeSensorEventQueue.empty()) {
+ continue;
+ }
} else {
ALOGE("sensor poll failed (%s)", strerror(-count));
break;