1on property:persist.vendor.log.thermal=1
2    start vendor.thermal.logd
3
4on property:persist.vendor.log.thermal=0
5    stop vendor.thermal.logd
6
7on property:persist.vendor.log.thermal=1 && property:persist.vendor.log.thermal.interval=*
8    restart vendor.thermal.logd
9
10service vendor.thermal.logd /vendor/bin/thermal_logd ${persist.vendor.log.thermal.interval:-5}
11    class main
12    user root
13    group root system
14    disabled
15
16# Switch thermal protection for Pixels
17on property:persist.vendor.disable.thermal.control=*
18    setprop vendor.disable.thermal.control ${persist.vendor.disable.thermal.control}
19
20on property:persist.vendor.disable.thermalhal.control=*
21    setprop vendor.disable.thermalhal.control ${persist.vendor.disable.thermalhal.control}
22
23on property:persist.vendor.disable.usb.overheat.mitigation=*
24    setprop vendor.disable.usb.overheat.mitigation.control ${persist.vendor.disable.usb.overheat.mitigation}
25
26on property:persist.vendor.disable.bcl.control=*
27    setprop vendor.disable.bcl.control ${persist.vendor.disable.bcl.control}
28
29on property:vendor.disable.thermalhal.control=* && property:vendor.thermal.link_ready=1
30    restart vendor.thermal-hal
31
32on property:vendor.disable.thermal.control=1 && property:vendor.thermal.link_ready=1
33    # common
34    stop vendor.thermal-engine
35    setprop vendor.disable.thermalhal.control 1
36    # sdm845
37    write /dev/thermal/tz-by-name/quiet-therm-adc/mode disabled
38    write /dev/thermal/tz-by-name/quiet-therm-monitor/mode disabled
39    write /dev/thermal/tz-by-name/fps-therm-adc/mode disabled
40    write /dev/thermal/tz-by-name/fps-therm-monitor/mode disabled
41    # sdm670
42    write /dev/thermal/tz-by-name/mb-therm-adc/mode disabled
43    write /dev/thermal/tz-by-name/mb-therm-monitor/mode disabled
44    # sm8150
45    write /dev/thermal/tz-by-name/sdm-therm/mode disabled
46    write /dev/thermal/tz-by-name/sdm-therm-monitor/mode disabled
47    # sm7150
48    write /dev/thermal/tz-by-name/skin-therm-adc/mode disabled
49    write /dev/thermal/tz-by-name/skin-therm-monitor/mode disabled
50    # sm7250
51    write /dev/thermal/tz-by-name/skin-therm/emul_temp 25000
52    write /dev/thermal/tz-by-name/skin-therm/mode disabled
53    write /dev/thermal/tz-by-name/skin-virt/emul_temp 25000
54    write /dev/thermal/tz-by-name/skin-virt/mode disabled
55    write /dev/thermal/tz-by-name/skin-therm-cpu/emul_temp 25000
56    write /dev/thermal/tz-by-name/skin-therm-cpu/mode disabled
57    write /dev/thermal/tz-by-name/skin-virt-cpu/emul_temp 25000
58    write /dev/thermal/tz-by-name/skin-virt-cpu/mode disabled
59    write /dev/thermal/tz-by-name/skin-therm-monitor/emul_temp 25000
60    write /dev/thermal/tz-by-name/skin-therm-monitor/mode disabled
61    write /dev/thermal/tz-by-name/skin-virt-monitor/emul_temp 25000
62    write /dev/thermal/tz-by-name/skin-virt-monitor/mode disabled
63    write /dev/thermal/tz-by-name/panel-audio-therm/emul_temp 25000
64    write /dev/thermal/tz-by-name/panel-audio-therm/mode disabled
65    write /dev/thermal/tz-by-name/cellular-emergency/emul_temp 25000
66    write /dev/thermal/tz-by-name/cellular-emergency/mode disabled
67    write /dev/thermal/tz-by-name/sdm-therm/emul_temp 25000
68    write /dev/thermal/tz-by-name/sdm-therm/mode disabled
69    write /dev/thermal/tz-by-name/charger-therm/emul_temp 25000
70    write /dev/thermal/tz-by-name/charger-therm/mode disabled
71    # P21
72    write /dev/thermal/tz-by-name/disp_therm/mode disabled
73
74on property:vendor.disable.thermal.control=0 && property:vendor.thermal.link_ready=1
75    # common
76    start vendor.thermal-engine
77    setprop vendor.disable.thermalhal.control 0
78    # sdm845
79    write /dev/thermal/tz-by-name/quiet-therm-adc/mode enabled
80    write /dev/thermal/tz-by-name/quiet-therm-monitor/mode enabled
81    write /dev/thermal/tz-by-name/fps-therm-adc/mode enabled
82    write /dev/thermal/tz-by-name/fps-therm-monitor/mode enabled
83    # sdm670
84    write /dev/thermal/tz-by-name/mb-therm-adc/mode enabled
85    write /dev/thermal/tz-by-name/mb-therm-monitor/mode enabled
86    # sm8150
87    write /dev/thermal/tz-by-name/sdm-therm/mode enabled
88    write /dev/thermal/tz-by-name/sdm-therm-monitor/mode enabled
89    # sm7150
90    write /dev/thermal/tz-by-name/skin-therm-adc/mode enabled
91    write /dev/thermal/tz-by-name/skin-therm-monitor/mode enabled
92    # sm7250
93    write /dev/thermal/tz-by-name/skin-therm/emul_temp 0
94    write /dev/thermal/tz-by-name/skin-therm/mode enabled
95    write /dev/thermal/tz-by-name/skin-virt/emul_temp 0
96    write /dev/thermal/tz-by-name/skin-virt/mode enabled
97    write /dev/thermal/tz-by-name/skin-therm-cpu/emul_temp 0
98    write /dev/thermal/tz-by-name/skin-therm-cpu/mode enabled
99    write /dev/thermal/tz-by-name/skin-virt-cpu/emul_temp 0
100    write /dev/thermal/tz-by-name/skin-virt-cpu/mode enabled
101    write /dev/thermal/tz-by-name/skin-therm-monitor/emul_temp 0
102    write /dev/thermal/tz-by-name/skin-therm-monitor/mode enabled
103    write /dev/thermal/tz-by-name/skin-virt-monitor/emul_temp 0
104    write /dev/thermal/tz-by-name/skin-virt-monitor/mode enabled
105    write /dev/thermal/tz-by-name/panel-audio-therm/emul_temp 0
106    write /dev/thermal/tz-by-name/panel-audio-therm/mode enabled
107    write /dev/thermal/tz-by-name/cellular-emergency/emul_temp 0
108    write /dev/thermal/tz-by-name/cellular-emergency/mode enabled
109    write /dev/thermal/tz-by-name/sdm-therm/emul_temp 0
110    write /dev/thermal/tz-by-name/sdm-therm/mode enabled
111    write /dev/thermal/tz-by-name/charger-therm/emul_temp 0
112    write /dev/thermal/tz-by-name/charger-therm/mode enabled
113    # P21
114    write /dev/thermal/tz-by-name/disp_therm/mode enabled
115
116# Toggle BCL control
117on property:vendor.disable.bcl.control=1
118    write /dev/thermal/tz-by-name/soc/mode disabled
119
120on property:vendor.disable.bcl.control=0
121    write /dev/thermal/tz-by-name/soc/mode enabled
122
123# Switch USB port overheat protection
124on property:vendor.disable.usb.overheat.mitigation.control=1
125    write /sys/module/overheat_mitigation/parameters/enable 0
126    write /dev/thermal/tz-by-name/usb_pwr_therm2/emul_temp 25000
127
128on property:vendor.disable.usb.overheat.mitigation.control=0
129    write /sys/module/overheat_mitigation/parameters/enable 1
130    write /dev/thermal/tz-by-name/usb_pwr_therm2/emul_temp 0
131