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.
|
* as well as special login/security notifications.
|
||||||
*/
|
*/
|
||||||
public static void cancelNotifications(final Context context, final Account account) {
|
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
|
final android.accounts.Account notifAccount
|
||||||
= account.getAccountManagerAccount(
|
= account.getAccountManagerAccount(serviceInfo.accountType);
|
||||||
EmailServiceUtils.getServiceInfoForAccount(context, account.mId).accountType);
|
|
||||||
NotificationUtils.clearAccountNotifications(context, notifAccount);
|
NotificationUtils.clearAccountNotifications(context, notifAccount);
|
||||||
|
|
||||||
final NotificationManager notificationManager = getInstance(context).mNotificationManager;
|
final NotificationManager notificationManager = getInstance(context).mNotificationManager;
|
||||||
|
@ -177,11 +177,12 @@ public class AccountReconciler {
|
|||||||
context.getString(R.string.protocol_eas))) {
|
context.getString(R.string.protocol_eas))) {
|
||||||
exchangeAccountDeleted = true;
|
exchangeAccountDeleted = true;
|
||||||
}
|
}
|
||||||
|
// Cancel all notifications for this account
|
||||||
|
NotificationController.cancelNotifications(context, providerAccount);
|
||||||
|
|
||||||
context.getContentResolver().delete(
|
context.getContentResolver().delete(
|
||||||
EmailProvider.uiUri("uiaccount", providerAccount.mId), null, null);
|
EmailProvider.uiUri("uiaccount", providerAccount.mId), null, null);
|
||||||
|
|
||||||
// Cancel all notifications for this account
|
|
||||||
NotificationController.cancelNotifications(context, providerAccount);
|
|
||||||
accountDeleted = true;
|
accountDeleted = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user