am 44a443b4: Merge "Make oauth error handling localizable" into ub-mail-algol

* commit '44a443b4e35f68a38ee73b1ce959302b0b3e74b6':
  Make oauth error handling localizable
This commit is contained in:
Martin Hibdon 2014-04-03 21:47:58 +00:00 committed by Android Git Automerger
commit ec454e092e
3 changed files with 8 additions and 2 deletions

View File

@ -1259,6 +1259,9 @@ public abstract class SyncManager extends Service implements Runnable {
} }
public void setMailboxLastSyncResult(long id, int result) { 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(); ContentValues values = new ContentValues();
values.put(Mailbox.UI_LAST_SYNC_RESULT, result); values.put(Mailbox.UI_LAST_SYNC_RESULT, result);
mResolver.update(ContentUris.withAppendedId(Mailbox.CONTENT_URI, id), values, null, null); mResolver.update(ContentUris.withAppendedId(Mailbox.CONTENT_URI, id), values, null, null);

View File

@ -191,6 +191,8 @@
<!-- Title of screen to choose with authentication to use --> <!-- Title of screen to choose with authentication to use -->
<string name="sign_in_title">Sign in</string> <string name="sign_in_title">Sign in</string>
<!-- Warning if there is a problem authenticating with oauth -->
<string name="oauth_error_description">Unable to authenticate</string>
<!-- Warning label displayed when the email address or password are incorrect --> <!-- Warning label displayed when the email address or password are incorrect -->
<string name="password_warning_label">Email address or password are incorrect</string> <string name="password_warning_label">Email address or password are incorrect</string>
<!-- Label displayed to confirm what email address we are trying to validate --> <!-- Label displayed to confirm what email address we are trying to validate -->

View File

@ -20,6 +20,7 @@ import com.android.emailcommon.Logging;
import com.android.emailcommon.VendorPolicyLoader.OAuthProvider; import com.android.emailcommon.VendorPolicyLoader.OAuthProvider;
import com.android.emailcommon.mail.AuthenticationFailedException; import com.android.emailcommon.mail.AuthenticationFailedException;
import com.android.emailcommon.mail.MessagingException; import com.android.emailcommon.mail.MessagingException;
import com.android.mail.R;
import com.android.mail.ui.MailAsyncTaskLoader; import com.android.mail.ui.MailAsyncTaskLoader;
import com.android.mail.utils.LogUtils; import com.android.mail.utils.LogUtils;
@ -183,8 +184,8 @@ public class OAuthAuthenticationActivity extends Activity implements
if (data == null) { if (data == null) {
// STOPSHIP: need a better way to display errors. We might get IO or // STOPSHIP: need a better way to display errors. We might get IO or
// MessagingExceptions. // 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 { } else {
final Intent intent = new Intent(); final Intent intent = new Intent();
intent.putExtra(EXTRA_OAUTH_ACCESS_TOKEN, data.mAccessToken); intent.putExtra(EXTRA_OAUTH_ACCESS_TOKEN, data.mAccessToken);