Merge "Don't attempt to enable rate-limiting before T."

This commit is contained in:
Treehugger Robot 2022-03-07 15:51:32 +00:00 • committed by Gerrit Code Review
commit 33f4e14073

View file

@ -10699,6 +10699,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
}
private boolean canNetworkBeRateLimited(@NonNull final NetworkAgentInfo networkAgent) {
// Rate-limiting cannot run correctly before T because the BPF program is not loaded.
if (!SdkLevel.isAtLeastT()) return false;
final NetworkCapabilities agentCaps = networkAgent.networkCapabilities;
// Only test networks (they cannot hold NET_CAPABILITY_INTERNET) and networks that provide
// internet connectivity can be rate limited.