[Android] AppScope: no need for GlobalScope anymore

Geoffrey Métais git at videolan.org
Mon Nov 12 17:27:17 CET 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Nov 12 16:54:02 2018 +0100| [bf6f32f13b770e9c0a0a4660278234cc3989f264] | committer: Geoffrey Métais

AppScope: no need for GlobalScope anymore

> https://code.videolan.org/videolan/vlc-android/commit/bf6f32f13b770e9c0a0a4660278234cc3989f264
---

 vlc-android/src/org/videolan/vlc/util/Workers.kt | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/util/Workers.kt b/vlc-android/src/org/videolan/vlc/util/Workers.kt
index e760b536a..24f4501bd 100644
--- a/vlc-android/src/org/videolan/vlc/util/Workers.kt
+++ b/vlc-android/src/org/videolan/vlc/util/Workers.kt
@@ -1,7 +1,10 @@
 package org.videolan.vlc.util
 
 import android.os.Looper
-import kotlinx.coroutines.*
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.Runnable
+import kotlinx.coroutines.launch
 
 fun runBackground(runnable: Runnable) {
     if (Looper.myLooper() != Looper.getMainLooper()) runnable.run()
@@ -16,6 +19,6 @@ fun runIO(runnable: Runnable) {
     AppScope.launch(Dispatchers.IO) { runnable.run() }
 }
 
-object AppScope : CoroutineScope by GlobalScope {
+object AppScope : CoroutineScope {
     override val coroutineContext = Dispatchers.Main.immediate
 }
\ No newline at end of file



More information about the Android mailing list