Start mirroring to SVR2.

This commit is contained in:
Greyson Parrelli
2023-07-05 19:05:30 -04:00
committed by Clark Chen
parent dfb7304626
commit e1570e9512
111 changed files with 1828 additions and 2299 deletions

View File

@@ -8,6 +8,8 @@ import androidx.annotation.VisibleForTesting;
import androidx.annotation.WorkerThread;
import org.signal.core.util.logging.Log;
import org.thoughtcrime.securesms.jobmanager.impl.BackoffUtil;
import org.thoughtcrime.securesms.util.FeatureFlags;
import java.util.LinkedList;
import java.util.List;
@@ -93,6 +95,12 @@ public abstract class Job {
this.canceled = true;
}
/** Provides a default exponential backoff given the current run attempt. */
protected final long defaultBackoff() {
return BackoffUtil.exponentialBackoff(runAttempt + 1, FeatureFlags.getDefaultMaxBackoff());
}
@WorkerThread
final void onSubmit() {
Log.i(TAG, JobLogger.format(this, "onSubmit()"));
@@ -196,7 +204,6 @@ public abstract class Job {
return new Result(ResultType.FAILURE, runtimeException, null, INVALID_BACKOFF);
}
@VisibleForTesting(otherwise = PACKAGE_PRIVATE)
public boolean isSuccess() {
return resultType == ResultType.SUCCESS;
}