Merge "Rename setUidForeground to noteUidForeground" am: 8b7896b51a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2018880 Change-Id: Ibcc236d2807da26a9aeae3eab6d6b10361a58cb5
This commit is contained in:
@@ -4,6 +4,7 @@ package android.app.usage {
|
||||
public class NetworkStatsManager {
|
||||
method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void forceUpdate();
|
||||
method public static int getCollapsedRatType(int);
|
||||
method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void noteUidForeground(int, boolean);
|
||||
method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void notifyNetworkStatus(@NonNull java.util.List<android.net.Network>, @NonNull java.util.List<android.net.NetworkStateSnapshot>, @Nullable String, @NonNull java.util.List<android.net.UnderlyingNetworkInfo>);
|
||||
method @NonNull @WorkerThread public android.app.usage.NetworkStats queryDetailsForDevice(@NonNull android.net.NetworkTemplate, long, long);
|
||||
method @NonNull @WorkerThread public android.app.usage.NetworkStats queryDetailsForUidTagState(@NonNull android.net.NetworkTemplate, long, long, int, int, int) throws java.lang.SecurityException;
|
||||
@@ -15,7 +16,6 @@ package android.app.usage {
|
||||
method public void setPollForce(boolean);
|
||||
method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void setPollOnOpen(boolean);
|
||||
method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void setStatsProviderWarningAndLimitAsync(@NonNull String, long, long);
|
||||
method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void setUidForeground(int, boolean);
|
||||
field public static final int NETWORK_TYPE_5G_NSA = -2; // 0xfffffffe
|
||||
}
|
||||
|
||||
|
||||
@@ -517,10 +517,10 @@ public class NetworkStatsServiceTest extends NetworkStatsBaseTest {
|
||||
.insertEntry(TEST_IFACE, UID_RED, SET_FOREGROUND, TAG_NONE, 512L, 4L, 256L, 2L, 0L)
|
||||
.insertEntry(TEST_IFACE, UID_RED, SET_FOREGROUND, 0xFAAD, 256L, 2L, 128L, 1L, 0L)
|
||||
.insertEntry(TEST_IFACE, UID_BLUE, SET_DEFAULT, TAG_NONE, 128L, 1L, 128L, 1L, 0L));
|
||||
mService.setUidForeground(UID_RED, false);
|
||||
mService.noteUidForeground(UID_RED, false);
|
||||
verify(mUidCounterSetMap, never()).deleteEntry(any());
|
||||
mService.incrementOperationCount(UID_RED, 0xFAAD, 4);
|
||||
mService.setUidForeground(UID_RED, true);
|
||||
mService.noteUidForeground(UID_RED, true);
|
||||
verify(mUidCounterSetMap).updateEntry(
|
||||
eq(new U32(UID_RED)), eq(new U8((short) SET_FOREGROUND)));
|
||||
mService.incrementOperationCount(UID_RED, 0xFAAD, 6);
|
||||
@@ -1118,7 +1118,7 @@ public class NetworkStatsServiceTest extends NetworkStatsBaseTest {
|
||||
.insertEntry(TEST_IFACE, UID_RED, SET_DEFAULT, 0xF00D, 64L, 1L, 64L, 1L, 0L)
|
||||
.insertEntry(TEST_IFACE, UID_RED, SET_FOREGROUND, TAG_NONE, 32L, 2L, 32L, 2L, 0L)
|
||||
.insertEntry(TEST_IFACE, UID_RED, SET_FOREGROUND, 0xFAAD, 1L, 1L, 1L, 1L, 0L));
|
||||
mService.setUidForeground(UID_RED, true);
|
||||
mService.noteUidForeground(UID_RED, true);
|
||||
verify(mUidCounterSetMap).updateEntry(
|
||||
eq(new U32(UID_RED)), eq(new U8((short) SET_FOREGROUND)));
|
||||
mService.incrementOperationCount(UID_RED, 0xFAAD, 1);
|
||||
|
||||
Reference in New Issue
Block a user