File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
main/java/com/google/firebase/perf/config
test/java/com/google/firebase/perf/config Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 27
27
import com .google .firebase .remoteconfig .FirebaseRemoteConfigValue ;
28
28
import com .google .firebase .remoteconfig .RemoteConfigComponent ;
29
29
import java .util .Map ;
30
+ import java .util .Random ;
30
31
import java .util .concurrent .ConcurrentHashMap ;
31
32
import java .util .concurrent .Executor ;
32
33
import java .util .concurrent .LinkedBlockingQueue ;
33
- import java .util .concurrent .ThreadLocalRandom ;
34
34
import java .util .concurrent .ThreadPoolExecutor ;
35
35
import java .util .concurrent .TimeUnit ;
36
36
@@ -50,7 +50,7 @@ public class RemoteConfigManager {
50
50
TimeUnit .HOURS .toMillis (12 );
51
51
private static final long FETCH_NEVER_HAPPENED_TIMESTAMP_MS = 0 ;
52
52
private static final long MIN_APP_START_CONFIG_FETCH_DELAY_MS = 5000 ;
53
- private static final long RANDOM_APP_START_CONFIG_FETCH_DELAY_MS = 25000 ;
53
+ private static final int RANDOM_APP_START_CONFIG_FETCH_DELAY_MS = 25000 ;
54
54
55
55
private final ConcurrentHashMap <String , FirebaseRemoteConfigValue > allRcConfigMap ;
56
56
private final Executor executor ;
@@ -79,7 +79,7 @@ private RemoteConfigManager() {
79
79
executor ,
80
80
firebaseRemoteConfig ,
81
81
MIN_APP_START_CONFIG_FETCH_DELAY_MS
82
- + ThreadLocalRandom . current ().nextLong (RANDOM_APP_START_CONFIG_FETCH_DELAY_MS ));
82
+ + new Random ().nextInt (RANDOM_APP_START_CONFIG_FETCH_DELAY_MS ));
83
83
}
84
84
85
85
@ VisibleForTesting
Original file line number Diff line number Diff line change @@ -878,14 +878,14 @@ private RemoteConfigManager setupTestRemoteConfigManager(
878
878
Task <Boolean > fakeTask ,
879
879
boolean initializeFrc ,
880
880
Map <String , FirebaseRemoteConfigValue > configs ,
881
- long fetchDelay ) {
881
+ long appStartConfigFetchDelayInMs ) {
882
882
simulateFirebaseRemoteConfigLastFetchStatus (FirebaseRemoteConfig .LAST_FETCH_STATUS_SUCCESS );
883
883
when (mockFirebaseRemoteConfig .fetchAndActivate ()).thenReturn (fakeTask );
884
884
when (mockFirebaseRemoteConfig .getAll ()).thenReturn (configs );
885
885
if (initializeFrc ) {
886
- return new RemoteConfigManager (fakeExecutor , mockFirebaseRemoteConfig , fetchDelay );
886
+ return new RemoteConfigManager (fakeExecutor , mockFirebaseRemoteConfig , appStartConfigFetchDelayInMs );
887
887
} else {
888
- return new RemoteConfigManager (fakeExecutor , /* firebaseRemoteConfig= */ null , fetchDelay );
888
+ return new RemoteConfigManager (fakeExecutor , /* firebaseRemoteConfig= */ null , appStartConfigFetchDelayInMs );
889
889
}
890
890
}
891
891
You can’t perform that action at this time.
0 commit comments