Make oauth error handling localizable
Also, add some logging to track down b/13545303 Change-Id: I44a0d63b5c3b53018b48eb1c58d6a9ff74bddd9c
This commit is contained in:
parent
0db900d622
commit
8cb95732b0
@ -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);
|
||||||
|
@ -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 -->
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user