summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2016-09-21 14:22:33 +0900
committergitbuildkicker <android-build@google.com>2016-10-12 19:42:09 -0700
commit7078020db6f68cca613fd0cc75af348d99f77009 (patch)
tree1355d1834ce18ebb9d07fee478f9ddbc6328bb18
parente6fb776c5817b7f96590dd3739d74aec910796f2 (diff)
downloadbase-7078020db6f68cca613fd0cc75af348d99f77009.tar.gz
Rematch wifi networks when the avoid bad wifi setting changes.
Currently, when the avoid bad wifi setting changes, we rematch all networks and requests, but do not update any NetworkFactories with new scores. This means that if a wifi network's score goes down as a result of enabling bad wifi avoidance, we will not look for another network (e.g., cell data) to satisfy its requests. This makes it so that when the user enables avoiding bad wifi, we will attempt to bring up cell data will if it is not already connected. Bug: 31075769 Change-Id: Ie5b685be8676999adea8c9ecbbc1abb92f81a74f (cherry picked from commit 836d8788a8ed4eb44dbd7e3a24c77c2cc435573e)
-rw-r--r--services/core/java/com/android/server/ConnectivityService.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index cea7a4b683cf..9c3c537be654 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -2961,6 +2961,12 @@ public class ConnectivityService extends IConnectivityManager.Stub
case EVENT_CONFIGURE_NETWORK_AVOID_BAD_WIFI: {
if (updateAvoidBadWifi()) {
rematchAllNetworksAndRequests(null, 0);
+ for (NetworkAgentInfo nai: mNetworkAgentInfos.values()) {
+ if (nai.networkCapabilities.hasTransport(
+ NetworkCapabilities.TRANSPORT_WIFI)) {
+ sendUpdatedScoreToFactories(nai);
+ }
+ }
}
break;
}