From 0895e175fd57cd288d18a080c4838c6e32803fb2 Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Wed, 21 Sep 2016 14:22:33 +0900 Subject: [PATCH] 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 --- .../core/java/com/android/server/ConnectivityService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index cea7a4b683..9c3c537be6 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; }