[Android] Use canonical file path for custom directories

Geoffrey Métais git at videolan.org
Thu Oct 5 16:50:36 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Oct  5 16:50:04 2017 +0200| [8e652c3083f94a17690a5a6f8231ef9f223cbc58] | committer: Geoffrey Métais

Use canonical file path for custom directories

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

 .../src/org/videolan/vlc/gui/browser/FileBrowserFragment.java  | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.java
index 185c09074..ffd2fce34 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.java
@@ -25,14 +25,11 @@ package org.videolan.vlc.gui.browser;
 
 import android.content.Context;
 import android.content.DialogInterface;
-import android.os.Bundle;
 import android.support.v4.app.Fragment;
 import android.support.v7.app.AlertDialog;
 import android.support.v7.widget.AppCompatEditText;
 import android.text.InputType;
 import android.text.TextUtils;
-import android.view.Menu;
-import android.view.MenuInflater;
 import android.view.MenuItem;
 
 import org.videolan.libvlc.util.AndroidUtil;
@@ -50,6 +47,7 @@ import org.videolan.vlc.util.FileUtils;
 import org.videolan.vlc.util.Strings;
 
 import java.io.File;
+import java.io.IOException;
 import java.util.ArrayList;
 
 public class FileBrowserFragment extends BaseBrowserFragment {
@@ -143,8 +141,10 @@ public class FileBrowserFragment extends BaseBrowserFragment {
                     return;
                 }
 
-                CustomDirectories.addCustomDirectory(f.getAbsolutePath());
-                ((AudioPlayerContainerActivity)getActivity()).updateLib();
+                try {
+                    CustomDirectories.addCustomDirectory(f.getCanonicalPath());
+                    ((AudioPlayerContainerActivity)getActivity()).updateLib();
+                } catch (IOException ignored) {}
             }
         });
         mAlertDialog = builder.show();



More information about the Android mailing list