diff options
author | Kame(TeYuan) Wang <kamewang@google.com> | 2023-01-04 09:34:26 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2023-01-04 09:34:26 +0000 |
commit | 0aaebb34f1bf6deaae986d5063cf28b46b22fc58 (patch) | |
tree | ad5712b8813ebb2728918c80b504ae5fee5198e8 | |
parent | ad9fb0e659e0fff33b5d45bdc5ab5f8dcf0c7d9e (diff) | |
parent | 755820efc09f8711065ff9afa9d97b4741fe80e1 (diff) | |
download | pixel-0aaebb34f1bf6deaae986d5063cf28b46b22fc58.tar.gz |
Merge "thermal: add sensor_status_check when reading the temperature" into tm-qpr-dev
-rw-r--r-- | thermal/thermal-helper.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/thermal/thermal-helper.cpp b/thermal/thermal-helper.cpp index 84361271..27fa3b5f 100644 --- a/thermal/thermal-helper.cpp +++ b/thermal/thermal-helper.cpp @@ -809,6 +809,10 @@ bool ThermalHelper::readThermalSensor(std::string_view sensor_name, float *temp, boot_clock::time_point now = boot_clock::now(); ATRACE_NAME(StringPrintf("ThermalHelper::readThermalSensor - %s", sensor_name.data()).c_str()); + if (!(sensor_info_map_.count(sensor_name.data()) && + sensor_status_map_.count(sensor_name.data()))) { + return false; + } const auto &sensor_info = sensor_info_map_.at(sensor_name.data()); auto &sensor_status = sensor_status_map_.at(sensor_name.data()); |