diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-17 19:38:38 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-17 19:38:38 +0000 |
commit | b99511985d9d2e8632ef7be39ec0e23f5fd36491 (patch) | |
tree | bdfabd6b9e939f7646b7047e4ed193320edb5d15 | |
parent | 054c435e2e7ec39d461f6a48544c4800acdfa7ac (diff) | |
parent | 7a9378a05f3f99a22978098e3d64379474d4ae8e (diff) | |
download | native-android11-platform-release.tar.gz |
Merge cherrypicks of ['googleplex-android-review.googlesource.com/23677156'] into rvc-platform-release.android-platform-11.0.0_r40android-platform-11.0.0_r39android-platform-11.0.0_r38android-platform-11.0.0_r37android-platform-11.0.0_r36android-platform-11.0.0_r35android-platform-11.0.0_r34android11-platform-release
Change-Id: I35be7abef7e5408bff421f9ff6552317156e05dc
-rw-r--r-- | libs/sensor/SensorManager.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libs/sensor/SensorManager.cpp b/libs/sensor/SensorManager.cpp index f5dd36adae..22adc93667 100644 --- a/libs/sensor/SensorManager.cpp +++ b/libs/sensor/SensorManager.cpp @@ -172,11 +172,8 @@ status_t SensorManager::assertStateLocked() { mSensors = mSensorServer->getSensorList(mOpPackageName); size_t count = mSensors.size(); - if (count == 0) { - ALOGE("Failed to get Sensor list"); - mSensorServer.clear(); - return UNKNOWN_ERROR; - } + // If count is 0, mSensorList will be non-null. This is old + // existing behavior and callers expect this. mSensorList = static_cast<Sensor const**>(malloc(count * sizeof(Sensor*))); LOG_ALWAYS_FATAL_IF(mSensorList == nullptr, "mSensorList NULL"); |