| name | p3-thermal |
| description | Implement or change Ola P3 thermal control (temperature-gated CPU max-freq cap). Use when the user mentions P3, 热控, thermal, 限频, thermal.rs, or ThermalEngineCard. |
P3 Thermal
Decision lives in src/thermal.rs. Hardware writes go only through src/action.rs (set_cpu_max_freq / set_governor). Policy fields are on ResourcePolicy and travel APK → DaemonClient.apply → ola apply → resource_step → thermal::apply_thermal.
Constraints (do not revert)
- Fuse
cpu_temp and battery_temp; ignore values outside (0, 150).
- Default thresholds 45°C warn / 65°C hot (same as existing TunerService / SafetyGuard).
- Restore uses hysteresis of 3°C to avoid oscillation.
- Cap by ratio of
cpuinfo_max_freq (warn 80%, hot 62%), then snap down to scaling_available_frequencies. Do not invent OPP values.
- Snapshot original max once; restore that value when cool or when the switch is off. Do not restore governor (P1 owns it).
- Hot level may switch governor to
schedutil only — never powersave.
- Thermal cap is
min(thermal_target, user cpu_max_freq) when the user set a P1 cap.
- Do not expand PPO
ACTION_DIM.
After a stage
Follow session-memory: /home/wlq/wlq/record.sh with WLQ_DIR=/home/wlq/wlq.