Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 836d8788 authored by Lorenzo Colitti's avatar Lorenzo Colitti
Browse files

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
parent 7e5b9e3d
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -2961,6 +2961,12 @@ public class ConnectivityService extends IConnectivityManager.Stub
                case EVENT_CONFIGURE_NETWORK_AVOID_BAD_WIFI: {
                case EVENT_CONFIGURE_NETWORK_AVOID_BAD_WIFI: {
                    if (updateAvoidBadWifi()) {
                    if (updateAvoidBadWifi()) {
                        rematchAllNetworksAndRequests(null, 0);
                        rematchAllNetworksAndRequests(null, 0);
                        for (NetworkAgentInfo nai: mNetworkAgentInfos.values()) {
                            if (nai.networkCapabilities.hasTransport(
                                    NetworkCapabilities.TRANSPORT_WIFI)) {
                                sendUpdatedScoreToFactories(nai);
                            }
                        }
                    }
                    }
                    break;
                    break;
                }
                }