Fix rate limit API review comments
Follow up to aosp/1955583 to fix some review comments. Test: builds Bug: 219739904 Change-Id: Ie85dc72eb3bb6eda26b655a64eae0d7c0d8bf143
This commit is contained in:
@@ -92,7 +92,7 @@ package android.net {
|
|||||||
method public static void setDnsResolverSampleValidityDuration(@NonNull android.content.Context, @NonNull java.time.Duration);
|
method public static void setDnsResolverSampleValidityDuration(@NonNull android.content.Context, @NonNull java.time.Duration);
|
||||||
method public static void setDnsResolverSuccessThresholdPercent(@NonNull android.content.Context, @IntRange(from=0, to=100) int);
|
method public static void setDnsResolverSuccessThresholdPercent(@NonNull android.content.Context, @IntRange(from=0, to=100) int);
|
||||||
method public static void setGlobalProxy(@NonNull android.content.Context, @NonNull android.net.ProxyInfo);
|
method public static void setGlobalProxy(@NonNull android.content.Context, @NonNull android.net.ProxyInfo);
|
||||||
method public static void setIngressRateLimitInBytesPerSecond(@NonNull android.content.Context, @IntRange(from=0xffffffff, to=java.lang.Integer.MAX_VALUE) long);
|
method public static void setIngressRateLimitInBytesPerSecond(@NonNull android.content.Context, @IntRange(from=-1L, to=4294967295L) long);
|
||||||
method public static void setMobileDataActivityTimeout(@NonNull android.content.Context, @NonNull java.time.Duration);
|
method public static void setMobileDataActivityTimeout(@NonNull android.content.Context, @NonNull java.time.Duration);
|
||||||
method public static void setMobileDataAlwaysOn(@NonNull android.content.Context, boolean);
|
method public static void setMobileDataAlwaysOn(@NonNull android.content.Context, boolean);
|
||||||
method public static void setMobileDataPreferredUids(@NonNull android.content.Context, @NonNull java.util.Set<java.lang.Integer>);
|
method public static void setMobileDataPreferredUids(@NonNull android.content.Context, @NonNull java.util.Set<java.lang.Integer>);
|
||||||
|
|||||||
@@ -1081,10 +1081,10 @@ public class ConnectivitySettingsManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the global network bandwidth rate limit.
|
* Get the network bandwidth ingress rate limit.
|
||||||
*
|
*
|
||||||
* The limit is only applicable to networks that provide internet connectivity. If the setting
|
* The limit is only applicable to networks that provide internet connectivity. -1 codes for no
|
||||||
* is unset, it defaults to -1.
|
* bandwidth limitation.
|
||||||
*
|
*
|
||||||
* @param context The {@link Context} to query the setting.
|
* @param context The {@link Context} to query the setting.
|
||||||
* @return The rate limit in number of bytes per second or -1 if disabled.
|
* @return The rate limit in number of bytes per second or -1 if disabled.
|
||||||
@@ -1095,15 +1095,17 @@ public class ConnectivitySettingsManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the global network bandwidth rate limit.
|
* Set the network bandwidth ingress rate limit.
|
||||||
*
|
*
|
||||||
* The limit is only applicable to networks that provide internet connectivity.
|
* The limit is applied to all networks that provide internet connectivity. It is applied on a
|
||||||
|
* per-network basis, meaning that global ingress rate could exceed the limit when communicating
|
||||||
|
* on multiple networks simultaneously.
|
||||||
*
|
*
|
||||||
* @param context The {@link Context} to set the setting.
|
* @param context The {@link Context} to set the setting.
|
||||||
* @param rateLimitInBytesPerSec The rate limit in number of bytes per second or -1 to disable.
|
* @param rateLimitInBytesPerSec The rate limit in number of bytes per second or -1 to disable.
|
||||||
*/
|
*/
|
||||||
public static void setIngressRateLimitInBytesPerSecond(@NonNull Context context,
|
public static void setIngressRateLimitInBytesPerSecond(@NonNull Context context,
|
||||||
@IntRange(from = -1, to = Integer.MAX_VALUE) long rateLimitInBytesPerSec) {
|
@IntRange(from = -1L, to = 0xFFFFFFFFL) long rateLimitInBytesPerSec) {
|
||||||
if (rateLimitInBytesPerSec < -1) {
|
if (rateLimitInBytesPerSec < -1) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"Rate limit must be within the range [-1, Integer.MAX_VALUE]");
|
"Rate limit must be within the range [-1, Integer.MAX_VALUE]");
|
||||||
|
|||||||
Reference in New Issue
Block a user