Don't attempt to enable rate-limiting before T.
Rate-limiting cannot work because the BPF program is in the mainline version of netd.c, which is placed into net_shared and thus cannot run pre-T. Disable it entirely to ensure no impact on S. Test: atest ConnectivityCoverageTests:com.android.server.ConnectivityServiceTest on AOSP Test: atest ConnectivityCoverageTests:com.android.server.ConnectivityServiceTest on S Change-Id: I47521a100f8287ecdece25e810db8f3cade46778
This commit is contained in:
parent
3b45bca306
commit
f79dcecf9b
1 changed files with 32 additions and 5 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue