[Android] Move subs dir path to AndroidDevices class

Geoffrey Métais git at videolan.org
Thu Apr 6 11:59:21 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Apr  6 10:09:56 2017 +0200| [c4ace96517aaef7af694a33e8880225a08654058] | committer: Geoffrey Métais

Move subs dir path to AndroidDevices class

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

 vlc-android/src/org/videolan/vlc/util/AndroidDevices.java      | 1 +
 vlc-android/src/org/videolan/vlc/util/FileUtils.java           | 1 -
 vlc-android/src/org/videolan/vlc/util/SubtitlesDownloader.java | 4 ++--
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java b/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java
index 61cba39..bd4b22a 100644
--- a/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java
+++ b/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java
@@ -62,6 +62,7 @@ import java.util.StringTokenizer;
 public class AndroidDevices {
     public final static String TAG = "VLC/UiTools/AndroidDevices";
     public final static String EXTERNAL_PUBLIC_DIRECTORY = Environment.getExternalStorageDirectory().getPath();
+    public static final File SUBTITLES_DIRECTORY = new File(VLCApplication.getAppContext().getExternalFilesDir(null), "subs");
 
     final static boolean hasNavBar;
     final static boolean hasTsp = VLCApplication.getAppContext().getPackageManager().hasSystemFeature("android.hardware.touchscreen");
diff --git a/vlc-android/src/org/videolan/vlc/util/FileUtils.java b/vlc-android/src/org/videolan/vlc/util/FileUtils.java
index 7661cdb..e00a8b1 100644
--- a/vlc-android/src/org/videolan/vlc/util/FileUtils.java
+++ b/vlc-android/src/org/videolan/vlc/util/FileUtils.java
@@ -57,7 +57,6 @@ public class FileUtils {
 
     public final static String TAG = "VLC/FileUtils";
 
-    public static final File SUBTITLES_DIRECTORY = new File(VLCApplication.getAppContext().getExternalFilesDir(null), "subs");
     /**
      * Size of the chunks that will be hashed in bytes (64 KB)
      */
diff --git a/vlc-android/src/org/videolan/vlc/util/SubtitlesDownloader.java b/vlc-android/src/org/videolan/vlc/util/SubtitlesDownloader.java
index b9b1eb5..b88d5c8 100644
--- a/vlc-android/src/org/videolan/vlc/util/SubtitlesDownloader.java
+++ b/vlc-android/src/org/videolan/vlc/util/SubtitlesDownloader.java
@@ -110,7 +110,7 @@ public class SubtitlesDownloader {
         VLCApplication.runBackground(new Runnable() {
             @Override
             public void run() {
-                FileUtils.SUBTITLES_DIRECTORY.mkdirs();
+                AndroidDevices.SUBTITLES_DIRECTORY.mkdirs();
                 if (logIn()){
                     getSubtitles(mediaList, finalLanguages);
                 }
@@ -319,7 +319,7 @@ public class SubtitlesDownloader {
 
         StringBuilder sb = new StringBuilder();
         String name = fileName.lastIndexOf('.') > 0 ? fileName.substring(0, fileName.lastIndexOf('.')) : fileName;
-        sb.append(FileUtils.SUBTITLES_DIRECTORY.getPath()).append('/').append(name).append('.').append(language).append('.').append(subFormat);
+        sb.append(AndroidDevices.SUBTITLES_DIRECTORY.getPath()).append('/').append(name).append('.').append(language).append('.').append(subFormat);
         String srtUrl = sb.toString();
         FileOutputStream f = null;
         InputStream in = null;



More information about the Android mailing list