Update network selections on capability change.
Among other reasons, this is needed when a Wi-Fi connection is upgraded from untrusted to trusted, so that the default route can be updated to point to the Wi-Fi network instead. Bug: 18206275 Change-Id: I53f7a6f00f66a23ae4873fa2334cd8a621f39d4f
This commit is contained in:
@@ -3701,12 +3701,11 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
|
|
||||||
private void updateCapabilities(NetworkAgentInfo networkAgent,
|
private void updateCapabilities(NetworkAgentInfo networkAgent,
|
||||||
NetworkCapabilities networkCapabilities) {
|
NetworkCapabilities networkCapabilities) {
|
||||||
// TODO - turn this on in MR1 when we have more dogfooding time.
|
|
||||||
// rematchAllNetworksAndRequests();
|
|
||||||
if (!Objects.equals(networkAgent.networkCapabilities, networkCapabilities)) {
|
if (!Objects.equals(networkAgent.networkCapabilities, networkCapabilities)) {
|
||||||
synchronized (networkAgent) {
|
synchronized (networkAgent) {
|
||||||
networkAgent.networkCapabilities = networkCapabilities;
|
networkAgent.networkCapabilities = networkCapabilities;
|
||||||
}
|
}
|
||||||
|
rematchAllNetworksAndRequests(networkAgent, networkAgent.getCurrentScore());
|
||||||
notifyNetworkCallbacks(networkAgent, ConnectivityManager.CALLBACK_CAP_CHANGED);
|
notifyNetworkCallbacks(networkAgent, ConnectivityManager.CALLBACK_CAP_CHANGED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user