mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-25 09:08:49 -05:00
Fixes Issue 801
This commit is contained in:
parent
2e50cc5444
commit
c732f14c3d
@ -3329,6 +3329,10 @@ public class MessagingController implements Runnable {
|
||||
{
|
||||
boolean isNotifyAccount = thisAccount.isNotifyNewMail();
|
||||
if (isNotifyAccount)
|
||||
{
|
||||
NotificationManager notifMgr =
|
||||
(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
if (unreadMessageCount > 0)
|
||||
{
|
||||
String notice = context.getString(R.string.notification_new_one_account_fmt, unreadMessageCount,
|
||||
thisAccount.getDescription());
|
||||
@ -3355,10 +3359,14 @@ public class MessagingController implements Runnable {
|
||||
notif.ledOnMS = Email.NOTIFICATION_LED_ON_TIME;
|
||||
notif.ledOffMS = Email.NOTIFICATION_LED_OFF_TIME;
|
||||
|
||||
NotificationManager notifMgr =
|
||||
(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
||||
notifMgr.notify(thisAccount.getAccountNumber(), notif);
|
||||
}
|
||||
else
|
||||
{
|
||||
notifMgr.cancel(thisAccount.getAccountNumber());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3753,6 +3761,10 @@ public class MessagingController implements Runnable {
|
||||
{
|
||||
notifyAccount(mApplication, account, unreadMessageCount);
|
||||
}
|
||||
if (unreadCount == 0)
|
||||
{
|
||||
notifyAccount(mApplication, account, unreadMessageCount);
|
||||
}
|
||||
|
||||
for (MessagingListener l : getListeners())
|
||||
{
|
||||
|
@ -9,7 +9,6 @@ import com.android.email.MessagingListener;
|
||||
import com.android.email.Preferences;
|
||||
import com.android.email.mail.MessagingException;
|
||||
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
@ -139,9 +138,6 @@ public class PollService extends CoreService
|
||||
return;
|
||||
}
|
||||
|
||||
NotificationManager notifMgr =
|
||||
(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
||||
for (Account thisAccount : Preferences.getPreferences(context).getAccounts()) {
|
||||
Integer newMailCount = accountsChecked.get(thisAccount.getUuid());
|
||||
if (newMailCount != null)
|
||||
@ -155,7 +151,7 @@ public class PollService extends CoreService
|
||||
}
|
||||
else if (unreadMessageCount == 0)
|
||||
{
|
||||
notifMgr.cancel(thisAccount.getAccountNumber());
|
||||
MessagingController.getInstance(getApplication()).notifyAccount(context, thisAccount, unreadMessageCount);
|
||||
}
|
||||
}
|
||||
catch (MessagingException me)
|
||||
|
Loading…
Reference in New Issue
Block a user