diff options
| author | 2021-06-04 08:37:09 +0000 | |
|---|---|---|
| committer | 2021-06-04 08:37:09 +0000 | |
| commit | 71afce9340799f746bfe9bbdb9cdeb01cbeca8d8 (patch) | |
| tree | 21e0dc7e785e050d3289f4bfcf7468584881e13e | |
| parent | 2090502b46c986af5a7d1b2773854761039ffddf (diff) | |
| parent | 8d98e824d6efdff97e05614dbfc2a49fa68bfee9 (diff) | |
Merge "Remove usage of Math.randomLongInternal"
| -rw-r--r-- | services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java b/services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java index 1ced467dffa1..9860d51f36b0 100644 --- a/services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java +++ b/services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java @@ -92,6 +92,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.Random; import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -137,6 +138,8 @@ public class AppStandbyControllerTests { /** Mock variable used in {@link MyInjector#isPackageInstalled(String, int, int)} */ private static boolean isPackageInstalled = true; + private static final Random sRandom = new Random(); + private MyInjector mInjector; private AppStandbyController mController; @@ -238,7 +241,7 @@ public class AppStandbyControllerTests { @Override File getDataSystemDirectory() { - return new File(getContext().getFilesDir(), Long.toString(Math.randomLongInternal())); + return new File(getContext().getFilesDir(), Long.toString(sRandom.nextLong())); } @Override |