[Android] Enable full network browsing with VPN
Geoffrey Métais
git at videolan.org
Wed Feb 8 15:38:47 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Feb 8 15:38:00 2017 +0100| [788915de38311be8ee687f49c94dd5a84a46bd10] | committer: Geoffrey Métais
Enable full network browsing with VPN
> https://code.videolan.org/videolan/vlc-android/commit/788915de38311be8ee687f49c94dd5a84a46bd10
---
.../org/videolan/vlc/gui/browser/NetworkBrowserFragment.java | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
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 41a5a3f..e31cc4c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.java
@@ -65,7 +65,6 @@ public class NetworkBrowserFragment extends BaseBrowserFragment {
public void onStart(){
super.onStart();
-
//Handle network connection state
IntentFilter filter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
mSkipRefresh = !mAdapter.isEmpty();
@@ -124,7 +123,7 @@ public class NetworkBrowserFragment extends BaseBrowserFragment {
protected void browseRoot() {
updateFavorites();
mAdapter.setTop(mAdapter.getItemCount());
- if (AndroidDevices.hasLANConnection())
+ if (allowLAN())
mMediaBrowser.discoverNetworkShares();
else {
if (!mAdapter.isEmpty())
@@ -133,6 +132,10 @@ public class NetworkBrowserFragment extends BaseBrowserFragment {
}
}
+ private boolean allowLAN() {
+ return AndroidDevices.hasLANConnection() || AndroidDevices.isVPNActive();
+ }
+
@Override
protected String getCategoryTitle() {
return getString(R.string.network_browsing);
@@ -152,7 +155,7 @@ public class NetworkBrowserFragment extends BaseBrowserFragment {
if (newSize == 0 && mFavorites == 0)
return;
- if (!AndroidDevices.hasLANConnection()) {
+ if (!allowLAN()) {
ArrayList<MediaWrapper> toRemove = new ArrayList<>();
List<String> schemes = Arrays.asList("ftp", "sftp", "ftps", "http", "https");
for (MediaWrapper mw : favs)
@@ -215,7 +218,7 @@ public class NetworkBrowserFragment extends BaseBrowserFragment {
mRecyclerView.setVisibility(View.GONE);
} else {
if (mRoot)
- mEmptyView.setText(AndroidDevices.hasLANConnection() ? R.string.network_shares_discovery : R.string.network_connection_needed);
+ mEmptyView.setText(allowLAN() ? R.string.network_shares_discovery : R.string.network_connection_needed);
else
mEmptyView.setText(R.string.network_empty);
mEmptyView.setVisibility(View.VISIBLE);
More information about the Android
mailing list