diff --git a/src/com/android/email/mail/store/ImapStore.java b/src/com/android/email/mail/store/ImapStore.java index fa6e80f43..c30405594 100644 --- a/src/com/android/email/mail/store/ImapStore.java +++ b/src/com/android/email/mail/store/ImapStore.java @@ -325,7 +325,7 @@ public class ImapStore extends Store { final ImapFolder folder = mailboxes.get(path); final Mailbox mailbox = folder.mMailbox; int delimiterIdx = mailbox.mServerId.lastIndexOf(mailbox.mDelimiter); - long parentKey = -1L; + long parentKey = Mailbox.NO_MAILBOX; if (delimiterIdx != -1) { String parentPath = path.substring(0, delimiterIdx); final ImapFolder parentFolder = mailboxes.get(parentPath); @@ -585,12 +585,12 @@ public class ImapStore extends Store { static class ImapMessage extends MimeMessage { ImapMessage(String uid, ImapFolder folder) { - this.mUid = uid; - this.mFolder = folder; + mUid = uid; + mFolder = folder; } public void setSize(int size) { - this.mSize = size; + mSize = size; } @Override @@ -616,12 +616,12 @@ public class ImapStore extends Store { public ImapException(String message, String alertText, Throwable throwable) { super(message, throwable); - this.mAlertText = alertText; + mAlertText = alertText; } public ImapException(String message, String alertText) { super(message); - this.mAlertText = alertText; + mAlertText = alertText; } public String getAlertText() { diff --git a/src/com/android/email/provider/EmailProvider.java b/src/com/android/email/provider/EmailProvider.java index 7cb7a46ad..59acee112 100644 --- a/src/com/android/email/provider/EmailProvider.java +++ b/src/com/android/email/provider/EmailProvider.java @@ -2400,7 +2400,8 @@ outer: // For posterity; this is the command we're executing: //sqlite> UPDATE mailbox SET serverid=displayname WHERE mailbox._id in ( // ...> SELECT mailbox._id FROM mailbox,account,hostauth WHERE - // ...> mailbox.parentkey=0 AND mailbox.accountkey=account._id AND + // ...> (mailbox.parentkey isnull OR mailbox.parentkey=0) AND + // ...> mailbox.accountkey=account._id AND // ...> account.hostauthkeyrecv=hostauth._id AND // ...> (hostauth.protocol='imap' OR hostauth.protocol='pop3')); try { @@ -2412,7 +2413,10 @@ outer: + Mailbox.TABLE_NAME + "." + MailboxColumns.ID + " FROM " + Mailbox.TABLE_NAME + "," + Account.TABLE_NAME + "," + HostAuth.TABLE_NAME + " WHERE " - + Mailbox.TABLE_NAME + "." + MailboxColumns.PARENT_KEY + "=0 AND " + + "(" + + Mailbox.TABLE_NAME + "." + MailboxColumns.PARENT_KEY + " isnull OR " + + Mailbox.TABLE_NAME + "." + MailboxColumns.PARENT_KEY + "=0 " + + ") AND " + Mailbox.TABLE_NAME + "." + MailboxColumns.ACCOUNT_KEY + "=" + Account.TABLE_NAME + "." + AccountColumns.ID + " AND " + Account.TABLE_NAME + "." + AccountColumns.HOST_AUTH_KEY_RECV + "="