diff --git a/emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java b/emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java index fe5fffe5f..3c5721a6b 100644 --- a/emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java +++ b/emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java @@ -108,19 +108,20 @@ public class EmailServiceProxy extends ServiceProxy implements IEmailService { * possible. * * @param cb The {@link IEmailServiceCallback} to use for this operation. + * @param accountId the id of the account in question * @param attachmentId the id of the attachment record * @param background whether or not this request corresponds to a background action (i.e. * prefetch) vs a foreground action (user request) */ @Override - public void loadAttachment(final IEmailServiceCallback cb, final long attachmentId, - final boolean background) + public void loadAttachment(final IEmailServiceCallback cb, final long accountId, + final long attachmentId, final boolean background) throws RemoteException { setTask(new ProxyTask() { @Override public void run() throws RemoteException { try { - mService.loadAttachment(cb, attachmentId, background); + mService.loadAttachment(cb, accountId, attachmentId, background); } catch (RemoteException e) { try { // Try to send a callback (if set) diff --git a/emailcommon/src/com/android/emailcommon/service/IEmailService.aidl b/emailcommon/src/com/android/emailcommon/service/IEmailService.aidl index 2e2ea46de..bb4041e13 100644 --- a/emailcommon/src/com/android/emailcommon/service/IEmailService.aidl +++ b/emailcommon/src/com/android/emailcommon/service/IEmailService.aidl @@ -27,7 +27,8 @@ interface IEmailService { // Core email operations. // TODO: is sendMail really necessary, or should we standardize on sync(outbox)? void sendMail(long accountId); - oneway void loadAttachment(IEmailServiceCallback cb, long attachmentId, boolean background); + oneway void loadAttachment(IEmailServiceCallback cb, long accountId, long attachmentId, + boolean background); oneway void updateFolderList(long accountId); // Push-related functionality. diff --git a/src/com/android/email/service/AttachmentDownloadService.java b/src/com/android/email/service/AttachmentDownloadService.java index 828dec20e..066464303 100644 --- a/src/com/android/email/service/AttachmentDownloadService.java +++ b/src/com/android/email/service/AttachmentDownloadService.java @@ -539,7 +539,7 @@ public class AttachmentDownloadService extends Service implements Runnable { req.startTime = System.currentTimeMillis(); req.inProgress = true; mDownloadsInProgress.put(req.attachmentId, req); - service.loadAttachment(mServiceCallback, req.attachmentId, + service.loadAttachment(mServiceCallback, req.accountId, req.attachmentId, req.priority != PRIORITY_FOREGROUND); setWatchdogAlarm(); } diff --git a/src/com/android/email/service/EmailServiceStub.java b/src/com/android/email/service/EmailServiceStub.java index e8507a017..b679620bb 100644 --- a/src/com/android/email/service/EmailServiceStub.java +++ b/src/com/android/email/service/EmailServiceStub.java @@ -119,8 +119,8 @@ public abstract class EmailServiceStub extends IEmailService.Stub implements IEm } @Override - public void loadAttachment(final IEmailServiceCallback cb, final long attachmentId, - final boolean background) throws RemoteException { + public void loadAttachment(final IEmailServiceCallback cb, final long accountId, + final long attachmentId, final boolean background) throws RemoteException { Folder remoteFolder = null; try { //1. Check if the attachment is already here and return early in that case diff --git a/src/com/android/email/service/EmailServiceUtils.java b/src/com/android/email/service/EmailServiceUtils.java index 1745f059d..df3b3daeb 100644 --- a/src/com/android/email/service/EmailServiceUtils.java +++ b/src/com/android/email/service/EmailServiceUtils.java @@ -660,8 +660,8 @@ public class EmailServiceUtils { } @Override - public void loadAttachment(final IEmailServiceCallback cb, final long attachmentId, - final boolean background) throws RemoteException { + public void loadAttachment(final IEmailServiceCallback cb, final long accountId, + final long attachmentId, final boolean background) throws RemoteException { } @Override diff --git a/src/com/android/email/service/Pop3Service.java b/src/com/android/email/service/Pop3Service.java index 7bff8001b..d94146ed9 100644 --- a/src/com/android/email/service/Pop3Service.java +++ b/src/com/android/email/service/Pop3Service.java @@ -76,8 +76,8 @@ public class Pop3Service extends Service { */ private final EmailServiceStub mBinder = new EmailServiceStub() { @Override - public void loadAttachment(final IEmailServiceCallback callback, final long attachmentId, - final boolean background) throws RemoteException { + public void loadAttachment(final IEmailServiceCallback callback, final long accountId, + final long attachmentId, final boolean background) throws RemoteException { Attachment att = Attachment.restoreAttachmentWithId(mContext, attachmentId); if (att == null || att.mUiState != AttachmentState.DOWNLOADING) return; long inboxId = Mailbox.findMailboxOfType(mContext, att.mAccountKey, Mailbox.TYPE_INBOX);