Add fallbacks if sentDate is not set

b/11520812
This should make behavior better if the imap server
does not set the date header.

Change-Id: I593e14ce0a94179a39779ec47831fb8d3caef95b
This commit is contained in:
Martin Hibdon 2013-11-11 12:56:59 -08:00
parent 33efdd7dad
commit e39f2b0f27
2 changed files with 5 additions and 0 deletions

View File

@ -988,6 +988,8 @@ public abstract class EmailContent {
if (doSave) {
return super.save(context);
} else {
// FLAG: Should we be doing this? In the base class, if someone calls "save" on
// an EmailContent that is already saved, it throws an exception.
// Call update, rather than super.update in case we ever override it
if (update(context, toContentValues()) == 1) {
return getUri();

View File

@ -92,6 +92,9 @@ public class LegacyConversions {
}
if (sentDate != null) {
localMessage.mTimeStamp = sentDate.getTime();
} else if (internalDate != null) {
LogUtils.w(Logging.LOG_TAG, "No sentDate, falling back to internalDate");
localMessage.mTimeStamp = internalDate.getTime();
}
if (subject != null) {
localMessage.mSubject = subject;