Extensions for com.google.android.gms.tasks.Task

asDeferred

fun <T> Task<T>.asDeferred(): Deferred<T>

Converts this task to an instance of Deferred. If task is cancelled then resulting deferred will be cancelled as well.

await

suspend fun <T> Task<T>.await(): T

Awaits for completion of the task without blocking a thread.