Email下载附件走如下流程

首先在MesssageViewFragmentBase.java

下载附件走如下流程:首先在MesssageViewFragmentBase.javaonLoadAttachment方法中调用loadAttachment,会通过附件下载任务EmailAsyncTask,将其添加到下载队列mDownloadSet

 

1096899728,com.android.email/.Controller$Controllerservice,,4675]

com.android.email.service.AttachmentDownloadService$DownloadSet.startDownload(AttachmentDownloadService.java:509)

com.android.email.service.AttachmentDownloadService$DownloadSet.tryStartDownload(AttachmentDownloadService.java:465)

com.android.email.service.AttachmentDownloadService$DownloadSet.processQueue(AttachmentDownloadService.java:341)

com.android.email.service.AttachmentDownloadService.run(AttachmentDownloadService.java:929)

启动EmailAsyncTask

添加到mDownloadSet的队列中

 

然后在AttachmentDownloadService.java中通过

processQueue处理下载队列中的附件,执行:mDownloadSet.tryStartDownload(req);——>j

进一步在tryStartDownload中调用startDownload执行proxy.loadAttachment(req.attachmentId, req.priority != PRIORITY_FOREGROUND);其中proxyEmailServiceProxy对象,EmailServiceProxyEmail邮件下载同步的执行类——>

而在EmailServiceProxy中,通过IEmailService.aidl去执行loadAttachment进行附件下载。

EmailServiceProxy类中

 

public void onConnected(IBinder binder) {

        mService = IEmailService.Stub.asInterface(binder);

}

loadAttachment

ControllerService类中

private final IEmailService.Stub mBinder = new IEmailService.Stub()  绑定

其中loadAttachment这个方法进行处理

MessagingController legacyController = sInstance.mLegacyController;

                        LegacyListener legacyListener = sInstance.mLegacyListener;

                        legacyController.loadAttachment(msg.mAccountKey, msg.mId, msg.mMailboxKey,

                                attachmentId, legacyListener, background);

 

 

之后执行MessagingController中的loadAttachment

com.android.email.MessagingController.run(MessagingController.java:207)

com.android.email.MessagingController$11.run(MessagingController.java:2029)

 

 

com.android.email.mail.store.ImapFolder.open(ImapFolder.java:129)

com.android.email.mail.store.ImapFolder.doSelect(ImapFolder.java:1106)

 

com.android.email.mail.store.ImapConnection.executeSimpleCommand(ImapConnection.java:287)

 

com.android.email.mail.store.ImapConnection.executeSimpleCommand(ImapConnection.java:325)

com.android.email.mail.store.ImapConnection.sendCommand(ImapConnection.java:243)

 

com.android.email.mail.store.ImapConnection.open(ImapConnection.java:109)

 

com.android.email.mail.transport.MailTransport.open(MailTransport.java:182)

 

com.android.email.MessagingController.run(MessagingController.java:207)

 

 

transport.MailTransport.close()

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值