private static final boolean ENABLE_NETWORK_COEXIST = true; 这里设置true。
private void teardownUnneededNetwork(NetworkAgentInfo nai) {
if (nai.numRequestNetworkRequests() != 0) {
for (int i = 0; i < nai.numNetworkRequests(); i++) {
NetworkRequest nr = nai.requestAt(i);
// Ignore listening requests.
if (nr.isListen()) continue;
loge("Dead network still had at least " + nr);
break;
}
}
if (ENABLE_NETWORK_COEXIST) {
log("Skip teardownUnneededNetwork: " + nai.name());
} else {
//Markby denglijun 20201123
nai.asyncChannel.disconnect();
//End Mark
}
}