Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: webrtc/api/android/java/src/org/webrtc/NetworkMonitorAutoDetect.java

Issue 2522073003: For VPN network, use the underlying network type as its type. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/android/java/src/org/webrtc/NetworkMonitorAutoDetect.java
diff --git a/webrtc/api/android/java/src/org/webrtc/NetworkMonitorAutoDetect.java b/webrtc/api/android/java/src/org/webrtc/NetworkMonitorAutoDetect.java
index 270fca0b31d2abba4d506d1a89bcfc3d23760105..3046ab20c550f17829e679d595754ea06860a73f 100644
--- a/webrtc/api/android/java/src/org/webrtc/NetworkMonitorAutoDetect.java
+++ b/webrtc/api/android/java/src/org/webrtc/NetworkMonitorAutoDetect.java
@@ -288,6 +288,12 @@ public class NetworkMonitorAutoDetect extends BroadcastReceiver {
}
NetworkState networkState = getNetworkState(network);
+ if (networkState.connected && networkState.getNetworkType() == ConnectivityManager.TYPE_VPN) {
+ // If a VPN network is in place, we can find the underlying network type via querying the
+ // active network info thanks to
+ // https://android.googlesource.com/platform/frameworks/base/+/d6a7980d
+ networkState = getNetworkState();
+ }
ConnectionType connectionType = getConnectionType(networkState);
if (connectionType == ConnectionType.CONNECTION_NONE) {
// This may not be an error. The OS may signal a network event with connection type
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698