From 9e449649eb79b0277a58f709e7b88d581d40e0fd Mon Sep 17 00:00:00 2001 From: Almaz Mingaleev Date: Thu, 9 Jun 2022 11:54:28 +0100 Subject: [PATCH] Do not preload ThreadLocalRandom class. ThreadLocalRandom.seeder field uses time in its initialization. Preloading the class fixes initial state of ThreadLocalRandom, which leads to the same sequence of generated numbers across different app runs. Bug: 234816154 Test: verified manually that TLR.current().nextInt does not return the same sequence of numbers. Change-Id: I80868217e02862e8d0a568ea096e22e919ec06e3 --- config/preloaded-classes | 1 - config/preloaded-classes-denylist | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/config/preloaded-classes b/config/preloaded-classes index f2530519247fd..40388c2c5da83 100644 --- a/config/preloaded-classes +++ b/config/preloaded-classes @@ -14588,7 +14588,6 @@ java.util.concurrent.SynchronousQueue$TransferStack java.util.concurrent.SynchronousQueue$Transferer java.util.concurrent.SynchronousQueue java.util.concurrent.ThreadFactory -java.util.concurrent.ThreadLocalRandom java.util.concurrent.ThreadPoolExecutor$AbortPolicy java.util.concurrent.ThreadPoolExecutor$DiscardPolicy java.util.concurrent.ThreadPoolExecutor$Worker diff --git a/config/preloaded-classes-denylist b/config/preloaded-classes-denylist index da4b25519e80c..02f2df6167a57 100644 --- a/config/preloaded-classes-denylist +++ b/config/preloaded-classes-denylist @@ -8,3 +8,4 @@ gov.nist.core.net.DefaultNetworkLayer android.net.rtp.AudioGroup android.net.rtp.AudioStream android.net.rtp.RtpStream +java.util.concurrent.ThreadLocalRandom