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

Commit 8db7d76b authored by Andrew Chant's avatar Andrew Chant
Browse files

Revert "[NS A27] Remove useless logs and a useless var"

This reverts commit 04ea2173.

Reason for revert: Toggling wifi on/off causes networking to
 stop working with these four patches applied.
Bug: 146230156

Change-Id: I6c75ac179bcc08cc5979194eea69525b333e2ba7
parent 04ea2173
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -6415,13 +6415,19 @@ public class ConnectivityService extends IConnectivityManager.Stub
        changes.addRematchedNetwork(new NetworkReassignment.NetworkBgStatePair(newNetwork,
                newNetwork.isBackgroundNetwork()));

        final int score = newNetwork.getCurrentScore();

        if (VDBG || DDBG) log("rematching " + newNetwork.name());

        final ArrayMap<NetworkRequestInfo, NetworkAgentInfo> reassignedRequests =
                computeRequestReassignmentForNetwork(newNetwork);

        NetworkCapabilities nc = newNetwork.networkCapabilities;
        if (VDBG) log(" network has: " + nc);

        // Find and migrate to this Network any NetworkRequests for
        // which this network is now the best.
        final ArrayList<NetworkAgentInfo> removedRequests = new ArrayList<>();
        for (final Map.Entry<NetworkRequestInfo, NetworkAgentInfo> entry :
                reassignedRequests.entrySet()) {
            final NetworkRequestInfo nri = entry.getKey();
@@ -6435,6 +6441,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
                    }
                    previousSatisfier.removeRequest(nri.request.requestId);
                    previousSatisfier.lingerRequest(nri.request, now, mLingerDelayMs);
                    removedRequests.add(previousSatisfier);
                } else {
                    if (VDBG || DDBG) log("   accepting network in place of null");
                }
@@ -6501,6 +6508,17 @@ public class ConnectivityService extends IConnectivityManager.Stub
            // Have a new default network, release the transition wakelock in
            scheduleReleaseNetworkTransitionWakelock();
        }

        if (!newNetwork.networkCapabilities.equalRequestableCapabilities(nc)) {
            Slog.wtf(TAG, String.format(
                    "BUG: %s changed requestable capabilities during rematch: %s -> %s",
                    newNetwork.name(), nc, newNetwork.networkCapabilities));
        }
        if (newNetwork.getCurrentScore() != score) {
            Slog.wtf(TAG, String.format(
                    "BUG: %s changed score during rematch: %d -> %d",
                    newNetwork.name(), score, newNetwork.getCurrentScore()));
        }
    }

    /**