From d47c3679055052be6c523f8ebf5fbfbbb5fd03c6 Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Mon, 1 Oct 2018 13:16:55 +0900 Subject: [PATCH] Remove spurious WTF in rematching networks. By construction, this WTF should never happen, since it's in an if (nri.request.isRequest()) and by definition requests can only be satisfied by one network at a time. I don't think we've ever seen this particular WTF in an APR report, which suggests that it's not happening in practice. Test: atest FrameworksNetTests CtsNetTestCasesLegacyApi22 CtsNetTestCasesLegacyPermission22 android.net.cts.ConnectivityManagerTest Change-Id: Icf4c7d2bb1da3c7db695cf0bcebc5806190a1677 --- .../com/android/server/ConnectivityService.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index 0ea2052b9f..683100954a 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -2796,20 +2796,6 @@ public class ConnectivityService extends IConnectivityManager.Stub } } - // TODO: remove this code once we know that the Slog.wtf is never hit. - // - // Find all networks that are satisfying this request and remove the request - // from their request lists. - // TODO - it's my understanding that for a request there is only a single - // network satisfying it, so this loop is wasteful - for (NetworkAgentInfo otherNai : mNetworkAgentInfos.values()) { - if (otherNai.isSatisfyingRequest(nri.request.requestId) && otherNai != nai) { - Slog.wtf(TAG, "Request " + nri.request + " satisfied by " + - otherNai.name() + ", but mNetworkAgentInfos says " + - (nai != null ? nai.name() : "null")); - } - } - // Maintain the illusion. When this request arrived, we might have pretended // that a network connected to serve it, even though the network was already // connected. Now that this request has gone away, we might have to pretend