summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nikita Iashchenko <nikitai@google.com> 2021-06-04 08:37:09 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2021-06-04 08:37:09 +0000
commit71afce9340799f746bfe9bbdb9cdeb01cbeca8d8 (patch)
tree21e0dc7e785e050d3289f4bfcf7468584881e13e
parent2090502b46c986af5a7d1b2773854761039ffddf (diff)
parent8d98e824d6efdff97e05614dbfc2a49fa68bfee9 (diff)
Merge "Remove usage of Math.randomLongInternal"
-rw-r--r--services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java5
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