[Android] Get ML exception
Geoffrey Métais
git at videolan.org
Fri Oct 4 16:28:55 CEST 2019
vlc-android | branch: 3.2.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Oct 2 10:56:05 2019 +0200| [317dfd7a794963a0ffa0d304a2affc8f4e649166] | committer: Geoffrey Métais
Get ML exception
(cherry picked from commit 08b190373903c80db9987a6dc256ae11439dc0d9)
> https://code.videolan.org/videolan/vlc-android/commit/317dfd7a794963a0ffa0d304a2affc8f4e649166
---
vlc-android/src/org/videolan/vlc/MediaParsingService.kt | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/vlc-android/src/org/videolan/vlc/MediaParsingService.kt b/vlc-android/src/org/videolan/vlc/MediaParsingService.kt
index ded84faaa..c5c42e316 100644
--- a/vlc-android/src/org/videolan/vlc/MediaParsingService.kt
+++ b/vlc-android/src/org/videolan/vlc/MediaParsingService.kt
@@ -82,6 +82,10 @@ class MediaParsingService : Service(), DevicesDiscoveryCb, CoroutineScope, Lifec
private var discoverTriggered = false
internal val sb = StringBuilder()
+ val exceptionHandler = AbstractMedialibrary.MedialibraryExceptionHandler { context, errMsg ->
+ Log.d(TAG, "Exception occured, $context: $errMsg")
+ }
+
private val notificationActor by lazy {
actor<Notification>(capacity = Channel.UNLIMITED) {
for (update in channel) when (update) {
@@ -400,6 +404,7 @@ class MediaParsingService : Service(), DevicesDiscoveryCb, CoroutineScope, Lifec
val context = this at MediaParsingService
var shouldInit = !dbExists()
val initCode = medialibrary.init(context)
+ medialibrary.exceptionHandler = exceptionHandler
shouldInit = shouldInit or (initCode == AbstractMedialibrary.ML_INIT_DB_RESET) or (initCode == AbstractMedialibrary.ML_INIT_DB_CORRUPTED)
if (initCode != AbstractMedialibrary.ML_INIT_FAILED) initMedialib(action.parse, context, shouldInit, action.upgrade)
else exitCommand()
More information about the Android
mailing list