diff options
author | Wei Huang <weih@google.com> | 2010-06-18 16:32:52 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-06-18 16:32:52 -0700 |
commit | b30f28b141cfaee956c10baadafb0a782c82a848 (patch) | |
tree | 324cb45d814abf33beccf5cb80fe25090b1ce881 | |
parent | 46fe886f5bdacc96b73e2fe0bb3f411702b8294a (diff) | |
parent | 7bb3d8cf74ec1e4ae18cb814c17e12a00816f105 (diff) | |
download | Mms-b30f28b141cfaee956c10baadafb0a782c82a848.tar.gz |
am 7bb3d8cf: bug #2780967: fix SMS sending message to the wrong person.
Merge commit '7bb3d8cf74ec1e4ae18cb814c17e12a00816f105' into froyo-plus-aosp
* commit '7bb3d8cf74ec1e4ae18cb814c17e12a00816f105':
bug #2780967: fix SMS sending message to the wrong person.
-rw-r--r-- | src/com/android/mms/ui/ComposeMessageActivity.java | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/com/android/mms/ui/ComposeMessageActivity.java b/src/com/android/mms/ui/ComposeMessageActivity.java index 78945ac8..6364dfa6 100644 --- a/src/com/android/mms/ui/ComposeMessageActivity.java +++ b/src/com/android/mms/ui/ComposeMessageActivity.java @@ -1826,17 +1826,23 @@ public class ComposeMessageActivity extends Activity log(" new conversation=" + conversation + ", mConversation=" + mConversation); } - long convThreadId = 0; if (conversation != null) { // Don't let any markAsRead DB updates occur before we've loaded the messages for // the thread. conversation.blockMarkAsRead(true); - convThreadId = conversation.getThreadId(); + + // this is probably paranoia to compare both thread_ids and recipient lists, + // but we want to make double sure because this is a last minute fix for Froyo + // and the previous code checked thread ids only. + // (we cannot just compare thread ids because there is a case where mConversation + // has a stale/obsolete thread id (=1) that could collide against the new thread_id(=1), + // even though the recipient lists are different) + sameThread = (conversation.getThreadId() == mConversation.getThreadId() && + conversation.equals(mConversation)); } - if (sameThread || (convThreadId != 0 && convThreadId == mConversation.getThreadId())) { - if (Log.isLoggable(LogTag.APP, Log.VERBOSE)) { - log("onNewIntent: same conversation"); - } + + if (sameThread) { + log("onNewIntent: same conversation"); } else { if (Log.isLoggable(LogTag.APP, Log.VERBOSE)) { log("onNewIntent: different conversation, initialize..."); @@ -2945,7 +2951,7 @@ public class ComposeMessageActivity extends Activity if (Log.isLoggable(LogTag.APP, Log.VERBOSE)) { log("startMsgListQuery for " + conversationUri); } - + // Cancel any pending queries mBackgroundQueryHandler.cancelOperation(MESSAGE_LIST_QUERY_TOKEN); try { |