commit | f791476758be2f395f4170f7e3fbf279be40ab46 | [log] [tgz] |
---|---|---|
author | Vladimir Komsiyski <vladokom@google.com> | Wed Jun 14 18:10:40 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Jun 14 18:10:40 2023 +0000 |
tree | 11ee7a4948d4a52ca4912ae44a1d7d8351e5f6ba | |
parent | 741c044c4cb5c12dbce508596339c785c2f47e4d [diff] | |
parent | 1d46b4cde090564ad78b3ada6ea8e01ab546d6e8 [diff] |
Merge "Handle runtime sensor events even if there are no real ones." into udc-dev am: 92745f7aeb am: 744f71638e am: 1d46b4cde0 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/23658936 Change-Id: I505dd48896341a58dd45d6b0083de2f03751f1de 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;