summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Taylor <tomtaylor@google.com>2010-06-24 11:32:31 -0700
committerTom Taylor <tomtaylor@google.com>2010-06-24 11:32:31 -0700
commit2b7da074e10ceb0e04cc205efe721092781f2712 (patch)
treed6a312f5dcfa4b6421e7067f8c3822e808b75182
parent7bb3d8cf74ec1e4ae18cb814c17e12a00816f105 (diff)
downloadMms-2b7da074e10ceb0e04cc205efe721092781f2712.tar.gz
DO NOT MERGE A particular set of repo steps involving creating a draft, then deleting the draft and then receiving a new message can lead to a situation where a new incoming message gets the old thread id of the discarded draft. The compose activity can end up displaying the recipients of the old message with the contents of the new message. Recognize this dangerous situation and bail out to the ConversationList where the user can enter the compose activity in a clean manner. Bug 2793874 Change-Id: I04727de3908e3c50d4687cb6e2a9cc6589daed9c
-rw-r--r--src/com/android/mms/ui/ComposeMessageActivity.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/mms/ui/ComposeMessageActivity.java b/src/com/android/mms/ui/ComposeMessageActivity.java
index 6364dfa6..7cd685b0 100644
--- a/src/com/android/mms/ui/ComposeMessageActivity.java
+++ b/src/com/android/mms/ui/ComposeMessageActivity.java
@@ -1860,7 +1860,16 @@ public class ComposeMessageActivity extends Activity
super.onRestart();
if (mWorkingMessage.isDiscarded()) {
- mWorkingMessage.unDiscard(); // it was discarded in onStop().
+ // If the message isn't worth saving, don't resurrect it. Doing so can lead to
+ // a situation where a new incoming message gets the old thread id of the discarded
+ // draft. This activity can end up displaying the recipients of the old message with
+ // the contents of the new message. Recognize that dangerous situation and bail out
+ // to the ConversationList where the user can enter this in a clean manner.
+ if (mWorkingMessage.isWorthSaving()) {
+ mWorkingMessage.unDiscard(); // it was discarded in onStop().
+ } else {
+ goToConversationList();
+ }
}
}