Stop logging false error when lingering completes.
When lingering completes ConnectivityService would log an error message
saying the Network still had NetworkRequests. Fixed by ignoring
listening NetworkRequests which aren't a problem.
Change-Id: Ie78a1f91c47b012eae28a377dd77bee2cfcbde3b
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index c3b56fe..a811bb9 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -4436,10 +4436,14 @@
loge("Unknown NetworkAgentInfo in handleLingerComplete");
return;
}
- if (DBG) log("handleLingerComplete for " + oldNetwork.name());
if (DBG) {
- if (oldNetwork.networkRequests.size() != 0) {
- loge("Dead network still had " + oldNetwork.networkRequests.size() + " requests");
+ log("handleLingerComplete for " + oldNetwork.name());
+ for (int i = 0; i < oldNetwork.networkRequests.size(); i++) {
+ NetworkRequest nr = oldNetwork.networkRequests.valueAt(i);
+ // Ignore listening requests.
+ if (mNetworkRequests.get(nr).isRequest == false) continue;
+ loge("Dead network still had at least " + nr);
+ break;
}
}
oldNetwork.asyncChannel.disconnect();