diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-14 17:33:03 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-14 17:33:03 +0000 |
commit | 686a75e8cd7a20c613dca5fec9d5a7877d360bac (patch) | |
tree | a72f2780a0496cb85bef2e7d7ee5df3752c23e72 | |
parent | 3095fe3065a2e9d8b9988846f66e561e469cccbb (diff) | |
parent | e8333e03f124e6fea269bfb5f8975a3fa5e3c1fc (diff) | |
download | native-android-security-13.0.0_r9.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.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"); |