summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-14 17:33:06 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-14 17:33:06 +0000
commit0e1e60fa27aaaced1fc41bb2a252f45d6189f6f5 (patch)
tree55c1db9fb7c3cb2fcdb90a6aee6cc77cabce97d7
parentfae59560628b5310de984fbfdfaf971c85168eeb (diff)
parentc2ed49a70b52306ebbd519838dd3bcf41739dcef (diff)
downloadnative-android11-security-release.tar.gz
Change-Id: I9353d96be061757b7ba60535e8b14dace8424422
-rw-r--r--libs/sensor/SensorManager.cpp7
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");