Merge "Remove notifications while we still know what type of account this is" into jb-ub-mail-ur10
This commit is contained in:
commit
7c24f48a37
@ -515,9 +515,15 @@ public class NotificationController {
|
||||
* as well as special login/security notifications.
|
||||
*/
|
||||
public static void cancelNotifications(final Context context, final Account account) {
|
||||
final EmailServiceUtils.EmailServiceInfo serviceInfo
|
||||
= EmailServiceUtils.getServiceInfoForAccount(context, account.mId);
|
||||
if (serviceInfo == null) {
|
||||
LogUtils.d(LOG_TAG, "Can't cancel notification for missing account %d", account.mId);
|
||||
return;
|
||||
}
|
||||
final android.accounts.Account notifAccount
|
||||
= account.getAccountManagerAccount(
|
||||
EmailServiceUtils.getServiceInfoForAccount(context, account.mId).accountType);
|
||||
= account.getAccountManagerAccount(serviceInfo.accountType);
|
||||
|
||||
NotificationUtils.clearAccountNotifications(context, notifAccount);
|
||||
|
||||
final NotificationManager notificationManager = getInstance(context).mNotificationManager;
|
||||
|
@ -177,11 +177,12 @@ public class AccountReconciler {
|
||||
context.getString(R.string.protocol_eas))) {
|
||||
exchangeAccountDeleted = true;
|
||||
}
|
||||
// Cancel all notifications for this account
|
||||
NotificationController.cancelNotifications(context, providerAccount);
|
||||
|
||||
context.getContentResolver().delete(
|
||||
EmailProvider.uiUri("uiaccount", providerAccount.mId), null, null);
|
||||
|
||||
// Cancel all notifications for this account
|
||||
NotificationController.cancelNotifications(context, providerAccount);
|
||||
accountDeleted = true;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user