awaitState

Suspends until the timer reaches target.

Returns immediately when SleepTimer.state is already target.

Parameters

target

The SleepTimerState to wait for.

See also


suspend fun AudioStream.awaitState(target: StreamState)

Suspends until the stream reaches the target StreamState.

If the stream is already in the target state, this function returns immediately without suspending. Otherwise, it observes the stream via stateFlow and suspends until the target state is emitted.

Parameters

target

The StreamState to wait for.

See also