[Android] Fix RuntimeException
Nicolas Pomepuy
git at videolan.org
Thu Jun 4 11:30:20 CEST 2020
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Jun 3 06:39:15 2020 +0200| [9e32a1e434d0bc05a8c4cf413bca5f357f6f3f09] | committer: Nicolas Pomepuy
Fix RuntimeException
> https://code.videolan.org/videolan/vlc-android/commit/9e32a1e434d0bc05a8c4cf413bca5f357f6f3f09
---
application/vlc-android/src/org/videolan/vlc/MediaParsingService.kt | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/MediaParsingService.kt b/application/vlc-android/src/org/videolan/vlc/MediaParsingService.kt
index d66e99c1f..118db3823 100644
--- a/application/vlc-android/src/org/videolan/vlc/MediaParsingService.kt
+++ b/application/vlc-android/src/org/videolan/vlc/MediaParsingService.kt
@@ -401,7 +401,11 @@ class MediaParsingService : LifecycleService(), DevicesDiscoveryCb {
private fun exitCommand() {
if (!medialibrary.isWorking && !serviceLock && !discoverTriggered) {
lastNotificationTime = 0L
- if (wakeLock.isHeld) wakeLock.release()
+ if (wakeLock.isHeld) try {
+ wakeLock.release()
+ } catch (t: Throwable) {
+ //catching here as isHeld is not thread safe
+ }
localBroadcastManager.sendBroadcast(Intent(ACTION_CONTENT_INDEXING))
//todo reenable entry point when ready
if (::notificationActor.isInitialized) notificationActor.safeOffer(Hide)
More information about the Android
mailing list