convert rawFolders into a blob/Parcel

Requires CL I42eadd.

Bug: 7690709
Change-Id: I303f3c5479402a0eed9037ba2c95e00bdc7087b8
This commit is contained in:
Andy Huang 2012-12-07 19:33:24 -08:00
parent 017dc48ff6
commit 68a3607895

View File

@ -79,6 +79,7 @@ import com.android.emailcommon.utility.AttachmentUtilities;
import com.android.emailcommon.utility.Utility; import com.android.emailcommon.utility.Utility;
import com.android.ex.photo.provider.PhotoContract; import com.android.ex.photo.provider.PhotoContract;
import com.android.mail.providers.Folder; import com.android.mail.providers.Folder;
import com.android.mail.providers.FolderList;
import com.android.mail.providers.UIProvider; import com.android.mail.providers.UIProvider;
import com.android.mail.providers.UIProvider.AccountCapabilities; import com.android.mail.providers.UIProvider.AccountCapabilities;
import com.android.mail.providers.UIProvider.AccountCursorExtraKeys; import com.android.mail.providers.UIProvider.AccountCursorExtraKeys;
@ -3960,15 +3961,15 @@ outer:
putIntegerLongOrBoolean(ourValues, MessageColumns.MAILBOX_KEY, val); putIntegerLongOrBoolean(ourValues, MessageColumns.MAILBOX_KEY, val);
} else if (columnName.equals(UIProvider.ConversationColumns.RAW_FOLDERS)) { } else if (columnName.equals(UIProvider.ConversationColumns.RAW_FOLDERS)) {
// Convert from folder list uri to mailbox key // Convert from folder list uri to mailbox key
ArrayList<Folder> folders = Folder.getFoldersArray((String) val); final FolderList flist = FolderList.fromBlob(values.getAsByteArray(columnName));
if (folders == null || folders.size() == 0 || folders.size() > 1) { if (flist.folders.size() != 1) {
LogUtils.d(TAG, LogUtils.e(TAG,
"Incorrect number of folders for this message: Message is %s", "Incorrect number of folders for this message: Message is %s",
message.mId); message.mId);
} else { } else {
Folder f = folders.get(0); final Folder f = flist.folders.get(0);
Uri uri = f.uri; final Uri uri = f.uri;
Long mailboxId = Long.parseLong(uri.getLastPathSegment()); final Long mailboxId = Long.parseLong(uri.getLastPathSegment());
putIntegerLongOrBoolean(ourValues, MessageColumns.MAILBOX_KEY, mailboxId); putIntegerLongOrBoolean(ourValues, MessageColumns.MAILBOX_KEY, mailboxId);
} }
} else if (columnName.equals(UIProvider.MessageColumns.ALWAYS_SHOW_IMAGES)) { } else if (columnName.equals(UIProvider.MessageColumns.ALWAYS_SHOW_IMAGES)) {