[Android] Fix playlist filtering from the wrong thread

Geoffrey Métais git at videolan.org
Wed Sep 19 17:43:43 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Sep 19 16:57:35 2018 +0200| [501a83edeaac29d12633180996ee8c41ab10ec32] | committer: Geoffrey Métais

Fix playlist filtering from the wrong thread

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

 vlc-android/src/org/videolan/vlc/viewmodels/PlaylistModel.kt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/viewmodels/PlaylistModel.kt b/vlc-android/src/org/videolan/vlc/viewmodels/PlaylistModel.kt
index e0a34d9f1..14484753c 100644
--- a/vlc-android/src/org/videolan/vlc/viewmodels/PlaylistModel.kt
+++ b/vlc-android/src/org/videolan/vlc/viewmodels/PlaylistModel.kt
@@ -25,7 +25,6 @@ import android.arch.lifecycle.ViewModel
 import android.arch.lifecycle.ViewModelProvider
 import android.arch.lifecycle.ViewModelProviders
 import android.support.v4.app.Fragment
-import kotlinx.coroutines.experimental.Dispatchers
 import kotlinx.coroutines.experimental.launch
 import org.videolan.medialibrary.Tools
 import org.videolan.medialibrary.media.MediaWrapper
@@ -56,7 +55,7 @@ class PlaylistModel(private val service: PlaybackService) : ScopedModel(), Playb
         dataset.value = service.medias.toMutableList()
     }
 
-    fun filter(query: CharSequence?) = launch(Dispatchers.Default) { filter.filter(query) }
+    fun filter(query: CharSequence?) = launch { filter.filter(query) }
 
     public override fun onCleared() {
         service.removeCallback(this)



More information about the Android mailing list