summaryrefslogtreecommitdiff
path: root/thermal/thermal-helper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'thermal/thermal-helper.cpp')
-rw-r--r--thermal/thermal-helper.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/thermal/thermal-helper.cpp b/thermal/thermal-helper.cpp
index 26dcd314..7b341fdf 100644
--- a/thermal/thermal-helper.cpp
+++ b/thermal/thermal-helper.cpp
@@ -53,6 +53,7 @@ constexpr std::string_view kCoolingDeviceCurStateSuffix("cur_state");
constexpr std::string_view kConfigProperty("vendor.thermal.config");
constexpr std::string_view kConfigDefaultFileName("thermal_info_config.json");
constexpr std::string_view kThermalGenlProperty("persist.vendor.enable.thermal.genl");
+constexpr std::string_view kThermalDisabledProperty("vendor.disable.thermal.control");
namespace {
using android::base::StringPrintf;
@@ -323,6 +324,19 @@ ThermalHelper::ThermalHelper(const NotificationCallback &cb)
LOG(FATAL) << "ThermalHAL could not be initialized properly.";
}
+ const bool thermal_throttling_disabled =
+ android::base::GetBoolProperty(kThermalDisabledProperty.data(), false);
+
+ if (thermal_throttling_disabled) {
+ LOG(INFO) << kThermalDisabledProperty.data() << " is true";
+ for (const auto &cdev_pair : cooling_device_info_map_) {
+ if (cooling_devices_.writeCdevFile(cdev_pair.first, std::to_string(0))) {
+ LOG(INFO) << "Successfully clear cdev " << cdev_pair.first << " to 0";
+ }
+ }
+ return;
+ }
+
const bool thermal_genl_enabled =
android::base::GetBoolProperty(kThermalGenlProperty.data(), false);