diff --git a/src/com/android/email/activity/MessageFileViewFragment.java b/src/com/android/email/activity/MessageFileViewFragment.java index a017b182e..4cfb5abc9 100644 --- a/src/com/android/email/activity/MessageFileViewFragment.java +++ b/src/com/android/email/activity/MessageFileViewFragment.java @@ -121,6 +121,12 @@ public class MessageFileViewFragment extends MessageViewFragmentBase { return msg; } + @Override + protected Message reloadMessageSync(Activity activity) { + // EML files will never change, so just return the same copy. + return getMessage(); + } + /** * {@inheritDoc} * diff --git a/src/com/android/email/activity/MessageViewFragmentBase.java b/src/com/android/email/activity/MessageViewFragmentBase.java index 9385fca48..b80edc6ae 100644 --- a/src/com/android/email/activity/MessageViewFragmentBase.java +++ b/src/com/android/email/activity/MessageViewFragmentBase.java @@ -1035,6 +1035,14 @@ public abstract class MessageViewFragmentBase extends Fragment implements View.O */ protected abstract Message openMessageSync(Activity activity); + /** + * Called in a background thread to reload a new copy of the Message in case something has + * changed. + */ + protected Message reloadMessageSync(Activity activity) { + return openMessageSync(activity); + } + /** * Async task for loading a single message outside of the UI thread */ @@ -1097,7 +1105,7 @@ public abstract class MessageViewFragmentBase extends Fragment implements View.O if (activity == null) { return null; } else { - return openMessageSync(activity); + return reloadMessageSync(activity); } } @@ -1878,7 +1886,9 @@ public abstract class MessageViewFragmentBase extends Fragment implements View.O @Override public void onChange(boolean selfChange) { - mThrottle.onEvent(); + if (mRegistered) { + mThrottle.onEvent(); + } } /** This method is delay-called by {@link Throttle} on the UI thread. */