diff --git a/emailsync/src/com/android/emailsync/SyncManager.java b/emailsync/src/com/android/emailsync/SyncManager.java
index 18503fd54..2ec6f36d8 100644
--- a/emailsync/src/com/android/emailsync/SyncManager.java
+++ b/emailsync/src/com/android/emailsync/SyncManager.java
@@ -1259,6 +1259,9 @@ public abstract class SyncManager extends Service implements Runnable {
}
public void setMailboxLastSyncResult(long id, int result) {
+ if (result != EmailContent.LAST_SYNC_RESULT_SUCCESS) {
+ LogUtils.w(TAG, new Throwable(), "setMailboxLastSyncResult %d", result);
+ }
ContentValues values = new ContentValues();
values.put(Mailbox.UI_LAST_SYNC_RESULT, result);
mResolver.update(ContentUris.withAppendedId(Mailbox.CONTENT_URI, id), values, null, null);
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 7320165dc..7d48b3770 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -191,6 +191,8 @@
Sign in
+
+ Unable to authenticate
Email address or password are incorrect
diff --git a/src/com/android/email/activity/setup/OAuthAuthenticationActivity.java b/src/com/android/email/activity/setup/OAuthAuthenticationActivity.java
index 5e135c665..97d794b67 100644
--- a/src/com/android/email/activity/setup/OAuthAuthenticationActivity.java
+++ b/src/com/android/email/activity/setup/OAuthAuthenticationActivity.java
@@ -20,6 +20,7 @@ import com.android.emailcommon.Logging;
import com.android.emailcommon.VendorPolicyLoader.OAuthProvider;
import com.android.emailcommon.mail.AuthenticationFailedException;
import com.android.emailcommon.mail.MessagingException;
+import com.android.mail.R;
import com.android.mail.ui.MailAsyncTaskLoader;
import com.android.mail.utils.LogUtils;
@@ -183,8 +184,8 @@ public class OAuthAuthenticationActivity extends Activity implements
if (data == null) {
// STOPSHIP: need a better way to display errors. We might get IO or
// MessagingExceptions.
- Toast.makeText(this, "Error getting tokens", Toast.LENGTH_SHORT).show();
-
+ setResult(RESULT_OAUTH_FAILURE, null);
+ Toast.makeText(this, R.string.oauth_error_description, Toast.LENGTH_SHORT).show();
} else {
final Intent intent = new Intent();
intent.putExtra(EXTRA_OAUTH_ACCESS_TOKEN, data.mAccessToken);