summaryrefslogtreecommitdiff
path: root/thermal
diff options
context:
space:
mode:
authorWei Wang <wvw@google.com>2021-04-02 16:57:32 -0700
committerWei Wang <wvw@google.com>2021-04-03 00:00:22 +0000
commit197195fef1bf421bb9ef8635053aac1b453551db (patch)
tree06f240476cb5f379ee4dd3f187c2dbd04a3987a6 /thermal
parentbac4deb577d5eef75c3e87c848c1ead9e413c485 (diff)
downloadpixel-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.h2
-rw-r--r--thermal/thermal-helper.cpp6
-rw-r--r--thermal/thermal-helper.h2
-rw-r--r--thermal/utils/thermal_watcher.h2
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;