am 1a0aa22d: Cut down on some unneccesary allocations

* commit '1a0aa22dc02fdfc6876ee90926acc447da8fe935':
  Cut down on some unneccesary allocations
This commit is contained in:
Martin Hibdon 2013-08-16 14:41:28 -07:00 committed by Android Git Automerger
commit d20f163913

View File

@ -247,6 +247,7 @@ public class ImapService extends Service {
FetchProfile fp = new FetchProfile();
fp.add(FetchProfile.Item.STRUCTURE);
remoteFolder.fetch(messages.toArray(new Message[messages.size()]), fp, null);
Message [] oneMessageArray = new Message[1];
for (Message message : messages) {
// Build a list of parts we are interested in. Text parts will be downloaded
// right now, attachments will be left for later.
@ -254,10 +255,11 @@ public class ImapService extends Service {
ArrayList<Part> attachments = new ArrayList<Part>();
MimeUtility.collectParts(message, viewables, attachments);
// Download the viewables immediately
oneMessageArray[0] = message;
for (Part part : viewables) {
fp.clear();
fp.add(part);
remoteFolder.fetch(new Message[] { message }, fp, null);
remoteFolder.fetch(oneMessageArray, fp, null);
}
// Store the updated message locally and mark it fully loaded
Utilities.copyOneMessageToProvider(context, message, account, toMailbox,