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 Merged-In: I019000d2b35c256e7c8a251a95bd9384d3503335 Change-Id: I019000d2b35c256e7c8a251a95bd9384d3503335
This commit is contained in:
committed by
Victor Chang
parent
dc07d29bd0
commit
2614378b0b
@@ -114,6 +114,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;
|
||||
@@ -166,6 +167,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;
|
||||
|
||||
@@ -294,7 +297,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
|
||||
|
||||
Reference in New Issue
Block a user