thermal: Apply special thermal config for wingboard/MLB device
- Add new thermal config for wingboard without dependency on: - chg_mdis - inner_brightness zone - Update init_thermal_config to check if wingboard, if so use the custom config Bug: 335005016 Test: Build and boot to verify thermal logs Change-Id: I58b9517de2acdfca0e371ce1a5dfe486eb6c15ee
This commit is contained in:
parent
00df547797
commit
79277084b0
3 changed files with 816 additions and 1 deletions
|
@ -19,7 +19,17 @@
|
|||
#include <string>
|
||||
|
||||
namespace {
|
||||
constexpr std::string_view kWingBoardHwId("0x00060603000100020000000000000000");
|
||||
using android::base::GetProperty;
|
||||
bool useThermalWingBoardConfig() {
|
||||
const auto cdt_hwid = GetProperty("ro.boot.cdt_hwid", "");
|
||||
if (cdt_hwid == kWingBoardHwId) {
|
||||
LOG(INFO) << "Using wingboard thermal config as found cdt_hwid " << cdt_hwid;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool useThermalBackupConfig() {
|
||||
const auto panel_drv = GetProperty("ro.boot.primary_panel_drv", "");
|
||||
const auto is_panel_available = (panel_drv.find("panel-google-ct3a") != std::string::npos) ||
|
||||
|
@ -39,11 +49,18 @@ bool useThermalBackupConfig() {
|
|||
} // namespace
|
||||
|
||||
int main() {
|
||||
if (useThermalBackupConfig()) {
|
||||
if (useThermalWingBoardConfig()) {
|
||||
if (!android::base::SetProperty("vendor.thermal.config",
|
||||
"thermal_info_config_wingboard.json")) {
|
||||
LOG(FATAL) << "Failed to set property vendor.thermal.config to "
|
||||
"thermal_info_config_wingboard.";
|
||||
}
|
||||
} else if (useThermalBackupConfig()) {
|
||||
if (!android::base::SetProperty("vendor.thermal.config",
|
||||
"thermal_info_config_backup.json")) {
|
||||
LOG(FATAL) << "Failed to set property vendor.thermal.config to "
|
||||
"thermal_info_config_backup.";
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue