Allow test networks to be rate limited
Test: atest FrameworksNetTests Change-Id: I7e6e84baf446ecf4b395f6a611e625871745a20e
This commit is contained in:
@@ -10684,8 +10684,11 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
}
|
||||
|
||||
private boolean canNetworkBeRateLimited(@NonNull final NetworkAgentInfo networkAgent) {
|
||||
if (!networkAgent.networkCapabilities.hasCapability(NET_CAPABILITY_INTERNET)) {
|
||||
// rate limits only apply to networks that provide internet connectivity.
|
||||
final NetworkCapabilities agentCaps = networkAgent.networkCapabilities;
|
||||
// Only test networks (they cannot hold NET_CAPABILITY_INTERNET) and networks that provide
|
||||
// internet connectivity can be rate limited.
|
||||
if (!agentCaps.hasCapability(NET_CAPABILITY_INTERNET) && !agentCaps.hasTransport(
|
||||
TRANSPORT_TEST)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user