ThermalHelper
Helper d'état thermique centralisé (API 29+).
Sur API < 29, toutes les méthodes retournent ThermalStatus.Unknown. Aucune permission requise.
Enregistrement Koin :
single { ThermalHelper(androidContext()) }Content copied to clipboard
Utilisation :
// Lecture synchrone
val status = thermalHelper.getStatus()
if (status >= ThermalStatus.Severe) reduceWorkload()
// Stream réactif (dans viewModelScope)
thermalHelper.statusFlow(executor = Executors.newSingleThreadExecutor())
.onEach { status -> adaptPerformance(status) }
.launchIn(viewModelScope)Content copied to clipboard