[Android] Catch SecurityException in Uri transcription

Geoffrey Métais git at videolan.org
Tue Jan 31 10:05:00 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jan 31 09:45:02 2017 +0100| [565c4dde6113cc8e23d58c630a34234850ac40fa] | committer: Geoffrey Métais

Catch SecurityException in Uri transcription

If a media has been loaded from a 3rd party app, its access may not be
granted anymore

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

 vlc-android/src/org/videolan/vlc/util/FileUtils.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/util/FileUtils.java b/vlc-android/src/org/videolan/vlc/util/FileUtils.java
index 13e07b6..1686430 100644
--- a/vlc-android/src/org/videolan/vlc/util/FileUtils.java
+++ b/vlc-android/src/org/videolan/vlc/util/FileUtils.java
@@ -388,6 +388,9 @@ public class FileUtils {
                 } catch (FileNotFoundException e) {
                     Log.e(TAG, "Couldn't understand the intent");
                     return data;
+                } catch (SecurityException e) {
+                    Log.e(TAG, "Permission is no longer valid");
+                    return data;
                 }
             }
         }



More information about the Android mailing list