am fe937b63: am 7d36b7b7: am 07a3461b: am 9ac224f7: Update Message.isEqual() method
* commit 'fe937b635a8b9186bf0e7cab98e6aba342fbc59e':
Update Message.isEqual() method
diff --git a/src/com/android/mail/providers/Message.java b/src/com/android/mail/providers/Message.java
index 4e5d50a..b90f76b 100644
--- a/src/com/android/mail/providers/Message.java
+++ b/src/com/android/mail/providers/Message.java
@@ -243,14 +243,16 @@
/**
* Helper equality function to check if the two Message objects are equal in terms of
- * the fields that the user can input from ComposeActivity. This is primarily used to
- * ensure draft preview/composition are synced.
+ * the fields that are visible in ConversationView.
+ *
* @param o the Message being compared to
* @return True if they are equal in fields, false otherwise
*/
public boolean isEqual(Message o) {
return TextUtils.equals(this.getFrom(), o.getFrom()) &&
this.sendingState == o.sendingState &&
+ this.starred == o.starred &&
+ this.read == o.read &&
TextUtils.equals(this.getTo(), o.getTo()) &&
TextUtils.equals(this.getCc(), o.getCc()) &&
TextUtils.equals(this.getBcc(), o.getBcc()) &&
diff --git a/src/com/android/mail/ui/ConversationViewFragment.java b/src/com/android/mail/ui/ConversationViewFragment.java
index e425e78..3e68841 100644
--- a/src/com/android/mail/ui/ConversationViewFragment.java
+++ b/src/com/android/mail/ui/ConversationViewFragment.java
@@ -1649,9 +1649,7 @@
// We are going to update the data in the adapter whenever any input fields change.
// This ensures that the Message object that ComposeActivity uses will be correctly
// aligned with the most up-to-date data.
- // Note that isEqual does not compare all fields in the Message object
- if (!newMsg.isEqual(oldMsg) ||
- newMsg.read != oldMsg.read || newMsg.starred != oldMsg.starred) {
+ if (!newMsg.isEqual(oldMsg)) {
mAdapter.updateItemsForMessage(newMsg, changedOverlayPositions);
LogUtils.i(LOG_TAG, "msg #%d (%d): detected field(s) change. sendingState=%s",
pos, newMsg.id, newMsg.sendingState);