[MS68.3] Address comments at aosp/1958144
Test: atest TrafficStatsTest NetworkUsageStatsTest FrameworksNetTests Bug: 204830222 (cherry-picked from ag/16813003) Change-Id: I5a54b44294021d64d8506eeb570db0db8544472a Merged-In: I5a54b44294021d64d8506eeb570db0db8544472a
This commit is contained in:
@@ -740,8 +740,9 @@ public class NetworkStatsManager {
|
||||
* {@link #unregisterUsageCallback} is called.
|
||||
*
|
||||
* @param template Template used to match networks. See {@link NetworkTemplate}.
|
||||
* @param thresholdBytes Threshold in bytes to be notified on. The provided value that lower
|
||||
* than 2MiB will be clamped for non-privileged callers.
|
||||
* @param thresholdBytes Threshold in bytes to be notified on. Provided values lower than 2MiB
|
||||
* will be clamped for callers except callers with the NETWORK_STACK
|
||||
* permission.
|
||||
* @param executor The executor on which callback will be invoked. The provided {@link Executor}
|
||||
* must run callback sequentially, otherwise the order of callbacks cannot be
|
||||
* guaranteed.
|
||||
@@ -750,6 +751,9 @@ public class NetworkStatsManager {
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi(client = MODULE_LIBRARIES)
|
||||
@RequiresPermission(anyOf = {
|
||||
NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK,
|
||||
android.Manifest.permission.NETWORK_STACK}, conditional = true)
|
||||
public void registerUsageCallback(@NonNull NetworkTemplate template, long thresholdBytes,
|
||||
@NonNull @CallbackExecutor Executor executor, @NonNull UsageCallback callback) {
|
||||
Objects.requireNonNull(template, "NetworkTemplate cannot be null");
|
||||
|
||||
Reference in New Issue
Block a user