diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-14 17:33:06 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-14 17:33:06 +0000 |
commit | 0e1e60fa27aaaced1fc41bb2a252f45d6189f6f5 (patch) | |
tree | 55c1db9fb7c3cb2fcdb90a6aee6cc77cabce97d7 | |
parent | fae59560628b5310de984fbfdfaf971c85168eeb (diff) | |
parent | c2ed49a70b52306ebbd519838dd3bcf41739dcef (diff) | |
download | native-android11-security-release.tar.gz |
Merge cherrypicks of ['googleplex-android-review.googlesource.com/23677151'] into security-aosp-rvc-release.android-security-11.0.0_r76android-security-11.0.0_r75android-security-11.0.0_r74android-security-11.0.0_r73android-security-11.0.0_r72android-security-11.0.0_r71android11-security-release
Change-Id: I9353d96be061757b7ba60535e8b14dace8424422
-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"); |