am bfc5de35: Merge change I06d98e54 into eclair

Merge commit 'bfc5de35fa08b6e747e5d5afe72bffafca08ce2a' into eclair-plus-aosp

* commit 'bfc5de35fa08b6e747e5d5afe72bffafca08ce2a':
  Fix delay sending mail after tapping "Send outgoing mail" DO NOT MERGE
This commit is contained in:
Marc Blank 2009-12-21 11:48:18 -08:00 committed by Android Git Automerger
commit 420f664891
2 changed files with 8 additions and 3 deletions

View File

@ -46,7 +46,7 @@ public class EasOutboxService extends EasSyncService {
public static final int SEND_FAILED = 1;
public static final String MAILBOX_KEY_AND_NOT_SEND_FAILED =
MessageColumns.MAILBOX_KEY + "=? and (" + SyncColumns.SERVER_ID + " is null or " +
MessageColumns.MAILBOX_KEY + "=? and (" + SyncColumns.SERVER_ID + " is null or " +
SyncColumns.SERVER_ID + "!=" + SEND_FAILED + ')';
public static final String[] BODY_SOURCE_PROJECTION =
new String[] {BodyColumns.SOURCE_MESSAGE_KEY};
@ -150,9 +150,13 @@ public class EasOutboxService extends EasSyncService {
ContentValues cv = new ContentValues();
cv.put(SyncColumns.SERVER_ID, SEND_FAILED);
Message.update(mContext, Message.CONTENT_URI, msgId, cv);
result = EmailServiceStatus.REMOTE_EXCEPTION;
// We mark the result as SUCCESS on a non-auth failure since the message itself is
// already marked failed and we don't want to stop other messages from trying to
// send.
if (isAuthError(code)) {
result = EmailServiceStatus.LOGIN_FAILED;
} else {
result = EmailServiceStatus.SUCCESS;
}
sendCallback(msgId, null, result);

View File

@ -290,7 +290,8 @@ public class SyncManager extends Service implements Runnable {
cv.put(SyncColumns.SERVER_ID, 0);
INSTANCE.getContentResolver().update(Message.CONTENT_URI,
cv, WHERE_MAILBOX_KEY, new String[] {Long.toString(mailboxId)});
// Clear the error state; the Outbox sync will be started from checkMailboxes
INSTANCE.mSyncErrorMap.remove(mailboxId);
kick("start outbox");
// Outbox can't be synced in EAS
return;