[Android] Hide internal storage on Swisscom TV box

Geoffrey Métais git at videolan.org
Fri Mar 18 13:08:43 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Mar 18 13:07:25 2016 +0100| [97b88dcce651fe1ede3b788696e46b01f1cf2620] | committer: Geoffrey Métais

Hide internal storage on Swisscom TV box

Filter is limited to Android TV UI for now.

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

 vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java | 2 ++
 vlc-android/src/org/videolan/vlc/util/AndroidDevices.java   | 8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
index 4c64ea8..fb6e4a3 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
@@ -503,6 +503,8 @@ public class MainTvActivity extends BaseTvActivity implements IVideoBrowser, OnI
             return;
         mBrowserAdapter.clear();
         List<MediaWrapper> directories = AndroidDevices.getMediaDirectoriesList();
+        if (!AndroidDevices.showInternalStorage())
+            directories.remove(0);
         for (MediaWrapper directory : directories)
             mBrowserAdapter.add(new CardPresenter.SimpleCard(HEADER_DIRECTORIES, directory.getTitle(), R.drawable.ic_menu_network_big, directory.getUri()));
 
diff --git a/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java b/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java
index 20d2185..f1f8c0a 100644
--- a/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java
+++ b/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java
@@ -26,6 +26,7 @@ import android.content.Context;
 import android.content.pm.PackageManager;
 import android.net.ConnectivityManager;
 import android.net.NetworkInfo;
+import android.os.Build;
 import android.os.Build.VERSION;
 import android.os.Build.VERSION_CODES;
 import android.os.Environment;
@@ -57,7 +58,7 @@ public class AndroidDevices {
     public final static String EXTERNAL_PUBLIC_DIRECTORY = Environment.getExternalStorageDirectory().getPath();
 
     final static boolean hasNavBar;
-    final static boolean hasTsp, isTv;
+    final static boolean hasTsp, isTv, showInternalStorage;
 
     static {
         HashSet<String> devicesWithoutNavBar = new HashSet<String>();
@@ -69,6 +70,7 @@ public class AndroidDevices {
                 && !devicesWithoutNavBar.contains(android.os.Build.MODEL);
         hasTsp = VLCApplication.getAppContext().getPackageManager().hasSystemFeature("android.hardware.touchscreen");
         isTv = VLCApplication.getAppContext().getPackageManager().hasSystemFeature("android.software.leanback");
+        showInternalStorage = !TextUtils.equals(Build.BRAND, "Swisscom") && !TextUtils.equals(Build.BOARD, "sprint");
     }
 
     public static boolean hasExternalStorage() {
@@ -101,6 +103,10 @@ public class AndroidDevices {
         return isTv;
     }
 
+    public static boolean showInternalStorage() {
+        return showInternalStorage;
+    }
+
     public static ArrayList<String> getStorageDirectories() {
         BufferedReader bufReader = null;
         ArrayList<String> list = new ArrayList<String>();



More information about the Android mailing list