commit | 4d99bf3aaba33f13222df7893d95cc50a614c1a7 | [log] [tgz] |
---|---|---|
author | Vladimir Komsiyski <vladokom@google.com> | Wed Jun 14 16:37:16 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Jun 14 16:37:16 2023 +0000 |
tree | d8799c938e1619467c0f7624776934b24d8345ce | |
parent | 629861aebc8fcdb4e96c2f9c1b71ef34b359ab59 [diff] | |
parent | 92745f7aebcb25584b97d3c29bc94148d03ad5db [diff] |
Merge "Handle runtime sensor events even if there are no real ones." into udc-dev am: 92745f7aeb Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/23658936 Change-Id: I78e34a9ee052959f8fc5bd833bc59dbdfe1dc005 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp index 398d602..90d7541 100644 --- a/services/sensorservice/SensorService.cpp +++ b/services/sensorservice/SensorService.cpp
@@ -1055,7 +1055,12 @@ 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;