From b7a2de3572eb26f0cfff236e4f7f9d6d8624560f Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Wed, 26 Aug 2020 10:42:22 +1000 Subject: [PATCH 1/2] Let AttachmentUploadJob handle retrying This way we can better handle e.g. authorization issues --- src/org/thoughtcrime/securesms/jobs/AttachmentUploadJob.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/jobs/AttachmentUploadJob.java b/src/org/thoughtcrime/securesms/jobs/AttachmentUploadJob.java index f1c721718c..766e8f20f6 100644 --- a/src/org/thoughtcrime/securesms/jobs/AttachmentUploadJob.java +++ b/src/org/thoughtcrime/securesms/jobs/AttachmentUploadJob.java @@ -52,7 +52,7 @@ public class AttachmentUploadJob extends BaseJob implements InjectableType { this(new Job.Parameters.Builder() .addConstraint(NetworkConstraint.KEY) .setLifespan(TimeUnit.DAYS.toMillis(1)) - .setMaxAttempts(1) + .setMaxAttempts(5) .build(), attachmentId, destination); } From 019af3e7ee1b8b726fbcb49d36a5b4cc37782813 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Thu, 27 Aug 2020 11:16:39 +1000 Subject: [PATCH 2/2] Clean --- src/org/thoughtcrime/securesms/util/ResUtil.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/util/ResUtil.java b/src/org/thoughtcrime/securesms/util/ResUtil.java index 555f11e365..f4215de9f0 100644 --- a/src/org/thoughtcrime/securesms/util/ResUtil.java +++ b/src/org/thoughtcrime/securesms/util/ResUtil.java @@ -22,13 +22,14 @@ import android.content.res.Resources; import android.content.res.Resources.Theme; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; +import android.util.TypedValue; + import androidx.annotation.ArrayRes; import androidx.annotation.AttrRes; import androidx.annotation.DimenRes; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.core.content.ContextCompat; -import android.util.TypedValue; import org.thoughtcrime.securesms.logging.Log; @@ -57,7 +58,7 @@ public class ResUtil { int drawableRes = getDrawableRes(c, attr); if (drawableRes == 0) { Log.e(TAG, "Cannot find a drawable resource associated with the attribute: " + attr, - new Resources.NotFoundException()); + new Resources.NotFoundException()); return null; } return ContextCompat.getDrawable(c, drawableRes);