diff options
| author | 2021-04-20 23:22:03 +0000 | |
|---|---|---|
| committer | 2021-04-28 14:03:37 +0000 | |
| commit | 8d98e824d6efdff97e05614dbfc2a49fa68bfee9 (patch) | |
| tree | 40ca81e2684ea0252f7adfd3e41205b8f6f17e60 | |
| parent | 319fe85e6e3010241dd79514d1b65eefe65942ec (diff) | |
Remove usage of Math.randomLongInternal
As a part of internal libcore API cleanup some of the functions
previously exposed are getting removed from public surface.
Math#randomLongInternal is a wrapper around java.util.Random and has no
specific implications so its usages are get refactored.
Bug: 154796679
Test: m droid
Change-Id: I019000d2b35c256e7c8a251a95bd9384d3503335
| -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 |