[Android] fix tv build

Thomas Guillem git at videolan.org
Thu Dec 3 17:19:04 CET 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Dec  3 17:18:48 2015 +0100| [15d65d181651b17b033e55f8228e6bf0c5080190] | committer: Thomas Guillem

fix tv build

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=15d65d181651b17b033e55f8228e6bf0c5080190
---

 .../org/videolan/vlc/gui/tv/browser/BrowserGridFragment.java |    3 ++-
 .../org/videolan/vlc/gui/browser/NetworkBrowserFragment.java |   10 ++--------
 vlc-android/src/org/videolan/vlc/util/Util.java              |    9 +++++++++
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/vlc-android/flavors/tv/src/org/videolan/vlc/gui/tv/browser/BrowserGridFragment.java b/vlc-android/flavors/tv/src/org/videolan/vlc/gui/tv/browser/BrowserGridFragment.java
index a188c1b..9ded0eb 100644
--- a/vlc-android/flavors/tv/src/org/videolan/vlc/gui/tv/browser/BrowserGridFragment.java
+++ b/vlc-android/flavors/tv/src/org/videolan/vlc/gui/tv/browser/BrowserGridFragment.java
@@ -40,6 +40,7 @@ import org.videolan.vlc.gui.browser.BaseBrowserFragment;
 import org.videolan.vlc.gui.tv.DetailsActivity;
 import org.videolan.vlc.gui.tv.MediaItemDetails;
 import org.videolan.vlc.gui.tv.browser.interfaces.BrowserActivityInterface;
+import org.videolan.vlc.util.Util;
 import org.videolan.vlc.util.VLCInstance;
 
 import java.util.ArrayList;
@@ -73,7 +74,7 @@ public class BrowserGridFragment extends GridFragment implements MediaBrowser.Ev
                 if (mUri != null)
                     mMediaBrowser.browse(mUri);
                 else
-                    mMediaBrowser.discoverNetworkShares();
+                    mMediaBrowser.discoverNetworkShares(Util.NETWORK_DISCOVER_LIST);
                 ((BrowserActivityInterface)getActivity()).showProgress(true);
             }
         }
diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.java
index 07b3988..bdd5974 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.java
@@ -38,18 +38,12 @@ import org.videolan.vlc.media.MediaDatabase;
 import org.videolan.vlc.media.MediaWrapper;
 import org.videolan.vlc.R;
 import org.videolan.vlc.util.AndroidDevices;
+import org.videolan.vlc.util.Util;
 
 import java.util.ArrayList;
 
 public class NetworkBrowserFragment extends BaseBrowserFragment {
 
-    private static MediaBrowser.Discover DISCOVER_LIST[] = BuildConfig.DEBUG ? new MediaBrowser.Discover[] {
-            MediaBrowser.Discover.UPNP,
-            MediaBrowser.Discover.SMB,
-    } : new MediaBrowser.Discover[] {
-            MediaBrowser.Discover.UPNP,
-    };
-
     public NetworkBrowserFragment() {
         ROOT = "smb";
         mHandler = new BrowserFragmentHandler(this);
@@ -108,7 +102,7 @@ public class NetworkBrowserFragment extends BaseBrowserFragment {
             }
             mAdapter.addItem("Network favorites", false, true);
         }
-        mMediaBrowser.discoverNetworkShares(DISCOVER_LIST);
+        mMediaBrowser.discoverNetworkShares(Util.NETWORK_DISCOVER_LIST);
     }
 
     @Override
diff --git a/vlc-android/src/org/videolan/vlc/util/Util.java b/vlc-android/src/org/videolan/vlc/util/Util.java
index e5a0464..4da13a5 100644
--- a/vlc-android/src/org/videolan/vlc/util/Util.java
+++ b/vlc-android/src/org/videolan/vlc/util/Util.java
@@ -27,6 +27,8 @@ import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
 
 import org.videolan.libvlc.util.AndroidUtil;
+import org.videolan.libvlc.util.MediaBrowser;
+import org.videolan.vlc.BuildConfig;
 import org.videolan.vlc.VLCApplication;
 
 import java.io.BufferedReader;
@@ -91,4 +93,11 @@ public class Util {
                 PackageManager.MATCH_DEFAULT_ONLY);
         return list.size() > 0;
     }
+
+    public static final MediaBrowser.Discover NETWORK_DISCOVER_LIST[] = BuildConfig.DEBUG ?new MediaBrowser.Discover[] {
+            MediaBrowser.Discover.UPNP,
+            MediaBrowser.Discover.SMB,
+    } : new MediaBrowser.Discover[] {
+            MediaBrowser.Discover.UPNP,
+    };
 }



More information about the Android mailing list