cc_binary {
- name: "android.hardware.thermal-service.pixel",
+ name: "android.hardware.thermal-service.samsung",
srcs: [
"service.cpp",
"Thermal.cpp",
vendor: true,
relative_install_path: "hw",
vintf_fragments: [
- "android.hardware.thermal-service.pixel.xml"
+ "android.hardware.thermal-service.samsung.xml"
],
init_rc: [
- "android.hardware.thermal-service.pixel.rc",
+ "android.hardware.thermal-service.samsung.rc",
],
shared_libs: [
"libbase",
}
sh_binary {
- name: "thermal_logd",
+ name: "thermal_logd.samsung",
src: "init.thermal.logging.sh",
vendor: true,
init_rc: [
- "pixel-thermal-logd.rc",
+ "samsung-thermal-logd.rc",
],
}
sh_binary {
- name: "thermal_symlinks",
+ name: "thermal_symlinks.samsung",
src: "init.thermal.symlinks.sh",
vendor: true,
init_rc: [
- "pixel-thermal-symlinks.rc",
+ "samsung-thermal-symlinks.rc",
],
}
+++ /dev/null
-on property:vendor.thermal.link_ready=1
- # queue the trigger to start thermal-hal and continue execute
- # per-device thermal setup "on property:vendor.thermal.link_ready=1"
- trigger enable-thermal-hal
-
-on enable-thermal-hal
- restart vendor.thermal-hal
-
-service vendor.thermal-hal /vendor/bin/hw/android.hardware.thermal-service.pixel
- class hal
- user system
- group system
- priority -20
- disabled
+++ /dev/null
-<manifest version="1.0" type="device">
- <hal format="aidl">
- <name>android.hardware.thermal</name>
- <version>1</version>
- <fqname>IThermal/default</fqname>
- </hal>
-</manifest>
--- /dev/null
+on property:vendor.thermal.link_ready=1
+ # queue the trigger to start thermal-hal and continue execute
+ # per-device thermal setup "on property:vendor.thermal.link_ready=1"
+ trigger enable-thermal-hal
+
+on enable-thermal-hal
+ restart vendor.thermal-hal
+
+service vendor.thermal-hal /vendor/bin/hw/android.hardware.thermal-service.samsung
+ class hal
+ user system
+ group system
+ priority -20
+ disabled
--- /dev/null
+<manifest version="1.0" type="device">
+ <hal format="aidl">
+ <name>android.hardware.thermal</name>
+ <version>1</version>
+ <fqname>IThermal/default</fqname>
+ </hal>
+</manifest>
+++ /dev/null
-on property:persist.vendor.log.thermal=1
- start vendor.thermal.logd
-
-on property:persist.vendor.log.thermal=0
- stop vendor.thermal.logd
-
-on property:persist.vendor.log.thermal=1 && property:persist.vendor.log.thermal.interval=*
- restart vendor.thermal.logd
-
-service vendor.thermal.logd /vendor/bin/thermal_logd ${persist.vendor.log.thermal.interval:-5}
- class main
- user root
- group root system
- disabled
-
-# Switch thermal protection for Pixels
-on property:persist.vendor.disable.thermal.control=*
- setprop vendor.disable.thermal.control ${persist.vendor.disable.thermal.control}
-
-on property:persist.vendor.disable.thermalhal.control=*
- setprop vendor.disable.thermalhal.control ${persist.vendor.disable.thermalhal.control}
-
-on property:persist.vendor.disable.usb.overheat.mitigation=*
- setprop vendor.disable.usb.overheat.mitigation.control ${persist.vendor.disable.usb.overheat.mitigation}
-
-on property:persist.vendor.disable.bcl.control=*
- setprop vendor.disable.bcl.control ${persist.vendor.disable.bcl.control}
-
-on property:vendor.disable.thermalhal.control=* && property:vendor.thermal.link_ready=1
- restart vendor.thermal-hal
-
-on property:vendor.disable.thermal.control=1 && property:vendor.thermal.link_ready=1
- # common
- stop vendor.thermal-engine
- setprop vendor.disable.thermalhal.control 1
- # sdm845
- write /dev/thermal/tz-by-name/quiet-therm-adc/mode disabled
- write /dev/thermal/tz-by-name/quiet-therm-monitor/mode disabled
- write /dev/thermal/tz-by-name/fps-therm-adc/mode disabled
- write /dev/thermal/tz-by-name/fps-therm-monitor/mode disabled
- # sdm670
- write /dev/thermal/tz-by-name/mb-therm-adc/mode disabled
- write /dev/thermal/tz-by-name/mb-therm-monitor/mode disabled
- # sm8150
- write /dev/thermal/tz-by-name/sdm-therm/mode disabled
- write /dev/thermal/tz-by-name/sdm-therm-monitor/mode disabled
- # sm7150
- write /dev/thermal/tz-by-name/skin-therm-adc/mode disabled
- write /dev/thermal/tz-by-name/skin-therm-monitor/mode disabled
- # sm7250
- write /dev/thermal/tz-by-name/skin-therm/emul_temp 25000
- write /dev/thermal/tz-by-name/skin-therm/mode disabled
- write /dev/thermal/tz-by-name/skin-virt/emul_temp 25000
- write /dev/thermal/tz-by-name/skin-virt/mode disabled
- write /dev/thermal/tz-by-name/skin-therm-cpu/emul_temp 25000
- write /dev/thermal/tz-by-name/skin-therm-cpu/mode disabled
- write /dev/thermal/tz-by-name/skin-virt-cpu/emul_temp 25000
- write /dev/thermal/tz-by-name/skin-virt-cpu/mode disabled
- write /dev/thermal/tz-by-name/skin-therm-monitor/emul_temp 25000
- write /dev/thermal/tz-by-name/skin-therm-monitor/mode disabled
- write /dev/thermal/tz-by-name/skin-virt-monitor/emul_temp 25000
- write /dev/thermal/tz-by-name/skin-virt-monitor/mode disabled
- write /dev/thermal/tz-by-name/panel-audio-therm/emul_temp 25000
- write /dev/thermal/tz-by-name/panel-audio-therm/mode disabled
- write /dev/thermal/tz-by-name/cellular-emergency/emul_temp 25000
- write /dev/thermal/tz-by-name/cellular-emergency/mode disabled
- write /dev/thermal/tz-by-name/sdm-therm/emul_temp 25000
- write /dev/thermal/tz-by-name/sdm-therm/mode disabled
- write /dev/thermal/tz-by-name/charger-therm/emul_temp 25000
- write /dev/thermal/tz-by-name/charger-therm/mode disabled
- # P21
- write /dev/thermal/tz-by-name/disp_therm/mode disabled
-
-on property:vendor.disable.thermal.control=0 && property:vendor.thermal.link_ready=1
- # common
- start vendor.thermal-engine
- setprop vendor.disable.thermalhal.control 0
- # sdm845
- write /dev/thermal/tz-by-name/quiet-therm-adc/mode enabled
- write /dev/thermal/tz-by-name/quiet-therm-monitor/mode enabled
- write /dev/thermal/tz-by-name/fps-therm-adc/mode enabled
- write /dev/thermal/tz-by-name/fps-therm-monitor/mode enabled
- # sdm670
- write /dev/thermal/tz-by-name/mb-therm-adc/mode enabled
- write /dev/thermal/tz-by-name/mb-therm-monitor/mode enabled
- # sm8150
- write /dev/thermal/tz-by-name/sdm-therm/mode enabled
- write /dev/thermal/tz-by-name/sdm-therm-monitor/mode enabled
- # sm7150
- write /dev/thermal/tz-by-name/skin-therm-adc/mode enabled
- write /dev/thermal/tz-by-name/skin-therm-monitor/mode enabled
- # sm7250
- write /dev/thermal/tz-by-name/skin-therm/emul_temp 0
- write /dev/thermal/tz-by-name/skin-therm/mode enabled
- write /dev/thermal/tz-by-name/skin-virt/emul_temp 0
- write /dev/thermal/tz-by-name/skin-virt/mode enabled
- write /dev/thermal/tz-by-name/skin-therm-cpu/emul_temp 0
- write /dev/thermal/tz-by-name/skin-therm-cpu/mode enabled
- write /dev/thermal/tz-by-name/skin-virt-cpu/emul_temp 0
- write /dev/thermal/tz-by-name/skin-virt-cpu/mode enabled
- write /dev/thermal/tz-by-name/skin-therm-monitor/emul_temp 0
- write /dev/thermal/tz-by-name/skin-therm-monitor/mode enabled
- write /dev/thermal/tz-by-name/skin-virt-monitor/emul_temp 0
- write /dev/thermal/tz-by-name/skin-virt-monitor/mode enabled
- write /dev/thermal/tz-by-name/panel-audio-therm/emul_temp 0
- write /dev/thermal/tz-by-name/panel-audio-therm/mode enabled
- write /dev/thermal/tz-by-name/cellular-emergency/emul_temp 0
- write /dev/thermal/tz-by-name/cellular-emergency/mode enabled
- write /dev/thermal/tz-by-name/sdm-therm/emul_temp 0
- write /dev/thermal/tz-by-name/sdm-therm/mode enabled
- write /dev/thermal/tz-by-name/charger-therm/emul_temp 0
- write /dev/thermal/tz-by-name/charger-therm/mode enabled
- # P21
- write /dev/thermal/tz-by-name/disp_therm/mode enabled
-
-# Toggle BCL control
-on property:vendor.disable.bcl.control=1
- write /dev/thermal/tz-by-name/soc/mode disabled
-
-on property:vendor.disable.bcl.control=0
- write /dev/thermal/tz-by-name/soc/mode enabled
-
-# Switch USB port overheat protection
-on property:vendor.disable.usb.overheat.mitigation.control=1
- write /sys/module/overheat_mitigation/parameters/enable 0
- write /dev/thermal/tz-by-name/usb_pwr_therm2/emul_temp 25000
-
-on property:vendor.disable.usb.overheat.mitigation.control=0
- write /sys/module/overheat_mitigation/parameters/enable 1
- write /dev/thermal/tz-by-name/usb_pwr_therm2/emul_temp 0
+++ /dev/null
-on boot
- mkdir /dev/thermal 0750 system system
- mkdir /dev/thermal/tz-by-name 0750 system system
- mkdir /dev/thermal/cdev-by-name 0750 system system
- start vendor.thermal.symlinks
-
-service vendor.thermal.symlinks /vendor/bin/thermal_symlinks
- user system
- group system
- oneshot
- disabled
--- /dev/null
+on property:persist.vendor.log.thermal=1
+ start vendor.thermal.logd
+
+on property:persist.vendor.log.thermal=0
+ stop vendor.thermal.logd
+
+on property:persist.vendor.log.thermal=1 && property:persist.vendor.log.thermal.interval=*
+ restart vendor.thermal.logd
+
+service vendor.thermal.logd /vendor/bin/thermal_logd.samsung ${persist.vendor.log.thermal.interval:-5}
+ class main
+ user root
+ group root system
+ disabled
+
+# Switch thermal protection for Pixels
+on property:persist.vendor.disable.thermal.control=*
+ setprop vendor.disable.thermal.control ${persist.vendor.disable.thermal.control}
+
+on property:persist.vendor.disable.thermalhal.control=*
+ setprop vendor.disable.thermalhal.control ${persist.vendor.disable.thermalhal.control}
+
+on property:persist.vendor.disable.usb.overheat.mitigation=*
+ setprop vendor.disable.usb.overheat.mitigation.control ${persist.vendor.disable.usb.overheat.mitigation}
+
+on property:persist.vendor.disable.bcl.control=*
+ setprop vendor.disable.bcl.control ${persist.vendor.disable.bcl.control}
+
+on property:vendor.disable.thermalhal.control=* && property:vendor.thermal.link_ready=1
+ restart vendor.thermal-hal
+
+on property:vendor.disable.thermal.control=1 && property:vendor.thermal.link_ready=1
+ # common
+ stop vendor.thermal-engine
+ setprop vendor.disable.thermalhal.control 1
+ # sdm845
+ write /dev/thermal/tz-by-name/quiet-therm-adc/mode disabled
+ write /dev/thermal/tz-by-name/quiet-therm-monitor/mode disabled
+ write /dev/thermal/tz-by-name/fps-therm-adc/mode disabled
+ write /dev/thermal/tz-by-name/fps-therm-monitor/mode disabled
+ # sdm670
+ write /dev/thermal/tz-by-name/mb-therm-adc/mode disabled
+ write /dev/thermal/tz-by-name/mb-therm-monitor/mode disabled
+ # sm8150
+ write /dev/thermal/tz-by-name/sdm-therm/mode disabled
+ write /dev/thermal/tz-by-name/sdm-therm-monitor/mode disabled
+ # sm7150
+ write /dev/thermal/tz-by-name/skin-therm-adc/mode disabled
+ write /dev/thermal/tz-by-name/skin-therm-monitor/mode disabled
+ # sm7250
+ write /dev/thermal/tz-by-name/skin-therm/emul_temp 25000
+ write /dev/thermal/tz-by-name/skin-therm/mode disabled
+ write /dev/thermal/tz-by-name/skin-virt/emul_temp 25000
+ write /dev/thermal/tz-by-name/skin-virt/mode disabled
+ write /dev/thermal/tz-by-name/skin-therm-cpu/emul_temp 25000
+ write /dev/thermal/tz-by-name/skin-therm-cpu/mode disabled
+ write /dev/thermal/tz-by-name/skin-virt-cpu/emul_temp 25000
+ write /dev/thermal/tz-by-name/skin-virt-cpu/mode disabled
+ write /dev/thermal/tz-by-name/skin-therm-monitor/emul_temp 25000
+ write /dev/thermal/tz-by-name/skin-therm-monitor/mode disabled
+ write /dev/thermal/tz-by-name/skin-virt-monitor/emul_temp 25000
+ write /dev/thermal/tz-by-name/skin-virt-monitor/mode disabled
+ write /dev/thermal/tz-by-name/panel-audio-therm/emul_temp 25000
+ write /dev/thermal/tz-by-name/panel-audio-therm/mode disabled
+ write /dev/thermal/tz-by-name/cellular-emergency/emul_temp 25000
+ write /dev/thermal/tz-by-name/cellular-emergency/mode disabled
+ write /dev/thermal/tz-by-name/sdm-therm/emul_temp 25000
+ write /dev/thermal/tz-by-name/sdm-therm/mode disabled
+ write /dev/thermal/tz-by-name/charger-therm/emul_temp 25000
+ write /dev/thermal/tz-by-name/charger-therm/mode disabled
+ # P21
+ write /dev/thermal/tz-by-name/disp_therm/mode disabled
+
+on property:vendor.disable.thermal.control=0 && property:vendor.thermal.link_ready=1
+ # common
+ start vendor.thermal-engine
+ setprop vendor.disable.thermalhal.control 0
+ # sdm845
+ write /dev/thermal/tz-by-name/quiet-therm-adc/mode enabled
+ write /dev/thermal/tz-by-name/quiet-therm-monitor/mode enabled
+ write /dev/thermal/tz-by-name/fps-therm-adc/mode enabled
+ write /dev/thermal/tz-by-name/fps-therm-monitor/mode enabled
+ # sdm670
+ write /dev/thermal/tz-by-name/mb-therm-adc/mode enabled
+ write /dev/thermal/tz-by-name/mb-therm-monitor/mode enabled
+ # sm8150
+ write /dev/thermal/tz-by-name/sdm-therm/mode enabled
+ write /dev/thermal/tz-by-name/sdm-therm-monitor/mode enabled
+ # sm7150
+ write /dev/thermal/tz-by-name/skin-therm-adc/mode enabled
+ write /dev/thermal/tz-by-name/skin-therm-monitor/mode enabled
+ # sm7250
+ write /dev/thermal/tz-by-name/skin-therm/emul_temp 0
+ write /dev/thermal/tz-by-name/skin-therm/mode enabled
+ write /dev/thermal/tz-by-name/skin-virt/emul_temp 0
+ write /dev/thermal/tz-by-name/skin-virt/mode enabled
+ write /dev/thermal/tz-by-name/skin-therm-cpu/emul_temp 0
+ write /dev/thermal/tz-by-name/skin-therm-cpu/mode enabled
+ write /dev/thermal/tz-by-name/skin-virt-cpu/emul_temp 0
+ write /dev/thermal/tz-by-name/skin-virt-cpu/mode enabled
+ write /dev/thermal/tz-by-name/skin-therm-monitor/emul_temp 0
+ write /dev/thermal/tz-by-name/skin-therm-monitor/mode enabled
+ write /dev/thermal/tz-by-name/skin-virt-monitor/emul_temp 0
+ write /dev/thermal/tz-by-name/skin-virt-monitor/mode enabled
+ write /dev/thermal/tz-by-name/panel-audio-therm/emul_temp 0
+ write /dev/thermal/tz-by-name/panel-audio-therm/mode enabled
+ write /dev/thermal/tz-by-name/cellular-emergency/emul_temp 0
+ write /dev/thermal/tz-by-name/cellular-emergency/mode enabled
+ write /dev/thermal/tz-by-name/sdm-therm/emul_temp 0
+ write /dev/thermal/tz-by-name/sdm-therm/mode enabled
+ write /dev/thermal/tz-by-name/charger-therm/emul_temp 0
+ write /dev/thermal/tz-by-name/charger-therm/mode enabled
+ # P21
+ write /dev/thermal/tz-by-name/disp_therm/mode enabled
+
+# Toggle BCL control
+on property:vendor.disable.bcl.control=1
+ write /dev/thermal/tz-by-name/soc/mode disabled
+
+on property:vendor.disable.bcl.control=0
+ write /dev/thermal/tz-by-name/soc/mode enabled
+
+# Switch USB port overheat protection
+on property:vendor.disable.usb.overheat.mitigation.control=1
+ write /sys/module/overheat_mitigation/parameters/enable 0
+ write /dev/thermal/tz-by-name/usb_pwr_therm2/emul_temp 25000
+
+on property:vendor.disable.usb.overheat.mitigation.control=0
+ write /sys/module/overheat_mitigation/parameters/enable 1
+ write /dev/thermal/tz-by-name/usb_pwr_therm2/emul_temp 0
--- /dev/null
+on boot
+ mkdir /dev/thermal 0750 system system
+ mkdir /dev/thermal/tz-by-name 0750 system system
+ mkdir /dev/thermal/cdev-by-name 0750 system system
+ start vendor.thermal.symlinks
+
+service vendor.thermal.symlinks /vendor/bin/thermal_symlinks.samsung
+ user system
+ group system
+ oneshot
+ disabled
#include "Thermal.h"
-constexpr std::string_view kThermalLogTag("pixel-thermal");
+constexpr std::string_view kThermalLogTag("samsung-thermal");
using ::android::OK;
using ::android::status_t;
auto svc = ndk::SharedRefBase::make<Thermal>();
const auto svcName = std::string() + svc->descriptor + "/" + THERMAL_INSTANCE_NAME;
- LOG(INFO) << "Pixel Thermal AIDL Service starting..." + svcName;
+ LOG(INFO) << "Samsung Thermal AIDL Service starting..." + svcName;
ABinderProcess_setThreadPoolMaxThreadCount(0);
auto svcBinder = svc->asBinder();
binder_status_t status = AServiceManager_addService(svcBinder.get(), svcName.c_str());
if (status != STATUS_OK) {
- LOG(ERROR) << "Pixel Thermal AIDL Service failed to start: " << status << ".";
+ LOG(ERROR) << "Samsung Thermal AIDL Service failed to start: " << status << ".";
return EXIT_FAILURE;
}
- LOG(INFO) << "Pixel Thermal HAL AIDL Service started.";
+ LOG(INFO) << "Samsung Thermal HAL AIDL Service started.";
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // should not reach
}