Genericize NC#hasSameUids

This will be used by another set of UIDs in a future patch

Test: FrameworksNetTests
Change-Id: I2c5d18ef93e73b702723814592ef3f3baf5dfbc4
This commit is contained in:
Chalard Jean 2021-12-13 21:37:12 +09:00
commit f4802fa4c2

View file

@ -7705,7 +7705,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
// changed.
// TODO: Try to track the default network that apps use and only send a proxy broadcast when
// that happens to prevent false alarms.
if (nai.isVPN() && nai.everConnected && !NetworkCapabilities.hasSameUids(prevNc, newNc)
final Set<UidRange> prevUids = prevNc == null ? null : prevNc.getUidRanges();
final Set<UidRange> newUids = newNc == null ? null : newNc.getUidRanges();
if (nai.isVPN() && nai.everConnected && !UidRange.hasSameUids(prevUids, newUids)
&& (nai.linkProperties.getHttpProxy() != null || isProxySetOnAnyDefaultNetwork())) {
mProxyTracker.sendProxyBroadcast();
}