In the new-style notification, directly go to message if new message

count is 1.

This matches what is displayed in the notification itself.
This commit is contained in:
Danny Baumann 2013-01-06 12:16:54 +01:00
parent e17e9b9344
commit aaa65a457e
1 changed files with 12 additions and 1 deletions

View File

@ -4701,8 +4701,18 @@ public class MessagingController implements Runnable {
}
Intent targetIntent;
boolean treatAsSingleMessageNotification;
if (unreadCount == 1) {
if (platformSupportsExtendedNotifications()) {
// in the new-style notifications, we focus on the new messages, not the unread ones
treatAsSingleMessageNotification = newMessages == 1;
} else {
// in the old-style notifications, we focus on unread messages, as we don't have a
// good way to express the new message count
treatAsSingleMessageNotification = unreadCount == 1;
}
if (treatAsSingleMessageNotification) {
targetIntent = MessageView.actionHandleNotificationIntent(
context, message.makeMessageReference());
} else {
@ -4717,6 +4727,7 @@ public class MessagingController implements Runnable {
targetIntent = FolderList.actionHandleNotification(context, account, initialFolder);
}
PendingIntent pi = PendingIntent.getActivity(context, 0, targetIntent, PendingIntent.FLAG_UPDATE_CURRENT);
builder.setContentIntent(pi);