ThermalHelper

class ThermalHelper(context: Context)(source)

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()) }

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)

Constructors

Link copied to clipboard
constructor(context: Context)

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@RequiresApi(value = 29)
fun statusFlow(executor: Executor): Flow<ThermalStatus>