Replace prekey jobs with one overall sync job.

This commit is contained in:
Cody Henthorne
2022-08-16 15:58:43 -04:00
parent 2740b5e300
commit 3252871ed5
21 changed files with 433 additions and 418 deletions

View File

@@ -4,6 +4,7 @@ import android.content.Context;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.annotation.WorkerThread;
import org.signal.core.util.logging.Log;
@@ -14,6 +15,8 @@ import java.util.Map;
import java.util.Objects;
import java.util.UUID;
import static androidx.annotation.VisibleForTesting.PACKAGE_PRIVATE;
/**
* A durable unit of work.
*
@@ -193,15 +196,18 @@ public abstract class Job {
return new Result(ResultType.FAILURE, runtimeException, null, INVALID_BACKOFF);
}
boolean isSuccess() {
@VisibleForTesting(otherwise = PACKAGE_PRIVATE)
public boolean isSuccess() {
return resultType == ResultType.SUCCESS;
}
boolean isRetry() {
@VisibleForTesting(otherwise = PACKAGE_PRIVATE)
public boolean isRetry() {
return resultType == ResultType.RETRY;
}
boolean isFailure() {
@VisibleForTesting(otherwise = PACKAGE_PRIVATE)
public boolean isFailure() {
return resultType == ResultType.FAILURE;
}