am 16818400: am 5ed8b266: Fix some problems with move message

* commit '16818400fc2f01d051e26f0ea4175d1822d6ad66':
  Fix some problems with move message
This commit is contained in:
Paul Westbrook 2013-03-14 23:15:45 +00:00 committed by Android Git Automerger
commit 6e07e9df75

View File

@ -2620,12 +2620,13 @@ outer:
if (info != null && info.offerLookback) { if (info != null && info.offerLookback) {
// Protocols supporting lookback support settings // Protocols supporting lookback support settings
caps |= UIProvider.FolderCapabilities.SUPPORTS_SETTINGS; caps |= UIProvider.FolderCapabilities.SUPPORTS_SETTINGS;
}
if ((flags & Mailbox.FLAG_ACCEPTS_MOVED_MAIL) != 0) { if ((flags & Mailbox.FLAG_ACCEPTS_MOVED_MAIL) != 0) {
// If the mailbox can accept moved mail, report that as well // If the mailbox can accept moved mail, report that as well
caps |= UIProvider.FolderCapabilities.CAN_ACCEPT_MOVED_MESSAGES; caps |= UIProvider.FolderCapabilities.CAN_ACCEPT_MOVED_MESSAGES;
caps |= UIProvider.FolderCapabilities.ALLOWS_REMOVE_CONVERSATION; caps |= UIProvider.FolderCapabilities.ALLOWS_REMOVE_CONVERSATION;
} }
}
// For trash, we don't allow undo // For trash, we don't allow undo
if (type == Mailbox.TYPE_TRASH) { if (type == Mailbox.TYPE_TRASH) {
caps = UIProvider.FolderCapabilities.CAN_ACCEPT_MOVED_MESSAGES | caps = UIProvider.FolderCapabilities.CAN_ACCEPT_MOVED_MESSAGES |
@ -3935,9 +3936,9 @@ outer:
} }
private ContentValues convertUiMessageValues(Message message, ContentValues values) { private ContentValues convertUiMessageValues(Message message, ContentValues values) {
ContentValues ourValues = new ContentValues(); final ContentValues ourValues = new ContentValues();
for (String columnName : values.keySet()) { for (String columnName : values.keySet()) {
Object val = values.get(columnName); final Object val = values.get(columnName);
if (columnName.equals(UIProvider.ConversationColumns.STARRED)) { if (columnName.equals(UIProvider.ConversationColumns.STARRED)) {
putIntegerLongOrBoolean(ourValues, MessageColumns.FLAG_FAVORITE, val); putIntegerLongOrBoolean(ourValues, MessageColumns.FLAG_FAVORITE, val);
} else if (columnName.equals(UIProvider.ConversationColumns.READ)) { } else if (columnName.equals(UIProvider.ConversationColumns.READ)) {
@ -3946,6 +3947,8 @@ outer:
putIntegerLongOrBoolean(ourValues, MessageColumns.FLAG_SEEN, val); putIntegerLongOrBoolean(ourValues, MessageColumns.FLAG_SEEN, val);
} else if (columnName.equals(MessageColumns.MAILBOX_KEY)) { } else if (columnName.equals(MessageColumns.MAILBOX_KEY)) {
putIntegerLongOrBoolean(ourValues, MessageColumns.MAILBOX_KEY, val); putIntegerLongOrBoolean(ourValues, MessageColumns.MAILBOX_KEY, val);
} else if (columnName.equals(UIProvider.ConversationOperations.FOLDERS_UPDATED)) {
// Skip this column, as the folders will also be specified the RAW_FOLDERS column
} 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
final FolderList flist = FolderList.fromBlob(values.getAsByteArray(columnName)); final FolderList flist = FolderList.fromBlob(values.getAsByteArray(columnName));
@ -3977,9 +3980,9 @@ outer:
} }
private static Uri convertToEmailProviderUri(Uri uri, Uri newBaseUri, boolean asProvider) { private static Uri convertToEmailProviderUri(Uri uri, Uri newBaseUri, boolean asProvider) {
String idString = uri.getLastPathSegment(); final String idString = uri.getLastPathSegment();
try { try {
long id = Long.parseLong(idString); final long id = Long.parseLong(idString);
Uri ourUri = ContentUris.withAppendedId(newBaseUri, id); Uri ourUri = ContentUris.withAppendedId(newBaseUri, id);
if (asProvider) { if (asProvider) {
ourUri = ourUri.buildUpon().appendQueryParameter(IS_UIPROVIDER, "true").build(); ourUri = ourUri.buildUpon().appendQueryParameter(IS_UIPROVIDER, "true").build();