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 {
val pkgName = getPackageNameFromIntent(intent) ?:
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
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 =
GlobalScope.launch(Dispatchers.Main, CoroutineStart.UNDISPATCHED, null, block)
GlobalScope.launch(Dispatchers.Main, CoroutineStart.UNDISPATCHED, block)