diff options
| author | Marc Blank <mblank@google.com> | 2012-07-27 13:36:41 -0700 |
|---|---|---|
| committer | Marc Blank <mblank@google.com> | 2012-07-27 13:36:41 -0700 |
| commit | dba0b20d955d88831ce94d96dbdadc49dba4761a (patch) | |
| tree | 61a1f4c3dd8a51480dff081c4ab4df9b4bd368f1 /src/com/android/email/NotificationController.java | |
| parent | ae57810e1e321991c454a4a6de4b88817c839315 (diff) | |
Handle ALERT response to login command
* Allow AccountService loginFailed API to take a reason string
* Present the reason string in the dialog shown from the login
failure notification
* Handle ALERTs in IMAP login responses (for example, some servers
will occasionally require web login and we need to inform them,
rather than simply saying the password is wrong)
* This fixes a longstanding bug in our Imap1 implementation
Change-Id: I8b270cd5d4746559b6c8a78bce02f0e7c525bdea
Diffstat (limited to 'src/com/android/email/NotificationController.java')
| -rw-r--r-- | src/com/android/email/NotificationController.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/com/android/email/NotificationController.java b/src/com/android/email/NotificationController.java index ca87c65fd..bde5db9e1 100644 --- a/src/com/android/email/NotificationController.java +++ b/src/com/android/email/NotificationController.java @@ -747,6 +747,10 @@ public class NotificationController { * NOTE: DO NOT CALL THIS METHOD FROM THE UI THREAD (DATABASE ACCESS) */ public void showLoginFailedNotification(long accountId) { + showLoginFailedNotification(accountId, null); + } + + public void showLoginFailedNotification(long accountId, String reason) { final Account account = Account.restoreAccountWithId(mContext, accountId); if (account == null) return; final Mailbox mailbox = Mailbox.restoreMailboxOfType(mContext, account.mId, @@ -757,7 +761,7 @@ public class NotificationController { mContext.getString(R.string.login_failed_title), account.getDisplayName(), AccountSettings.createAccountSettingsIntent(mContext, accountId, - account.mDisplayName), + account.mDisplayName, reason), getLoginFailedNotificationId(accountId)); } @@ -841,7 +845,8 @@ public class NotificationController { * account settings screen where he can view the list of enforced policies */ public void showSecurityChangedNotification(Account account) { - Intent intent = AccountSettings.createAccountSettingsIntent(mContext, account.mId, null); + Intent intent = + AccountSettings.createAccountSettingsIntent(mContext, account.mId, null, null); String accountName = account.getDisplayName(); String ticker = mContext.getString(R.string.security_changed_ticker_fmt, accountName); @@ -855,7 +860,8 @@ public class NotificationController { * account settings screen where he can view the list of unsupported policies */ public void showSecurityUnsupportedNotification(Account account) { - Intent intent = AccountSettings.createAccountSettingsIntent(mContext, account.mId, null); + Intent intent = + AccountSettings.createAccountSettingsIntent(mContext, account.mId, null, null); String accountName = account.getDisplayName(); String ticker = mContext.getString(R.string.security_unsupported_ticker_fmt, accountName); |
