[Android] Catch exception in case bitmap fails to parcelize
Geoffrey Métais
git at videolan.org
Wed Nov 15 12:22:47 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Nov 15 12:21:58 2017 +0100| [74e7595c934cbb07d78436317111fc9fcb66a94c] | committer: Geoffrey Métais
Catch exception in case bitmap fails to parcelize
> https://code.videolan.org/videolan/vlc-android/commit/74e7595c934cbb07d78436317111fc9fcb66a94c
---
.../src/org/videolan/vlc/PlaybackService.java | 23 +++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 9fc38efbe..2b43cd476 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -2689,21 +2689,22 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
registerMedialibrary(new Runnable() {
@Override
public void run() {
- VLCApplication.runBackground(new Runnable() {
- @Override
- public void run() {
- result.sendResult(BrowserProvider.browse(parentId));
- }
- });
+ sendResults(result, parentId);
}
});
else
- VLCApplication.runBackground(new Runnable() {
- @Override
- public void run() {
+ sendResults(result, parentId);
+ }
+
+ private void sendResults(@NonNull MediaBrowserServiceCompat.Result result, @NonNull final String parentId) {
+ VLCApplication.runBackground(new Runnable() {
+ @Override
+ public void run() {
+ try {
result.sendResult(BrowserProvider.browse(parentId));
- }
- });
+ } catch (RuntimeException ignored) {} //bitmap parcelization can fail
+ }
+ });
}
private class MedialibraryReceiver extends BroadcastReceiver {
More information about the Android
mailing list