Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
Fix unread notifications
Browse files Browse the repository at this point in the history
Reading one thread would mark all messages read. The expression
read=0 OR seen=0 was getting combined with the thread_id in the
provider like this: read=0 OR seen=0 AND thread_id=N, which was evaluated
as read=0 OR (seen=0 AND thread_id=N). The expression needs parens
so it will get evaluated correctly. Bug 2615680

Change-Id: Ib495a74e41346b835a576a8d6d53e809b839f93d
  • Loading branch information
Tom Taylor committed Apr 23, 2010
1 parent ac551c1 commit 6bbfd94
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/com/android/mms/data/Conversation.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class Conversation {
Threads.READ
};

private static final String UNREAD_SELECTION = "read=0 OR seen=0";
private static final String UNREAD_SELECTION = "(read=0 OR seen=0)";

private static final String[] SEEN_PROJECTION = new String[] {
"seen"
Expand Down Expand Up @@ -616,7 +616,7 @@ private static void fillFromCursor(Context context, Conversation conv,
}
// Fill in as much of the conversation as we can before doing the slow stuff of looking
// up the contacts associated with this conversation.
String recipientIds = c.getString(RECIPIENT_IDS);
String recipientIds = c.getString(RECIPIENT_IDS);
ContactList recipients = ContactList.getByIds(recipientIds, allowQuery);
synchronized (conv) {
conv.mRecipients = recipients;
Expand Down Expand Up @@ -922,7 +922,7 @@ private boolean loadFromThreadId(long threadId, boolean allowQuery) {
try {
if (c.moveToFirst()) {
fillFromCursor(mContext, this, c, allowQuery);

if (threadId != mThreadId) {
LogTag.error("loadFromThreadId: fillFromCursor returned differnt thread_id!" +
" threadId=" + threadId + ", mThreadId=" + mThreadId);
Expand Down

0 comments on commit 6bbfd94

Please sign in to comment.