summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-14 17:33:03 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-14 17:33:03 +0000
commit686a75e8cd7a20c613dca5fec9d5a7877d360bac (patch)
treea72f2780a0496cb85bef2e7d7ee5df3752c23e72
parent3095fe3065a2e9d8b9988846f66e561e469cccbb (diff)
parente8333e03f124e6fea269bfb5f8975a3fa5e3c1fc (diff)
downloadnative-686a75e8cd7a20c613dca5fec9d5a7877d360bac.tar.gz
Merge cherrypicks of ['googleplex-android-review.googlesource.com/23677150'] into security-aosp-tm-release.android-security-13.0.0_r9
Change-Id: Id44c6221641b3332df5fcec00df509c546180dd0
-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 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");