fix persistent stale attachment jobs

Closes #4041
// FREEBIE
This commit is contained in:
Jake McGinty 2015-09-07 11:32:11 -10:00 committed by Moxie Marlinspike
parent adc6fc8524
commit 21b7dccf1c
2 changed files with 7 additions and 2 deletions

View File

@ -67,6 +67,11 @@ public class AttachmentDownloadJob extends MasterSecretJob implements Injectable
final PartId partId = new PartId(partRowId, partUniqueId);
final PduPart part = DatabaseFactory.getPartDatabase(context).getPart(partId);
if (part == null) {
Log.w(TAG, "part no longer exists.");
return;
}
Log.w(TAG, "Downloading push part " + partId);
retrievePart(masterSecret, part, messageId);

View File

@ -78,8 +78,8 @@ public class MediaNetworkRequirement implements Requirement, ContextDependent {
final PartDatabase db = DatabaseFactory.getPartDatabase(context);
final PduPart part = db.getPart(partId);
if (part == null) {
Log.w(TAG, "part was null");
return false;
Log.w(TAG, "part was null, returning vacuous true");
return true;
}
Log.w(TAG, "part transfer progress is " + part.getTransferProgress());