Prevent backups from being scheduled twice within the jitter window.

Fixes #13559.
This commit is contained in:
Nicholas Tinsley
2024-07-01 17:01:02 -04:00
committed by Cody Henthorne
parent b113eec940
commit aec0a9951a
4 changed files with 43 additions and 9 deletions

View File

@@ -0,0 +1,18 @@
/*
* Copyright 2024 Signal Messenger, LLC
* SPDX-License-Identifier: AGPL-3.0-only
*/
package org.thoughtcrime.securesms.testutil
import java.util.LinkedList
import java.util.Random
class MockRandom(initialInts: List<Int>) : Random() {
val nextInts = LinkedList(initialInts)
override fun nextInt(): Int {
return nextInts.remove()
}
}