For VPN network, use the underlying network type as its type.

This is for Android.

BUG=webrtc:6748

Review-Url: https://codereview.webrtc.org/2522073003
Cr-Commit-Position: refs/heads/master@{#15218}
This commit is contained in:
honghaiz
2016-11-23 11:04:25 -08:00
committed by Commit bot
parent 4dfb8cef51
commit d44d0bae85

View File

@ -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