Add comments to explain why mayCloseSockets is called twice.

Test: m
Change-Id: Ide8a5b649c7bda26c41e3d11a5071eb1af7ae0a2
This commit is contained in:
Motomu Utsumi
2023-03-13 13:24:50 +09:00
parent 259ccb34a4
commit 6345e4666a

View File

@@ -8467,6 +8467,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
exemptUids[1] = nai.networkCapabilities.getOwnerUid();
UidRangeParcel[] ranges = toUidRangeStableParcels(uidRanges);
// Close sockets before modifying uid ranges so that RST packets can reach to the server.
maybeCloseSockets(nai, ranges, exemptUids);
try {
if (add) {
@@ -8480,6 +8481,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
loge("Exception while " + (add ? "adding" : "removing") + " uid ranges " + uidRanges +
" on netId " + nai.network.netId + ". " + e);
}
// Close sockets that established connection while requesting netd.
maybeCloseSockets(nai, ranges, exemptUids);
}