From cb98193f85faddf96bd8b9ad39ef961e50bd2505 Mon Sep 17 00:00:00 2001 From: Andrew Stadler Date: Wed, 17 Mar 2010 16:14:17 -0700 Subject: [PATCH] Clear notifications when deleting accounts * Quick fix for the bug that notifications may be stale after and account is deleted. Bug: 2202317 Change-Id: I950d173d20dee443b03b40ee04618afb98a95f38 --- src/com/android/email/activity/AccountFolderList.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/com/android/email/activity/AccountFolderList.java b/src/com/android/email/activity/AccountFolderList.java index 8094bbbbb..1c0b7b447 100644 --- a/src/com/android/email/activity/AccountFolderList.java +++ b/src/com/android/email/activity/AccountFolderList.java @@ -32,6 +32,7 @@ import com.android.email.provider.EmailContent.Mailbox; import com.android.email.provider.EmailContent.MailboxColumns; import com.android.email.provider.EmailContent.Message; import com.android.email.provider.EmailContent.MessageColumns; +import com.android.email.service.MailService; import android.app.AlertDialog; import android.app.Dialog; @@ -415,6 +416,10 @@ public class AccountFolderList extends ListActivity implements OnItemClickListen public void onClick(DialogInterface dialog, int whichButton) { dismissDialog(DIALOG_REMOVE_ACCOUNT); try { + // Clear notifications, which may become stale here + NotificationManager notificationManager = (NotificationManager) + getSystemService(Context.NOTIFICATION_SERVICE); + notificationManager.cancel(MailService.NOTIFICATION_ID_NEW_MESSAGES); // Delete Remote store at first. Store.getInstance( mSelectedContextAccount.getStoreUri(AccountFolderList.this),