Update the type and cost of existing networks
if the network monitor detects it after the native code does.
Also set the network cost for ethernet, wifi, unknown, cellular network type to be 0, 10, 50, 900,
so that unknown networks will have lower precedence than known networks with low cost (like Wifi) but higher precedence than known networks with high cost.
And third, infer network type based on limited name matching in Android if there is no network monitor or network monitor did not find the type.
BUG=webrtc:5890
R=pthatcher@chromium.org, pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/1976683003 .
Cr-Commit-Position: refs/heads/master@{#12833}
diff --git a/webrtc/api/webrtcsdp.cc b/webrtc/api/webrtcsdp.cc
index b86d903..fa05241 100644
--- a/webrtc/api/webrtcsdp.cc
+++ b/webrtc/api/webrtcsdp.cc
@@ -1117,7 +1117,7 @@
if (!GetValueFromString(first_line, fields[++i], &network_cost, error)) {
return false;
}
- network_cost = std::min(network_cost, cricket::kMaxNetworkCost);
+ network_cost = std::min(network_cost, rtc::kNetworkCostMax);
} else {
// Skip the unknown extension.
++i;