diff options
| author | Lorenzo Colitti <lorenzo@google.com> | 2022-03-15 23:33:26 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2022-03-15 23:33:26 +0000 |
| commit | 8b7896b51a6d25f6e3b20e552831d8f29bedf413 (patch) | |
| tree | 1b9ca7e77d6f60aea74e0b2f95904831d6bee250 | |
| parent | c8fadc5cde1f8df23a85425a7a0e06d625aa4c36 (diff) | |
| parent | 5417280f17f02a4bf1ccd6d7ac17e5a5b4e74d78 (diff) | |
Merge "Rename setUidForeground to noteUidForeground"
| -rw-r--r-- | framework-t/api/module-lib-current.txt | 2 | ||||
| -rw-r--r-- | tests/unit/java/com/android/server/net/NetworkStatsServiceTest.java | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/framework-t/api/module-lib-current.txt b/framework-t/api/module-lib-current.txt index aaaa628b20..16308ac59c 100644 --- a/framework-t/api/module-lib-current.txt +++ b/framework-t/api/module-lib-current.txt @@ -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 } diff --git a/tests/unit/java/com/android/server/net/NetworkStatsServiceTest.java b/tests/unit/java/com/android/server/net/NetworkStatsServiceTest.java index aa4e4bbf63..ceeb997ff6 100644 --- a/tests/unit/java/com/android/server/net/NetworkStatsServiceTest.java +++ b/tests/unit/java/com/android/server/net/NetworkStatsServiceTest.java @@ -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); |
