Always mark messages as seen when we return to the folder list
b/10533884 Change-Id: If1e0774b70a379884cc435fab9965d39531efb58
This commit is contained in:
parent
19c11c0b77
commit
33bc3df32b
|
@ -3300,18 +3300,17 @@ public class EmailProvider extends ContentProvider {
|
||||||
if (params.containsKey(setVisibilityKey)) {
|
if (params.containsKey(setVisibilityKey)) {
|
||||||
final boolean visible = params.getBoolean(setVisibilityKey);
|
final boolean visible = params.getBoolean(setVisibilityKey);
|
||||||
if (visible) {
|
if (visible) {
|
||||||
|
// Mark all messages as seen
|
||||||
|
final ContentResolver resolver = mContext.getContentResolver();
|
||||||
|
final ContentValues contentValues = new ContentValues(1);
|
||||||
|
contentValues.put(MessageColumns.FLAG_SEEN, true);
|
||||||
|
final Uri uri = EmailContent.Message.CONTENT_URI;
|
||||||
|
resolver.update(uri, contentValues, MessageColumns.MAILBOX_KEY + " = ?",
|
||||||
|
new String[] {String.valueOf(mMailboxId)});
|
||||||
if (params.containsKey(
|
if (params.containsKey(
|
||||||
UIProvider.ConversationCursorCommand.COMMAND_KEY_ENTERED_FOLDER)) {
|
UIProvider.ConversationCursorCommand.COMMAND_KEY_ENTERED_FOLDER)) {
|
||||||
Mailbox mailbox = Mailbox.restoreMailboxWithId(mContext, mMailboxId);
|
Mailbox mailbox = Mailbox.restoreMailboxWithId(mContext, mMailboxId);
|
||||||
if (mailbox != null) {
|
if (mailbox != null) {
|
||||||
final ContentResolver resolver = mContext.getContentResolver();
|
|
||||||
// Mark all messages as seen
|
|
||||||
// TODO: should this happen even if the mailbox couldn't be restored?
|
|
||||||
final ContentValues contentValues = new ContentValues(1);
|
|
||||||
contentValues.put(MessageColumns.FLAG_SEEN, true);
|
|
||||||
final Uri uri = EmailContent.Message.CONTENT_URI;
|
|
||||||
resolver.update(uri, contentValues, MessageColumns.MAILBOX_KEY + " = ?",
|
|
||||||
new String[] {String.valueOf(mailbox.mId)});
|
|
||||||
// For non-push mailboxes, if it's stale (i.e. last sync was a while
|
// For non-push mailboxes, if it's stale (i.e. last sync was a while
|
||||||
// ago), force a sync.
|
// ago), force a sync.
|
||||||
// TODO: Fix the check for whether we're non-push? Right now it checks
|
// TODO: Fix the check for whether we're non-push? Right now it checks
|
||||||
|
|
Loading…
Reference in New Issue