Changes the way we read count of unread notifications, to show to user overall number of unread voice messages.

cusax-fix
Damian Minkov 14 years ago
parent 6dacc7968f
commit 77a2ef87b3

@ -32,6 +32,11 @@ public class UINotification
*/
private final Date notificationTime;
/**
* Number of unread objects like calls or messages.
*/
private int unreadObjects = 0;
/**
* Creates an instance of <tt>UINotification</tt> by specifying the
* notification name and time.
@ -45,10 +50,30 @@ public class UINotification
public UINotification( String displayName,
Date time,
UINotificationGroup parentGroup)
{
this(displayName, time, parentGroup, 1);
}
/**
* Creates an instance of <tt>UINotification</tt> by specifying the
* notification name and time.
*
* notification belongs
* @param displayName the name associated to this notification
* @param time the time when the notification was received
* @param parentGroup the group of notifications, to which this notification
* belongs
* @param unreadObjects number of unread objects for this notification.
*/
public UINotification( String displayName,
Date time,
UINotificationGroup parentGroup,
int unreadObjects)
{
this.notificationName = displayName;
this.notificationTime = time;
this.parentGroup = parentGroup;
this.unreadObjects = unreadObjects;
}
/**
@ -80,4 +105,13 @@ public UINotificationGroup getGroup()
{
return parentGroup;
}
/**
* Returns the number of unread objects for this notification.
* @return
*/
public int getUnreadObjects()
{
return unreadObjects;
}
}

@ -108,7 +108,12 @@ public int getUnreadNotificationsCount()
{
synchronized (unreadNotifications)
{
return unreadNotifications.size();
int count = 0;
for(UINotification n : unreadNotifications)
count += n.getUnreadObjects();
return count;
}
}
}

@ -310,7 +310,8 @@ private void addNotificationContact(
contact.getDisplayName()
+ " : " + contact.getDisplayDetails(),
new Date(),
uiNotificationGroup));
uiNotificationGroup,
contact.getUnreadMessageCount()));
}
}
}

Loading…
Cancel
Save