diff options
author | Wei Wang <wvw@google.com> | 2021-04-02 16:57:32 -0700 |
---|---|---|
committer | Wei Wang <wvw@google.com> | 2021-04-03 00:00:22 +0000 |
commit | 197195fef1bf421bb9ef8635053aac1b453551db (patch) | |
tree | 06f240476cb5f379ee4dd3f187c2dbd04a3987a6 /thermal | |
parent | bac4deb577d5eef75c3e87c848c1ead9e413c485 (diff) | |
download | pixel-197195fef1bf421bb9ef8635053aac1b453551db.tar.gz |
thermal: do not abort if cooling device failed to parse
Test: boot with maxcpus=4
Bug: 184318845
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: I524cf297fa9885a6523d79515c4a9ebe6aebdffb
Diffstat (limited to 'thermal')
-rw-r--r-- | thermal/Thermal.h | 2 | ||||
-rw-r--r-- | thermal/thermal-helper.cpp | 6 | ||||
-rw-r--r-- | thermal/thermal-helper.h | 2 | ||||
-rw-r--r-- | thermal/utils/thermal_watcher.h | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/thermal/Thermal.h b/thermal/Thermal.h index 1b7bba6a..8f26e971 100644 --- a/thermal/Thermal.h +++ b/thermal/Thermal.h @@ -40,7 +40,7 @@ using ::android::hardware::thermal::V2_0::IThermalChangedCallback; struct CallbackSetting { CallbackSetting(sp<IThermalChangedCallback> callback, bool is_filter_type, TemperatureType_2_0 type) - : callback(callback), is_filter_type(is_filter_type), type(type) {} + : callback(std::move(callback)), is_filter_type(is_filter_type), type(type) {} sp<IThermalChangedCallback> callback; bool is_filter_type; TemperatureType_2_0 type; diff --git a/thermal/thermal-helper.cpp b/thermal/thermal-helper.cpp index 7b341fdf..a966a661 100644 --- a/thermal/thermal-helper.cpp +++ b/thermal/thermal-helper.cpp @@ -757,10 +757,10 @@ bool ThermalHelper::initializeCoolingDevices(const std::map<std::string, std::st } } - if (cooling_device_info_map_.size() * 2 == cooling_devices_.getNumThermalFiles()) { - return true; + if (cooling_device_info_map_.size() * 2 != cooling_devices_.getNumThermalFiles()) { + LOG(ERROR) << "Some cooling device can not be initialized"; } - return false; + return true; } void ThermalHelper::setMinTimeout(SensorInfo *sensor_info) { diff --git a/thermal/thermal-helper.h b/thermal/thermal-helper.h index 51a52b56..052040c5 100644 --- a/thermal/thermal-helper.h +++ b/thermal/thermal-helper.h @@ -108,7 +108,7 @@ class PowerHalService { class ThermalHelper { public: - ThermalHelper(const NotificationCallback &cb); + explicit ThermalHelper(const NotificationCallback &cb); ~ThermalHelper() = default; bool fillTemperatures(hidl_vec<Temperature_1_0> *temperatures) const; diff --git a/thermal/utils/thermal_watcher.h b/thermal/utils/thermal_watcher.h index 17ba566c..48bf7dda 100644 --- a/thermal/utils/thermal_watcher.h +++ b/thermal/utils/thermal_watcher.h @@ -45,7 +45,7 @@ using WatcherCallback = std::function<std::chrono::milliseconds(const std::set<s // A helper class for monitoring thermal files changes. class ThermalWatcher : public ::android::Thread { public: - ThermalWatcher(const WatcherCallback &cb) + explicit ThermalWatcher(const WatcherCallback &cb) : Thread(false), cb_(cb), looper_(new Looper(true)) {} ~ThermalWatcher() = default; |