am 36cc9c18
: Fix NPE in AttachmentDownloadServiceTests.testDownloadSet
* commit '36cc9c18edb7ee897d0d758788b6e338cb2ef126': Fix NPE in AttachmentDownloadServiceTests.testDownloadSet
This commit is contained in:
commit
91551ae19b
@ -90,7 +90,7 @@ public class AttachmentDownloadService extends Service implements Runnable {
|
|||||||
/*package*/ static AttachmentDownloadService sRunningService = null;
|
/*package*/ static AttachmentDownloadService sRunningService = null;
|
||||||
|
|
||||||
/*package*/ Context mContext;
|
/*package*/ Context mContext;
|
||||||
Preferences mPreferences;
|
private final Preferences mPreferences;
|
||||||
/*package*/ final DownloadSet mDownloadSet = new DownloadSet(new DownloadComparator());
|
/*package*/ final DownloadSet mDownloadSet = new DownloadSet(new DownloadComparator());
|
||||||
|
|
||||||
private final HashMap<Long, Class<? extends Service>> mAccountServiceMap =
|
private final HashMap<Long, Class<? extends Service>> mAccountServiceMap =
|
||||||
@ -521,7 +521,7 @@ public class AttachmentDownloadService extends Service implements Runnable {
|
|||||||
}
|
}
|
||||||
// If we're an attachment on forwarded mail, and if we're not still blocked,
|
// If we're an attachment on forwarded mail, and if we're not still blocked,
|
||||||
// try to send pending mail now (as mediated by MailService)
|
// try to send pending mail now (as mediated by MailService)
|
||||||
if ((req != null) &&
|
if ((req != null) &&
|
||||||
!Utility.hasUnloadedAttachments(mContext, attachment.mMessageKey)) {
|
!Utility.hasUnloadedAttachments(mContext, attachment.mMessageKey)) {
|
||||||
if (Email.DEBUG) {
|
if (Email.DEBUG) {
|
||||||
Log.d(TAG, "== Downloads finished for outgoing msg #" + req.messageId);
|
Log.d(TAG, "== Downloads finished for outgoing msg #" + req.messageId);
|
||||||
@ -547,6 +547,10 @@ public class AttachmentDownloadService extends Service implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AttachmentDownloadService() {
|
||||||
|
mPreferences = Preferences.getPreferences(this);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate the download priority of an Attachment. A priority of zero means that the
|
* Calculate the download priority of an Attachment. A priority of zero means that the
|
||||||
* attachment is not marked for download.
|
* attachment is not marked for download.
|
||||||
@ -786,7 +790,6 @@ public class AttachmentDownloadService extends Service implements Runnable {
|
|||||||
public void run() {
|
public void run() {
|
||||||
mContext = this;
|
mContext = this;
|
||||||
mAccountManagerStub = new AccountManagerStub(this);
|
mAccountManagerStub = new AccountManagerStub(this);
|
||||||
mPreferences = Preferences.getPreferences(this);
|
|
||||||
|
|
||||||
// Run through all attachments in the database that require download and add them to
|
// Run through all attachments in the database that require download and add them to
|
||||||
// the queue
|
// the queue
|
||||||
|
Loading…
Reference in New Issue
Block a user