mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-13 06:38:05 -05:00
Fixes Issue 742
This commit is contained in:
parent
11a1a09e97
commit
84a1e0647d
@ -3292,34 +3292,38 @@ public class MessagingController implements Runnable {
|
|||||||
|
|
||||||
public void notifyAccount(Context context, Account thisAccount, int unreadMessageCount)
|
public void notifyAccount(Context context, Account thisAccount, int unreadMessageCount)
|
||||||
{
|
{
|
||||||
String notice = context.getString(R.string.notification_new_one_account_fmt, unreadMessageCount,
|
boolean isNotifyAccount = thisAccount.isNotifyNewMail();
|
||||||
thisAccount.getDescription());
|
if (isNotifyAccount)
|
||||||
Notification notif = new Notification(R.drawable.stat_notify_email_generic,
|
{
|
||||||
context.getString(R.string.notification_new_title), System.currentTimeMillis());
|
String notice = context.getString(R.string.notification_new_one_account_fmt, unreadMessageCount,
|
||||||
|
thisAccount.getDescription());
|
||||||
notif.number = unreadMessageCount;
|
Notification notif = new Notification(R.drawable.stat_notify_email_generic,
|
||||||
|
context.getString(R.string.notification_new_title), System.currentTimeMillis());
|
||||||
Intent i = FolderList.actionHandleAccountIntent(context, thisAccount);
|
|
||||||
|
notif.number = unreadMessageCount;
|
||||||
PendingIntent pi = PendingIntent.getActivity(context, 0, i, 0);
|
|
||||||
|
Intent i = FolderList.actionHandleAccountIntent(context, thisAccount);
|
||||||
notif.setLatestEventInfo(context, context.getString(R.string.notification_new_title), notice, pi);
|
|
||||||
|
PendingIntent pi = PendingIntent.getActivity(context, 0, i, 0);
|
||||||
String ringtone = thisAccount.getRingtone();
|
|
||||||
notif.sound = TextUtils.isEmpty(ringtone) ? null : Uri.parse(ringtone);
|
notif.setLatestEventInfo(context, context.getString(R.string.notification_new_title), notice, pi);
|
||||||
|
|
||||||
if (thisAccount.isVibrate()) {
|
String ringtone = thisAccount.getRingtone();
|
||||||
notif.defaults |= Notification.DEFAULT_VIBRATE;
|
notif.sound = TextUtils.isEmpty(ringtone) ? null : Uri.parse(ringtone);
|
||||||
|
|
||||||
|
if (thisAccount.isVibrate()) {
|
||||||
|
notif.defaults |= Notification.DEFAULT_VIBRATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
notif.flags |= Notification.FLAG_SHOW_LIGHTS;
|
||||||
|
notif.ledARGB = Email.NOTIFICATION_LED_COLOR;
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
notif.flags |= Notification.FLAG_SHOW_LIGHTS;
|
|
||||||
notif.ledARGB = Email.NOTIFICATION_LED_COLOR;
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user