Never show an undismissable "new email" notification for a null account (like used to happen during setup)

This commit is contained in:
Jesse Vincent 2010-10-24 02:01:13 +00:00
parent c216f42eb3
commit 1d6caa5c0a
1 changed files with 7 additions and 0 deletions

View File

@ -4591,6 +4591,13 @@ public class MessagingController implements Runnable
*/
private boolean notifyAccount(Context context, Account account, Message message, int previousUnreadMessageCount, AtomicInteger newMessageCount)
{
// If we don't even have an account name, don't show the notification
// (This happens during initial account setup)
//
if (account.getName() == null) {
return false;
}
// If we have a message, set the notification to "<From>: <Subject>"
StringBuilder messageNotice = new StringBuilder();
final KeyguardManager keyguardService = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);