diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-18 21:34:07 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-18 21:34:07 +0000 |
commit | ad7bd6bc90b699eecf35b4055e14241c0d5360f1 (patch) | |
tree | 97ef1e25705eb3f9f1d1264f8488277ade077e73 | |
parent | 1dc935e0c7bc351bb50f5574bce3820db9d2828a (diff) | |
parent | 3500840b528f8e55dc4ac52b0a1b673358cd0ac1 (diff) | |
download | native-ad7bd6bc90b699eecf35b4055e14241c0d5360f1.tar.gz |
Merge cherrypicks of ['googleplex-android-review.googlesource.com/23677155'] into tm-platform-release.android-platform-13.0.0_r11
Change-Id: I91346a78016c0cf123a5b1b4f3246a55c883e214
-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 40061cde61..9f814f1c48 100644 --- a/libs/sensor/SensorManager.cpp +++ b/libs/sensor/SensorManager.cpp @@ -176,11 +176,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"); |