Open
Description
When delay
is called using an externally-defined dispatcher that does not implement the internal Delay
interface, it uses a default fallback implementation that can cause an additional thread to be created. Some Android apps strictly audit threads created by their library dependencies and have raised this as an issue when using Jetpack Compose, which defines its own UI dispatcher and both promotes using the delay
API and uses it internally.
On Android, apps always have a main thread running an event loop that could be used in place of creating an additional thread to time the delay
, which could make Dispatchers.Main
a suitable choice for performing the default delay on Android when a compatible/known dispatcher is not found.