Fix coroutine deprecations again

This commit is contained in:
Samuel Bronson 2019-09-18 17:41:09 -04:00
parent 934a37c36b
commit fa59b4f8a7
2 changed files with 3 additions and 3 deletions

View file

@ -94,7 +94,7 @@ internal class ExtensionInstallReceiver(private val listener: Listener) :
private suspend fun getExtensionFromIntent(context: Context, intent: Intent?): LoadResult { private suspend fun getExtensionFromIntent(context: Context, intent: Intent?): LoadResult {
val pkgName = getPackageNameFromIntent(intent) ?: val pkgName = getPackageNameFromIntent(intent) ?:
return LoadResult.Error("Package name not found") return LoadResult.Error("Package name not found")
return GlobalScope.async(Dispatchers.Default, CoroutineStart.DEFAULT, null, { ExtensionLoader.loadExtensionFromPkgName(context, pkgName) }).await() return GlobalScope.async(Dispatchers.Default, CoroutineStart.DEFAULT, { ExtensionLoader.loadExtensionFromPkgName(context, pkgName) }).await()
} }
/** /**

View file

@ -4,7 +4,7 @@ import kotlinx.coroutines.experimental.*
import kotlinx.coroutines.experimental.android.Main import kotlinx.coroutines.experimental.android.Main
fun launchUI(block: suspend CoroutineScope.() -> Unit): Job = fun launchUI(block: suspend CoroutineScope.() -> Unit): Job =
GlobalScope.launch(Dispatchers.Main, CoroutineStart.DEFAULT, null, block) GlobalScope.launch(Dispatchers.Main, CoroutineStart.DEFAULT, block)
fun launchNow(block: suspend CoroutineScope.() -> Unit): Job = fun launchNow(block: suspend CoroutineScope.() -> Unit): Job =
GlobalScope.launch(Dispatchers.Main, CoroutineStart.UNDISPATCHED, null, block) GlobalScope.launch(Dispatchers.Main, CoroutineStart.UNDISPATCHED, block)