diff options
| author | 2023-06-14 16:38:55 +0000 | |
|---|---|---|
| committer | 2023-06-14 16:38:55 +0000 | |
| commit | 744f71638e59fbf21ae00801fae1bb9771ca293c (patch) | |
| tree | 3892635297dc383ffeef9162d3d9c0628d39059c | |
| parent | c62388bf1208f8d3cc3c989d26c4aecaa2b78be0 (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: If776fee14704b51b654bff2c37d090d47dd693dd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | services/sensorservice/SensorService.cpp | 7 |
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; |