[Android] Catch Exception on service disconnect

Geoffrey Métais git at videolan.org
Mon May 30 13:41:05 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon May 30 13:38:37 2016 +0200| [e239c609c5e06384c43dca5637e2c395251cae74] | committer: Geoffrey Métais

Catch Exception on service disconnect

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

 vlc-android/src/org/videolan/vlc/PlaybackService.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index b97f067..f3c5d19 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -2164,7 +2164,11 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
         public void disconnect() {
             if (mBound) {
                 mBound = false;
-                mContext.unbindService(mServiceConnection);
+                try {
+                    mContext.unbindService(mServiceConnection);
+                } catch (IllegalArgumentException e) {
+                    //Safety catch
+                }
             }
         }
 



More information about the Android mailing list