History log of /packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
3d00f75be4178a8b9e9ce099221e2e256bcab850 27-Sep-2013 Tom Taylor <tomtaylor@google.com> When message is converted from SMS to MMS, there is no pop-up message notifying the user about the additional charges

Bug 8633269

Change-Id: Ibbaac81d3f329e06baf65a7c99b97d6c4d1187b7
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
1be333235a1ef5dbc09f50c71aa2341507d6f978 03-Jul-2013 Roger Chen <cxr514033970@gmail.com> Interrupt message sending if recipient mismatch

Change-Id: I23814c1886e6746334263395c2fd11401f504f41
Signed-off-by: Roger Chen <cxr514033970@gmail.com>
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
7d0bdc14482c047c75046d63627da8d35f1dc95e 04-May-2013 Marcel Bokhorst <marcel@bokhorst.biz> Prevent FC in low memory conditions

Add missing null cursor checks

Signed-off-by: Michael Bestas <mikeioannina@gmail.com>

Change-Id: I974eea82cac3dfe3a01e5d79c1721d3514f940f6
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
469db72fcf219fd4c60bc9b01c728bdc3e866d40 23-Oct-2012 Tom Taylor <tomtaylor@google.com> Crash trying to save a draft with a picture from the gallery

Bug 7374081

Change the persister api's to accept a HashMap of opened inputStreams
for the parts. The inputStreams are opened on the UI thread, but the
actual persisting takes place on a non-UI thread. We only pre-open the
inputStreams in onStop, before we lose the gallery permission.

Change-Id: I6eaa8a2635201164a80589e7d30b24a6dd60fcc7
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
8cc338d324dc4c92b686029064882147e9054f17 18-Oct-2012 Tom Taylor <tomtaylor@google.com> Empty draft created on deleting a group MMS message

Bug 7360609

Don't save an mms draft for a group message when there's no text. When the
last message in a thread is deleted, automatically go back to the
ConversationList. Earlier when my deletes were failing because of the
NULL threadId in the pdu table, I noticed an exception thrown from
Conversation.startDelete: "startDeleteAll already in the middle of a delete".
startDelete was being called in a loop and of course sDeletingThreads would
be true if the delete hadn't completed in between iterations. Fix by having
startDelete do all the deleting of multiple threadIds.


Change-Id: Idfb8c0d54d8bb1875bbe7c5163e75bbb0dfbf14d
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
9889006f9d29d0509c1c036987ce028de43ac96e 09-Oct-2012 Tom Taylor <tomtaylor@google.com> Add setting to turn on/off group MMS

Bug 6970173

Add a setting/preference to turn on/off group MMS. If group mms is disabled
by mms_config.xml, the preference is hidden from the user (this is consistent
with other mms features disabled by carriers). When group mms is disabled,
receiving a group mms is also disabled. In other words, the received message
will appear to have come from a thread with only the sender and not in a thread
with the sender + the other recipients.

Change-Id: I9510ae269f7b3968c768c7b5f5cf8dcc7fe4eca6
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
c6501ab9f1882d802ef7805967d936ecce52fbbf 10-Sep-2012 Tom Taylor <tomtaylor@google.com> Don't flash attachment box for text-only mms's

Bug 6764486

Change-Id: I5a4d86fc4948b0a4c9986730fd4290cc1a63acd2
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
24149983964b1de6a98bcefeb5e6ebfa2d0d7953 10-Sep-2012 Tom Taylor <tomtaylor@google.com> Fix a couple of bugs

Bugs 7087793, 7128602

When creating a new conversation, CMA crashes because the code is trying
to access contact[0]. There's a path when adding a picture and it fails,
where the slideshow can get reset to null and subsequently NPE's.

Change-Id: I0b6eeb3df5cf4484d82e2e78d9fdc01380614548
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
a0cbec1365920c5916da95327ddcd0cdac6f1b03 05-Sep-2012 Jean-Baptiste Queru <jbq@google.com> am b22ea8fb: am 822ff2e4: Merge "We sometimes need a new thread id to update drafts"

* commit 'b22ea8fbc79f3361907e96e4d7737bc304db4ddf':
We sometimes need a new thread id to update drafts
b22ea8fbc79f3361907e96e4d7737bc304db4ddf 05-Sep-2012 Jean-Baptiste Queru <jbq@google.com> am 822ff2e4: Merge "We sometimes need a new thread id to update drafts"

* commit '822ff2e46f8937c3dc38870bf28ca0c244eaf9bd':
We sometimes need a new thread id to update drafts
c1f03822994dc09939060c41e0ce9cb37175b054 29-Aug-2012 Tom Taylor <tomtaylor@google.com> Implement group mms

Bug 6282172

When multiple recipients are added on a new conversation, the message is
automatically turned into an mms. This is the default, but add an mms_config.xml
option to turn that feature off. In a group mms message list, show the
sender's name on the line with the timestamp.

Change-Id: I8be4c325023bcbaf2498b8c9d8346a2a94ef63ef
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
6fb06ef2242ee4167d2e9b9ee2a05bf46c124f19 28-Aug-2012 Roger Chen <cxr514033970@gmail.com> We sometimes need a new thread id to update drafts

We are saving the draft in a conversation which had been
deleted all messages one by one(Now the thread id is orphaned).
The draft will be saved in a obseleted thread, so we lose them
and cann't find them in ConversationList. We need to get a new
thread id in this case.

Refer to ef3eb49cde359d36f9536dbaffe5c16f3639c1f2, it fixed this
issue while we are saving the Mms draft, but Sms.

Change-Id: I29b3c1abf373877924b1afb45027417a12a1ec68
Signed-off-by: Roger Chen <cxr514033970@gmail.com>
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
f9f9b39420d9f3325a96fee6817eb3eac4f31aaf 10-Aug-2012 Jean-Baptiste Queru <jbq@google.com> am 18e80bf2: Merge "Clean and format all imported packages"

* commit '18e80bf2080b4ebbe9f8b2bd2ba37589a4ae9b5f':
Clean and format all imported packages
d64419030e1fec1e751695dab3bd7236e2fb0214 02-Aug-2012 Roger Chen <cxr514033970@gmail.com> Clean and format all imported packages

Change-Id: I2e45f5ba1d56b9b17314a8b0f4c0fc1a5d8fc4d9
Signed-off-by: Roger Chen <cxr514033970@gmail.com>
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
364d926784135e4889d74c570868db046a67cceb 02-Aug-2012 Tom Taylor <tomtaylor@google.com> SMS isn't converted to MMS even after 7 segments of messages

Bug 6903793

Resurrect the mms_config.xml setting "smsToMmsTextThreshold" to allow
overlays to specify an sms->mms conversion after a certain number
of sms segments have been created. Tested on mysid, yakju, and sojus. All
three have different settings for this feature. Also tested bug fixed by
https://googleplex-android-review.googlesource.com/#/c/103729/.

Change-Id: Ibcfd235edbaa264fede6e48f84f04345d16368fa
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
e5486018e640aa2c36f68f56d19682a8fd614291 05-Jun-2012 Tom Taylor <tomtaylor@google.com> Wrong image shown in MMS preview

Bug 6104869

The change looks bigger than it is because of moving a function to WorkingMessage
where it's more general. Remove a message's thumbnails from the cache when
the attachment is removed or replaced.

Change-Id: Ib396029bec41884aa06f70a15c028e2d8ff08a0c
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
9b1488b9d20c5b79ddc0aa984bfd75844a0b0249 05-Jun-2012 Tom Taylor <tomtaylor@google.com> Backing out of forwarding an mms leaves a row with no thread_id in the pdu table

Bug 6600669

This bug can also be reproduced by creating an mms message and then backing
out. You'll get a dialog that the message has no valid recipients and will
be deleted, but because the thread doesn't have a thread id (it has
no recipients), the pdu will get orphaned in the pdu table, never to be
deleted. With this change, when deleting a draft without a thread id, the
orphaned pdu(s) is delete as well. While I tested this with the various
combinations of mms attachments, forwarding, sending normally, and drafts,
there's some risk with this change because of the complexity of mms. In
the future, the code should be examined and changed so that a pdu with
no thread id is ever entered into the DB, but that's a much larger change
and research project than can be dealt with right now.

Change-Id: Ie0641873f052c9551fcd7ba56058cdb97287220a
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
cdbd2dedafb1fe786ae9bf21ea0f8185b358172a 10-May-2012 Tom Taylor <tomtaylor@google.com> Thread with no recipients getting created

Bug 6453254

Don't allow a thread to be created with no recipients, by not saving a
draft when there are no recipients.

Change-Id: I13cf91cf032f1338b2eda8067f591a3fdb5b7892
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
be8c4cdb145e2919e1b5916355e5a92978e013f7 05-May-2012 Todor Kalaydjiev <todor@google.com> Fix quiet notifications: there was a concurrency issue w/ thread ID tracking

Bug: 6424461
Change-Id: I6ce2f3aef4035156e227275af3fdc277bc36ec63
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
402b4a84df9426e0079739621b8926dfb8731923 03-May-2012 Tom Taylor <tomtaylor@google.com> java.lang.RuntimeException: An error occured while executing doInBackground()

Bug 6336278

Tested that callers can handle null return value from this function.

Change-Id: I617daefff6c8b5d896419c64610e461a465fb15e
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
271b5212603ba1424ea2b95732932ab7c2368d14 13-Apr-2012 Tom Taylor <tomtaylor@google.com> Sending a video is almost impossible

Bug 5928519

I was able to reproduce this a couple of times, "Can't attach video" error.
After putting in some debug info, I couldn't repro the problem. Even rebooting,
just like in the original bug, I wasn't able to repro. Adding some log code
to print out the exception next time the bug occurs.

Change-Id: I584ad0ff99a55c91e57fef8c64f40f36ae327a96
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
6ac41e1f86acd6fdd37f72c98ea4dc386a1700b3 10-Apr-2012 Tom Taylor <tomtaylor@google.com> We should not auto convert multiple SMS to MMS messages

Bug 2216705

Restore the functionality of the original fix from:
https://android-git.corp.google.com/g/#change,40101
but keep the behavior from the subsequent CL:
https://android-git.corp.google.com/g/#/c/102637/

With this change, the messaging app's sms multipart functionality is
still controlled by the mms_config.xml flag "enableMultipartSMS". When
this is true, the user can type a message up to 2000 characters and it
will be broken up and sent as parts. If enableMultipartSMS is false, as
soon as the user types more than a single segment (i.e. 140 chars), the
message will be sent as mms. Like the original fix, there's no part
threshold anymore that determines when a long message will be converted
from a multi-part sms to an mms.

Change-Id: I5a70f27876417786a2d79436614cb02cc8c69f82
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
4cab16e396f9f5381e14121011d55a7c12e3c317 06-Apr-2012 Tom Taylor <tomtaylor@google.com> Empty forward draft not removed

Bug 6222154

A number of problems to fix for this relatively innocent looking bug.
First, the PDU was getting persisted on the UI thread. Second, persisting
a PDU automatically creates a thread, but on the forwarded message side,
the thread id wasn't getting set. Since the thread id was zero, the
working message code didn't think there was any draft to delete.

Change-Id: I3021b864bdf9876eb8c66e4048295516b085406f
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
08712ce9d30d4f28476436b218f2b76c7bdfb89c 29-Mar-2012 Tom Taylor <tomtaylor@google.com> Don't load draft on the UI thread

Bug 2475394

Load the draft off of the UI thread and then show
the editor. In most cases, you can't see any difference.

Change-Id: I7c2aedb0628a6efcd6355f888b4c9f6bb19fcb45
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
0ecc26df09777835cfa8dbfd3c48ca7b7fa7f011 27-Mar-2012 Tom Taylor <tomtaylor@google.com> Use the new DRM scheme in MMS

Bug 5158047

Change-Id: Id5d0ed03816b70c9f06b98af982cd5afb9af38d5
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
c7aa632be8e7d3ebe71f236f534ea2f0af71e04a 19-Mar-2012 Tom Taylor <tomtaylor@google.com> Add a widget for SMS/MMS

Bug 5935857

Change-Id: I1246487d974fef9de0f26e7b55fad2a940b084d5
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
ddd31c4011b4191035bdfbba05a8edb1785f71af 13-Mar-2012 Todor Kalaydjiev <todor@google.com> Give names to all background threads we create. No logic changes.

Also, fix some warnings by adding @Overrides, etc.

Change-Id: I3d7306f25fb917817359bd46b9274e04d86f4e26
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
51e4621fa12400b1e79cc18b7bb0f9a83af6b622 27-Feb-2012 Tom Taylor <tomtaylor@google.com> Scroll jank when scrolling MMS images

Bug 5919625

Load PDU, slideshow, and images in the background.

Change-Id: I456ba8e0044a902af7310427f3172441f40cf215
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
c7797433b1641be0cb77e02541b8bfed94c48835 07-Feb-2012 Tom Taylor <tomtaylor@google.com> MMS appears after delay in the thread

Bug 5032682
Bug 5939766

When sending an MMS, immediately insert a placeholder pdu in the pdu table
that'll show the user that we're in the process of sending the message.
Also fix a bug where typing a single char wouldn't bring up the contacts
search results.

Change-Id: I2f6f14048a07360b69a2529e8a61c524a753485c
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
37880013315d8b7abefd9081b2c36b060083d6fa 27-Jan-2012 Tom Taylor <tomtaylor@google.com> The pictures shown while playing a slide-show are very small

Bug 5180652
The slideshow pictures were showing thumbnails. Now show larger images.
Not perfect, but better than before.

Change-Id: I38222676e50923a8c69ffea2b323725e384d490d
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
40e9f8b3728339f5d0f0f16d84a05ccb0dda7636 12-Jan-2012 Todor Kalaydjiev <todor@google.com> Prime image thumbnail cache on background thread when adding MMS attachment

Change-Id: I7749e9242b0c711b1020399e0bd3c68aed733244
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
bb576861100138c4180438ec82c31be0dce44fc8 20-Dec-2011 Tom Taylor <tomtaylor@google.com> Not able to play attached audio file in Messaging Application

Bug 5782423
When an mms draft is deleted, the code needs to clear its draft uri
variable. Otherwise when the code goes to update a draft, it will try to
update a draft that's not there, rather than creating a new draft.

Change-Id: I92f252aaac4524d693827395becb341f06c0828f
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
c9d65756a13cf8633124204e2ddbcc044e5c992e 13-Dec-2011 Tom Taylor <tomtaylor@google.com> am b6f28459: am 5a859d2b: Remove extra logging statement

* commit 'b6f28459f6b9a2a551a4f03b5051a8031614021c':
Remove extra logging statement
5a859d2b5245b027c19be511c0406c1de9c71815 13-Dec-2011 Tom Taylor <tomtaylor@google.com> Remove extra logging statement

Bug 5749853
WorkingMessage is leaking the number the user types as a recipient
into the debug log. Remove the log statement.

Change-Id: I1fe1a0c6e3221c059d8bcfce1f4c51857c0b9fb3
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
a938871add9311f5c038d1b3e4e2d518c246a612 14-Nov-2011 Tom Taylor <tomtaylor@google.com> am b5a54885: Merge "Revert "5198894 Remove saveInstanceState"" into ics-mr1

* commit 'b5a54885cbe412fb00f58fc4d19695cd42096e33':
Revert "5198894 Remove saveInstanceState"
a95e267c5e123139f4551758586b1f44ef02f9d2 11-Nov-2011 Tom Taylor <tomtaylor@google.com> Revert "5198894 Remove saveInstanceState"

This reverts commit 7d128943d1b6377fdbe399eb919970ab9544867e.

At the same time, it fixes bug 1556157, where a picture sent via mms
from the camera, will show up again in a draft when ComposeMessageActivity
is killed and restarted. That behavior was caused by the fact that when
an activity is re-created with an instance bundle, it's passed the
original intent to attach a picture. With this fix, we don't try and
reattach a photo. In addition, killing the activity and restarting will
restore the activity to its pre-killed state (i.e. preserve the message,
subject, etc).

Change-Id: I2059d289bce6f40f11c286436c2fa0971d0ff273
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
9abae049669b8525b28ec4f4adb2e14372b4d931 02-Nov-2011 Tom Taylor <tomtaylor@google.com> If an attachment fails, preserve the old attachment

Bug 5420558
If you try to replace one attachment with another, but it fails (perhaps
the new attachment is too large), then the original attachment is wiped
out. This change will now restore the original slide if the attach fails.
The code is cleaned up and simplified.

Change-Id: I7dabf91bd9d04cc08412d08f033783c68a22e240
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
9a45977fe37e778320e29a6b116607716f94ee3b 26-Oct-2011 Tom Taylor <tomtaylor@google.com> am 1db5a0d5: Not showing error when message is too big

* commit '1db5a0d573c462a5be6f8da636b4a7db18a7bf08':
Not showing error when message is too big
1db5a0d573c462a5be6f8da636b4a7db18a7bf08 26-Oct-2011 Tom Taylor <tomtaylor@google.com> Not showing error when message is too big

Bug 5504281
When a user adds a large video and lot of pictures, there's not enough
room to compress the pictures and the app shows the user an error
dialog. When the dialog is dismissed, the user sees the message in
the "Sending..." state (even though the message wasn't sent). The problem
was very simple, the code for setting the error in the pending_msgs table
was using the wrong key so the message wasn't marked with an error. With
this change, the user sees the message tagged with an error, they can
tap it to edit it, and remove some of the slides and resend it. Granted,
it's an edge case, but it also explains why unsent message were showing
up as "Sending...", rather than marked with an error. Also, adding a log
for message resizing, since I've needed this debugging code twice in the
last few days.

Change-Id: I9ca5d20e2e7e45953098f4098cc154b2855a4f44
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
b2f0c15fb928fa96a6a74a2495437117c90667b2 13-Oct-2011 Tom Taylor <tomtaylor@google.com> am d73504a9: Merge "Sound name on slides not getting updated" into ics-mr0

* commit 'd73504a9682033088ce0348ec2bae55ef2e67519':
Sound name on slides not getting updated
5a9381876ce766cc761c3e6ed2ea9a67e19bd716 13-Oct-2011 Tom Taylor <tomtaylor@google.com> Sound name on slides not getting updated

Bug 5446866
The name of the sound on a slide wasn't getting updated on any slide
past the first. Also, change a bunch of LogTag.debug calls back into
Log.d calls. The LogTag.debug calls were crashing when a recipient name
contained formatting characters such as & or ().

Change-Id: Icfe3703d0d84ffb4f10090a59a9fcd994bf62b52
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
307aea97f34a1d872470d9a584464a037cb039b2 12-Oct-2011 Tom Taylor <tomtaylor@google.com> Messaging App does not discard draft after deleting it

Bug 5376774
Discarding the working message would delete the mms draft, but not the
sms draft. Delete both now in a more consistent fashion.

Change-Id: Ie9e2786d429e3c934aebe61db272f91a6675af71
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
40421e0b0316a4bf77e3e5f9a8b734ba6478f1c7 07-Oct-2011 Tom Taylor <tomtaylor@google.com> Slide duration not reset when all time-based objects removed

Bug 5426125
If we remove all the objects that have duration, reset the slide back to its
default duration. If we don't do this, if the user replaces a 10 sec video with
a 3 sec audio, the duration will remain at 10 sec.

Change-Id: I4283514643c344a76d9fa9e973665f16fec2ce8a
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
332967fe883b88229780670bbc0beee0af46d3e6 06-Oct-2011 Tom Taylor <tomtaylor@google.com> If replacing an attachment fails, working message left in bad state

Bug 5420558
The code needs to clear the attachment type after removing all of
the attachment data. Also need to update the screen whether the
attachment succeeds or fails.

Change-Id: I963ebd462d8e9757b8d5bebc59a9f391e15c7940
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
209ac103a11f5fb7aa3ebd266cf4ec74af42aa97 30-Sep-2011 Tom Taylor <tomtaylor@google.com> Messaging App does not discard draft after deleting it

Bug 5376774.
It was tempting to remove this block of code since the provider is no longer
automatically deleting empty threads. However, the comment is correct.
When the conversation has no messages, the user can still add recipients
and that would change the threadId. The solution is to delete the draft here.
We'll create a new one in onStop if necessary.

Change-Id: I3f79cb6c07ca67ba7280e2f78be9793581b87f84
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
8b4d5f1c72f25160c16f2c41ebb6febe5fb8873f 30-Sep-2011 David Mailhot <djmailhot@google.com> Merge "MMS Service and uaProfUrl config attribute late binding check"
68e246906f9c02a52edf383440c379201b626306 30-Sep-2011 David Mailhot <djmailhot@google.com> MMS Service and uaProfUrl config attribute late binding check

bug: 5373677
When the uaProfUrl config attribute is missing from mms_config.xml,
we want to allow SMS but crash MMS. Therefore, MMS should crash as
late as possible. We will warn with log messages if the uaProfUrl
is missing, and only crash with a runtime exception if the user
tries to send an MMS with an absent uaProfUrl.
Change-Id: I960e752538e3c3ee7d474327b89522c745a8a0c0
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
7268272e8d1099b00172d379628a33ca341025c9 29-Sep-2011 Tom Taylor <tomtaylor@google.com> verifySingleAddress is too early in sending an mms

Verify after the threadId has been created. Bug 5388908

Change-Id: I3a69a2bb9d475b9add43fc5fc508536c05fa51c0
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
b736686638eca62aa89cb15184711ef38413cb3e 28-Sep-2011 Tom Taylor <tomtaylor@google.com> SMS messages being delivered to wrong contact

Bug 5319828
Last ditch escape hatch at detecting an sms being sent to a wrong
contact. From what we've seen of a database where sending to the wrong
contact had taken place, the in-memory Conversation cache had the
correct threadId, but the wrong recipient. With this change, we do
two checks to verify that the recipients for a particular thread match
the recipients associated with the thread in the database.

Change-Id: I8f7c194243e6da093461c1aaae4119f05390582d
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
3877692b0f782ca321ce3a857b4168f771cf2ab6 27-Sep-2011 Tom Taylor <tomtaylor@google.com> java.lang.IllegalStateException: save() called after discard()

Bug 5372845
How can the monkey find this? Well, it can click on the menu "Delete thread"
and then click on anything else that'll cause saveMms to be called before
the onDeleteComplete callback gets executed. We've had this intentionally
thrown exception in the code for years and we're confident that we're
not trying to save deleted messages. With this change, we now do what we
do in saveDraft and that is bail out when the working message has been
discarded.

Change-Id: I262b7c153add3ebbed1044f4c51fe6899b963cd8
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
2ec2bbe0535821d79161dc3bcbf4438f5ef1c56e 23-Sep-2011 Tom Taylor <tomtaylor@google.com> Duration of the recorded audio played in the Mms application is always set to a audio captured in an earlier session

Great bug -- had to dive deep into the SMIL to figure out what was going
on. Fortunately, the fix is super simple. When replacing an attachment,
the code needs to reset the slide's duration to zero. Bug 5361657

Change-Id: I04eb7d4ab89c99ddf332bd2e81c5062df671485e
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
5fd2543851375fc764495584ddd319f5e7d13cb9 22-Sep-2011 Tom Taylor <tomtaylor@google.com> A cleaner fix for draft saving

Eliminate the window of vulernability where a thread can get deleted
while saving a draft.

Change-Id: Idb5bf9860f39c59d9391176fd2f6c081086d0d76
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
ef3eb49cde359d36f9536dbaffe5c16f3639c1f2 22-Sep-2011 Tom Taylor <tomtaylor@google.com> Fix a number of draft-related bugs

This CL contains a number of draft-related fixes. One is timing related.
While we're building the PDU for a draft, particularly a big PDU that
involves image resizing, the thread gets created first, before the PDU.
Meanwhile, ConversationList can finish its first query and delete any
empty threads. We guard against that several ways, but even still I
see cases where the thread gets deleted while the PDU is saving. When
that happens, pdu persister creates a new thread. Our working message's
conversation would still point to the old thread id. With this change,
we get the possibly new conversation after updating the pdu. Note that
all of these cases occur when this is a draft or the first message
in a thread. Also, there's a better fix for the zombie draft bug. We were
initiating deleting drafts when we cleared the conversation between message
sends. This sometimes caused us to delete the draft we were in the process
of sending. Now draft deletion only occurs at the end of sending. There's
still a small timing window where the draft can get deleted. That'll be
fixed in an upcoming CL.
Bug 5340360. Bug 5343360. Bug 5299114. Bug 5353623. Bug 5354900

Change-Id: I0f661959aed38d59daf5fa27b1f006953e15b80a
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
c1342c003f027f564b44b4f4f93d6a6e780aa1c7 18-Sep-2011 Tom Taylor <tomtaylor@google.com> SMS messages being delivered to wrong contact

When we observe the conversation cache is out-of-date, update
the conversation in the cache. Also, fix a bug removing an attachment.
The old pdu wasn't getting deleted. Bug 5319828

Change-Id: I46dbc698a76d4f8bc8fe2a93a967df410a4f557a
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
df041b7b2d335c21947c7264b304b4b8d5a17080 17-Sep-2011 Tom Taylor <tomtaylor@google.com> First sent message doesn't show up

When we're clearing the conversation between message sends, don't
reset the threadId to zero if there are no messages -- that's the state
we're in when we send the first message. Bug 5334855

Change-Id: Iafd3f77cbad55a5cd4a45074339c4e41c3d742e4
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
dbb58454542a3f2a1da5379b889d0e3776881ae2 15-Sep-2011 Tom Taylor <tomtaylor@google.com> Zombie draft can't be killed

The Mms draft wasn't getting deleted in WorkingMessage.clearConversation.
Bug 5313637

Change-Id: Iea14cc6d16922060b9791943548fb6dd8dbff99d
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
fcca7b38fcc90a781f1507a0a135a64e3ae8f6d8 14-Sep-2011 Tom Taylor <tomtaylor@google.com> Attached picture is not saved in drafts when a received message is opened from notification bar

Our mConversation.sameRecipient() code didn't work on uri's from
notifications that contained a threadId instead of a number. Therefore,
an incoming message never matched a new draft that had a threadId of
zero, even when the recipients matched. When we decided a conversation
matched, the code didn't update itself or the working message with the
updated conversation that has a valid threadId. Bug 5250265

Change-Id: I6c97d5c53cf75d97b652b7635020c2cb30855761
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
f89f24a7595ded1355da36d3c1229450a6157a0b 30-Aug-2011 Tom Taylor <tomtaylor@google.com> Failed to initialize the slide-list on selecting slide show attachment

The key to this bug is to add an empty subject and then add a slideshow.
Because the subject is empty and onStop on ComposeMessageActivity
is getting called when the slideshow editor is displayed, CMA is saving
the draft. Since the subject is now empty, the draft gets downgraded to
an sms and the mms draft gets deleted behind the slideshow editor's back.
The safest solution is to not be so eager to remove an empty subject.
For this edge case, an empty subject will be removed when the user hits
send and the message will be sent as an sms if possible. Bug 5181255

Change-Id: I9c08f744928211af0a336f67eb32b258f58f4622
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
7d128943d1b6377fdbe399eb919970ab9544867e 23-Aug-2011 Tom Taylor <tomtaylor@google.com> 5198894 Remove saveInstanceState

ComposeMessageActivity has code in onSaveInstanceState to save
the working message, the recipients, and uri to the bundle.
In onCreate, this bundle was used to restore the conversation
and working message, regardless of the current intent. Since
the code is already saving and restoring the draft, let's
remove the saveInstanceState code. Bug 5198894

Change-Id: I038269020e4f02e1390b3a62a13278cfd72303ac
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
b3217a6ddcd9455968de7078bfbc0a901b4ff705 16-Aug-2011 Tom Taylor <tomtaylor@google.com> Merge debugging messages and tools to master

Merge the newly added debugging messages and database dump tools from
gingerbread into master. Bug 5133439

Change-Id: I191960a79c7dc60f7e5f731ab952f06c5c9383c4
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
b85cfae9dc792a11296edd3c58747c1e140f6852 12-Aug-2011 Tom Taylor <tomtaylor@google.com> Unable to remove slideshow from chat view

Add a remove button to the slideshow editor. Bug 5139743

Change-Id: I3cebc4ae17722b74c5169c31661297c3a235819d
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
3d22f559d76a8697a472ad1e1f5a44d339dc7f46 09-Aug-2011 Tom Taylor <tomtaylor@google.com> Discarded message with picture is displayed in drafts

Bug 5137014

Change-Id: Iafbf78ec1da33b8cd3bb8cb0d841c33da4382290
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
5e1c97e1f90901c48bfde61a1ddb5fbc7e0a0c39 21-Jun-2011 Tom Taylor <tomtaylor@google.com> Use per-method ranking.

- send feedback to ContactsProvider
- use per-method sort order

Change-Id: I8d0c154d83a09050456a697e09c8a4532d3f1611
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
c087f20de7f651db6b073b2c91e8db8990455a69 08-Jun-2011 Soojung Shin <sj46.shin@samsung.com> am 84e63165: am 038817ff: Fix force-close when attaching a video too large for MMS

* commit '84e6316529924d1b91eeb3c1f07121cfdfa1382d':
Fix force-close when attaching a video too large for MMS
038817fffb2fb8045393443cab7392e6114dfc3d 25-May-2011 Soojung Shin <sj46.shin@samsung.com> Fix force-close when attaching a video too large for MMS

Attaching images and small video is OK but the force-close
popup is showing up instead of "message size limit reached"
popup when attaching a large video.

Change-Id: I1b4885760aec5fb9f44c69524fe8cab18af2b9e8
Signed-off-by: Soojung Shin <sj46.shin@samsung.com>
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
eaefafcdfe6165ed14a72583223a21b31c0b816c 12-Apr-2011 Tom Taylor <tomtaylor@google.com> am 999ab340: am a7f93880: Fix NPE at com.android.internal.telephony.cdma.sms.BearerData.countAsciiSeptets

* commit '999ab340d80eece5313920b80b29603fff978f2c':
Fix NPE at com.android.internal.telephony.cdma.sms.BearerData.countAsciiSeptets
a7f93880871894d2f6721ae07052e713613b4bf1 11-Apr-2011 Tom Taylor <tomtaylor@google.com> Fix NPE at com.android.internal.telephony.cdma.sms.BearerData.countAsciiSeptets

Check for empty text. Bug 4268602

Change-Id: I08dd567ad79a96ec92d4c418dd8e0f294ee66f4e
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
1d145e32fc5502037a0f9fe000b4127f62fc0f92 29-Mar-2011 Soojung Shin <sj46.shin@samsung.com> am 8d173b4c: am c8859ed1: Keep MMS mode with >160 characters after removing attachment

* commit '8d173b4cbca1bbdf571034ad6585f07bc973dcd7':
Keep MMS mode with >160 characters after removing attachment
c8859ed1e7b47996762dcb34f160521f276dccdf 24-Mar-2011 Soojung Shin <sj46.shin@samsung.com> Keep MMS mode with >160 characters after removing attachment

1. Compose SMS with <=160 characters.
2. Add an attachment.
3. Add some characters to make >160.
4. Remove the attachment.

Result:
Message mode is switched to SMS.

Expected result:
Message mode should not be switched.

Change-Id: Ie71a74bdb6037b6fefe2166c1ea2972d8fc67c1c
Signed-off-by: Soojung Shin <sj46.shin@samsung.com>
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
a47eb9f7bfec0a4a07b80c6123abed80d74e12ab 18-Mar-2011 Soojung Shin <sj46.shin@samsung.com> am 2c4537cb: am 9aed641d: Allow choice between multi-part SMS and MMS

* commit '2c4537cbed9aa5069e86d456aabdc1030a62d0d3':
Allow choice between multi-part SMS and MMS
9aed641d68fafdec88f83d9c4f949ca9ab6fdb0e 16-Mar-2011 Soojung Shin <sj46.shin@samsung.com> Allow choice between multi-part SMS and MMS

- Messages with over 160 characters can be sent via MMS or
multi-part SMS.

- Deal with slide durations that the MMSC does not
support.

Change-Id: I35ad6d2e7ca23edfb49b6790f8f57053bf1c5bca
Signed-off-by: Soojung Shin <sj46.shin@samsung.com>
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
b2b40738c2a0c60077e6bc530e91041889fdf675 31-Jan-2011 Jean-Baptiste Queru <jbq@google.com> am 1cd7f1a7: am 0fefd94a: Merge from open-source gingerbread

* commit '1cd7f1a7dea650e4131e499d08bde559105f628e':
fix mms crash when large video file is sent
0fefd94aa88d4a5b456ddc9775d9deeb3048c696 31-Jan-2011 Jean-Baptiste Queru <jbq@google.com> Merge from open-source gingerbread

Change-Id: I9c91c58901533a01df03ff62c1a08b6271a3f26c
c975a8acc0afd1bb716a59e1e555a533c6aa8c43 26-Jan-2011 Ritu Srivastava <rsrivast@sta.samsung.com> fix mms crash when large video file is sent

If we try to attach a video with size more than allowed by
CarrierContentRestriction in the Messaging application
(ComposeMessageActivity), the app crashes since it tries to delete a
message from database with improper URI (null value). Prevent the
deletion of message with null URI in correctAttachmentSize()

Change-Id: Icc08419accc23f13e80376b2078b2494815ee87f

Signed-off-by: Madan Ankapura <mankapur@sta.samsung.com>
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
eae4b7e0cfff6b835736f5c35becb9afc229cf17 05-Jan-2011 Tom Taylor <tomtaylor@google.com> Sms sent to wrong recipient

Remove the empty conversation from the conversation cache.
Bug 3057952

Change-Id: I5b208f5d071dac89af0ac9bd5af43b0286bbf60f
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
72ab3ecfa3556866ee51b822f8ce5b1f2f117545 05-Jan-2011 Tom Taylor <tomtaylor@google.com> Merge changes from gingerbread

Manually merge some of the gingerbread changes that didn't get auto-merged
back into master.

Change-Id: Ibfea8d1317f16717e5cb3f2ea1ec6c16a9ab9b83
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
de129d0282be10ff51d3a0fd8b56d3dd89b5e871 05-Jan-2011 Tom Taylor <tomtaylor@google.com> am 7628dd31: am 8c9d1ba7: Sms sent to wrong recipient

* commit '7628dd31687c3490924076b51d67fa432c96b95a':
Sms sent to wrong recipient
8c9d1ba7193db210cf3930f8814b4a320f2d6188 05-Jan-2011 Tom Taylor <tomtaylor@google.com> Sms sent to wrong recipient

Remove the empty conversation from the conversation cache.
Bug 3057952

Change-Id: I5b208f5d071dac89af0ac9bd5af43b0286bbf60f
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
9337760339d7d3a1cace8a2acfc2df7e50219a89 03-Jan-2011 Wei Huang <weih@google.com> Merge commit 'f9466d4b' into manualmerge

Conflicts:
src/com/android/mms/data/WorkingMessage.java
src/com/android/mms/ui/ComposeMessageActivity.java

Change-Id: If66a2c8d1573c09fc47b94c56915c916720a607c
858d59e9f4b0839ee014e52e0744ea910d9830ff 03-Jan-2011 Wei Huang <weih@google.com> bug #3057952: add bunch more debugging info to catch this bug.

Change-Id: I3ea9bd19adcf177697536cc56ab079957f863463
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
4d72768e5f149a6bcd40604d1e2741795cc86ebf 18-Oct-2010 Tom Taylor <tomtaylor@google.com> Prepare for turning off extensive logging

Bug 3062274

Change-Id: I02dbc06b6502d8f50ba7bb2dca367623364adc40
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
d667c0d20a33ef48802048516098523df62553cb 11-Oct-2010 Tom Taylor <tomtaylor@google.com> Tighten recipient check

When we send a message, the recips in the UI can be empty when the
user manually types in a number and hits send. prepareForSave() then
turns those working numbers into real recips. Add an extra test
for that situation before complaining of different recips.
Bug 3066322

Change-Id: I4aaa86138bc9aa817848b24cc5aac1c7718fe735
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
ca8c3f609566ac750fdbd2b01d8983b299faf5d6 09-Oct-2010 Tom Taylor <tomtaylor@google.com> Fix too strict scary message

Don't check threadIds in syncWorkingRecipients. Instead, check recipients
across a call to prepareForSave in send. Bug 3076599

Change-Id: I26f12370bfb7e42196194edd1374ca2b89997595
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
e28d2fe95c2ef64be593b75dcc61d41caf8d2f51 06-Oct-2010 Tom Taylor <tomtaylor@google.com> Loosen recipients check

A valid sending scenario was found where we were complaining the
recipients didn't match. Bug 3066322

Change-Id: I53da6a9a9d063d09826ce7f955a2dfaaf0633b38
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
b6e4518a7b3740e48fd03f3803cc8696f15bbcc7 05-Oct-2010 Tom Taylor <tomtaylor@google.com> Add debugging code

Add a number of tests to try and track down the situation that causes
a message to be sent to the wrong recipient. Bug 3057952

Change-Id: I2da3e91dcb039e87c3222e48026b859d1644793e
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
b45f4f5d4a97f9adb4d9562026caf8b2cbfd7309 19-May-2010 Wei Huang <weih@google.com> am 8f84adfa: am d669a2b2: bug #2694518: remove Google Voice private API in MMS app per discussion with team.
d669a2b2fcde0f588944af6caaca814a1bd4e92d 18-May-2010 Wei Huang <weih@google.com> bug #2694518: remove Google Voice private API in MMS app per discussion with team.

- we decided that we cannot have Google specific code in a platform application like MMS. Will revisit this feature in Gingerbread.

Change-Id: I5cf030a759be54ab32032a95141472a4fd89b5da
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
ac551c101b12f905707ad9321bbe94c908ef85fd 22-Apr-2010 Tom Taylor <tomtaylor@google.com> Fix MMS to work with GoogleVoice

Look for a GV BroadcastReceiver rather than an activity.
Tested with sample app. Bug 2614752

Change-Id: Ic52e18ab40ec4813856db3f75dc8722e309a47ff
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
d67c8ab99c0355a70b4fb4b0a7aba8e6c6dfc04c 22-Apr-2010 Tom Taylor <tomtaylor@google.com> Fix MMS to work with GoogleVoice

Look for a GV BroadcastReceiver rather than an activity.
Tested with sample app. Bug 2614752

Change-Id: I487e47c47ef07524cf5b6f8460a3e77d97a9117b
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
a6dd14dc0963aa8f30e625aa88e925e3fa0744f0 25-Jan-2010 Bai Tao <michaelbai@google.com> Provides a way to let user select the recipients from a list of phone numbers.
a. Add a buttion beside to recipients box.
b. The multiple phones picker which is implemented in Contacts is launched when user touch the button. The existent recpients are selected by default.
c. The user's selection will be populated to recipient's box when being back from multiple phones picker.

Also fix the related issue that the draft message is left once the recipient is changed.

Change-Id: I036b65dd1a651aae2fbb2e58a4b2b9e126ca4e74
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
c146e65d921676f7d7ca19a56b6b0ae9406a002b 01-Apr-2010 Mark Wagner <mxw@google.com> fix race condition unregistering receivers

bug 2553387

Change-Id: I43b37c0104bfbe22be81d1f938c4ff66240557bc
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
46bf2f57d3b88e90dc40527e1cae6f8032d27fcc 23-Mar-2010 Tom Taylor <tomtaylor@google.com> Fix sms and mms draft confusion

When saving an mms draft, any older sms draft associated with that
same thread is deleted. That was the intent. However, the code for
getting the thread_id was in a separate thread. The code that deleted
the old sms draft was outside that thread and the conversation's
thread_id was still zero. Very simple fix. Bug 2534828.

Change-Id: Ice72770bdd506840883afd9f81a66d3447b3b764
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
cb595f45ed21caac7f686d6088b7adef123ea4a4 22-Mar-2010 Tom Taylor <tomtaylor@google.com> Unregister broadcast receivers

ComposeMessageActivity needs to unregister the receivers setup by
WorkingMessage when onStop is called. Bug 2534223.

Change-Id: I44114098bf747cda3f18a81d0fe8d329dc57db80
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
8e968f44285098c78c3e923ee673b111a5642fe9 10-Mar-2010 Suchi Amalapurapu <asuchitra@google.com> Handle new apps on sd notifications for google voice

Change-Id: I2a3fbaf4bad385b983f40fa92cced37d8d0bb0fe
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
cec2a0065dbbdce52c2de5ff994dd4417af4ee7f 10-Mar-2010 Tom Taylor <tomtaylor@google.com> Don't crash in discard()

If WorkingMessage.discard() is called more than once, the code throws
a fatal exception. This was fine for testing, but it shipped like this
in 2.0 and results in unncecessary crashes. With this fix, we simply
detect the fact that discard has already been called and then return.
Bug 2497842. Bug 2502735.

Change-Id: Ifaf2d22293ca0e13de4ccd66f7e51b3c46952502
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
aa4b998c5125786a50845767f0027cfc917fbb1a 09-Mar-2010 Bai Tao <michaelbai@google.com> Correct the attachment type in setAttachement()
It will remove the send button when more than one pictures will be sent through
the SEND_MULTIPLE intent.
Fix issue http://2419923

Change-Id: I619e8fe01decb1375e19702cd65baf80b971bd24
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
f7e8281a223af6228e6399055a6197a1edd9bc3a 09-Mar-2010 Tom Taylor <tomtaylor@google.com> Remove mms-common

Get rid of the mms-common library and move the mms files back into the
framework where they originally came from.

Change-Id: I8ce2b0a2a3cfc6b7da13ce0e791173c09dd8f0f5
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
c7b4497d1129fbfc1a69ee3c5a30e28153afd3e8 08-Mar-2010 Tom Taylor <tomtaylor@google.com> Fix empty draft

When an attachment is added, the working message is bumped up to a
temporary Mms state. Once the attachment is added, the various
flags in working message will be updated and that temporary state
removed. However, if the user backs out of adding an attachment,
the working message will be left in the fake Mms state and on
exit, will cause an empty draft to be saved. Now we clear that
fake Mms state when we return from adding a draft, successful or not.
Bug 2493456.

Change-Id: I596efbee0bcd54c30b1de4f4aedf1b9c6919f947
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
6a78e60e584cb440c63198b87f8aba6b4c07f8ca 03-Mar-2010 Tom Taylor <tomtaylor@google.com> Don't delete draft unless we need to

Don't even look for a draft unless the conversation says we've got a draft.
Don't delete the draft unless the draft is the only message in the
conversation. Excess drafts will get deleted at send time (or in various
other places where we save the draft or discard). Fix one of the
Conversation constructor's to use the cache. Otherwise, ConversationList
activity was updating all the conversations, but all the other activities
were retrieving old conversations from the cache. Bugs 2483022 and 2329323.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
436042159134e8ecbc57097340a5bd81f2912574 27-Feb-2010 Tom Taylor <tomtaylor@google.com> Avoid unnecessary DB updates

Making database updates at the same time we're trying to read the list of
messages in a conversation causes any further queries to block until the updates
are complete. This results in taking a long time to display a new
message when the user selects the sms notification. With this change,
we block marking a thread as "read" until we've completed the query for
a conversation's list of messages. Also, every delete causes several
DB updates inside the provider. We can avoid one of these deletes that causes
so many updates if the thread has no drafts. Now responding to a new message
notification only results in two updates (one to the sms table and one to the
pdu table) and that happens after the messages are loaded.
Bug 2467382.

Change-Id: I2a78023e3ba7dee72c110d2023f4c79b1b816565
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
feb1aab54eabc98a04349af52e19ff9fbcd7c169 26-Jan-2010 Tom Taylor <tomtaylor@google.com> Enable GoogleVoice to intercept SMS sends

If GoogleVoice is installed, send it an intent and give it
a chance to handle sending the message. If it doesn't handle
the message or GoogleVoice isn't installed, then send the
message normally via the telephony layer.
Fixes bug: 2338847.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
3643ac18361ebb2c6194569ac7ee2f0927155f07 12-Feb-2010 Wei Huang <weih@google.com> resolved conflicts for merge of 5b783617 to master

Change-Id: I77c46fd688d67accb60194af334c8404222c6e5c
4ee7aa9aec45dd564c0e82928fa5a8378e856dcf 11-Feb-2010 Wei Huang <weih@google.com> bug #2434183: guard against ArrayIndexOutOfBoundEx when there is an empty slide show.

Change-Id: Iad96489e787d3e6cb9162ced4adbf164566bf421
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
540d263efa2830c154fc32bbad2a7e703cf5747d 10-Feb-2010 Tom Taylor <tomtaylor@google.com> Unlimited SMS message length

Remove the code that auto-converts a long SMS message into a
MMS message. We now allow a user to send unlimited length SMS
messages that get turned into multi-part SMS's. Add a UI test
for this feature. Bug 2216705

Change-Id: I0408e195dd98e2322e1d43360c49cfadb2c97939
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
0d4645de339b4681d18198ba7451e7b8807116f9 08-Feb-2010 Tom Taylor <tomtaylor@google.com> Handle multi-image resize out-of-memory

In some cases when attaching many photos to a slideshow,
the system will run out of memory trying to resize a photo
to a smaller size. Handle that case, cancel the send, and
mark the message with an error so they can edit it and resend it.
Fixes bug 2420008.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
4cd245dd6fc1b9e45d774fbccc54a69a3a765861 01-Feb-2010 Maryam Garrett <mkamvar@google.com> src/com/android/mms/transaction/SmsMessageSender.java

This change adds in logging of "IME_TEXT_ACCEPTED" event,
one metric of user happiness, for the SMS application.

Change-Id: Ibf1adf278111f22f37801c6822d41fc72211cb5c
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
fd644551e8506266aad2b76463b51b44154ed62f 29-Jan-2010 Tom Taylor <tomtaylor@google.com> Update refs now that MMS is removed

Move MMS to mms-common library. Update imports.

Change-Id: I28fa24a68c27977eba58cb62f2667596d3abe2c4
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
6be18bedb5b87dbbcdb54f37d5a0945bd0f71377 17-Dec-2009 Tom Taylor <tomtaylor@google.com> Unbundling work

This is the first step in unbundling the Mms app. Some of the changes include:
- moving some of the Mms code from the framework into the app itself.
- same with emoticons
- remove dependency on internal drawables and add local copy to mms
- some dependencies on various internal classes now moved to android-common library
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
10eed0e3020e3eb0612747fe39e0f6117222dd95 09-Dec-2009 Tom Taylor <tomtaylor@google.com> Resize pictures at send time

Before this change, picture attachments would get resized as they
were added to a message. This means the first picture could take up
to the whole message space, the second picture any remaining space, etc.
With this change, pictures aren't resized until after the user hits
send. The remaining space in a message is divided equally among all
the picture attachments and they're resized to fit within that space.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
b259ebbdef366c08711fd6fd0f6122bcacdcfdeb 03-Dec-2009 Tom Taylor <tomtaylor@google.com> A whitespace message is not a message

Don't enable the send button on a message that's just whitespace.
Likewise, a whitespace-only message won't be saved as a draft.
In addition, the same rules now apply to a subject. A subject of
just whitespace doesn't count as a subject.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
8c8e093724540586cb093181c2557b7ec0b661a5 05-Nov-2009 Tom Taylor <tomtaylor@google.com> Don't show Converting to MMS

When we open a thread where the recipient is an
email address, don't automatically show the "Converting
to multimedia message" The user already saw that when
he/she added the email recipient. Bug 2235226.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
6646f0f7e8fa5797926f93938a3b4ab1018ea4d1 10-Nov-2009 Wei Huang <weih@google.com> am 431e11d4: bug 2236535: find a way to update the stale canonical_addresses entries with new SMS/MMS number.

Merge commit '431e11d429783c07eca6e789de0518d17b42fb74' into eclair-mr2

* commit '431e11d429783c07eca6e789de0518d17b42fb74':
bug 2236535: find a way to update the stale canonical_addresses entries with new SMS/MMS number.
7df759534e01a839ff51b38cfefec629ea5f2ff1 10-Nov-2009 Wei Huang <weih@google.com> am 963f4a96: bug 2245490: fix MMS makeSendPdu() not to return null.

Merge commit '963f4a964e227d62eddbe2e1f6fb0721f665f4d2' into eclair-mr2

* commit '963f4a964e227d62eddbe2e1f6fb0721f665f4d2':
bug 2245490: fix MMS makeSendPdu() not to return null.
431e11d429783c07eca6e789de0518d17b42fb74 07-Nov-2009 Wei Huang <weih@google.com> bug 2236535: find a way to update the stale canonical_addresses entries with new SMS/MMS number.

- when the user sends a message, let's check if the new message's address is different than the one
stored in the recipientId's cache. If it is, let's update the cache and the underlying canonical_addresses
table in the db, so we wouldn't keep using a bad number for future references.

Change-Id: I3ac9940fa3c37d29c7398cac4535915249469563
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
963f4a964e227d62eddbe2e1f6fb0721f665f4d2 08-Nov-2009 Wei Huang <weih@google.com> bug 2245490: fix MMS makeSendPdu() not to return null.

- one of my previous change allowed makeSendPdu() to return null if there is not a valid recipient for the message.
However, there is a separate code path that makes the recipientless message a valid scenario. So always return
a valid pdu object.

Change-Id: Ice49d158e23374ca31575efc523af7e063bcb2ff
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
39ca71db85505dad745f31d620b790bbabeb784b 06-Nov-2009 Wei Huang <weih@google.com> am 78f81825: bug 2236527: need to scrub the phone number before sending a MMS message.

Merge commit '78f81825431c8c52cad57bc4a363747533a701ab' into eclair-mr2

* commit '78f81825431c8c52cad57bc4a363747533a701ab':
bug 2236527: need to scrub the phone number before sending a MMS message.
78f81825431c8c52cad57bc4a363747533a701ab 06-Nov-2009 Wei Huang <weih@google.com> bug 2236527: need to scrub the phone number before sending a MMS message.

- add MMS address validity checking and scrubbing. If the phone number used to send a MMS message
contains invalid characters (non digits and non-valid separators), we now warn the user when he tries
to send the message. The prior validity checking code only checks against GSM SMS address, so it
would miss all the invalid chars for MMS address.

- assuming the MMS address is ok but contains separators that are not valid MMS address chars (as
far as the network is concerned), we scrub the number when creating the SendReq data structure for
MMS message.

- flag a few places where things are still not correct, but too risky to fix for MR1.

Change-Id: Ia80a2736f955b94a8cac51ffeb06617a95580ab8
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
200d37d90dd7640aa909edca6a2b55961faa5824 05-Nov-2009 Tom Taylor <tomtaylor@google.com> Don't show Converting to MMS

When we open a thread where the recipient is an
email address, don't automatically show the "Converting
to multimedia message" The user already saw that when
he/she added the email recipient. Bug 2235226.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
2a2a928f8b277d09cfc7032629b5f47447e73fa4 27-Oct-2009 Wei Huang <weih@google.com> bug 2183215: clear stale draft state in the draft cache.

- when deleting a draft message (in CMA), we need to clear the draft state for the thread_id that's been released by the draft message. Otherwise, if a new message arrives and gets assigned the same thread id, the draft cache would have incorrect state.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
ce028797bad547286b4ca6812d06489a83dd7201 22-Oct-2009 Tom Taylor <tomtaylor@google.com> am 16f98e62: Show "converting to mms" message

Merge commit '16f98e62c279550854e665e25c212ea0b04a6b6b' into eclair-mr2

* commit '16f98e62c279550854e665e25c212ea0b04a6b6b':
Show "converting to mms" message
16f98e62c279550854e665e25c212ea0b04a6b6b 21-Oct-2009 Tom Taylor <tomtaylor@google.com> Show "converting to mms" message

There's one path when we have to downscale an attached picture where
we weren't showing the "converting to mms" message.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
da45ea49883b2b0e2aad4ce2c738a61bf4e59b9f 15-Oct-2009 Tom Taylor <tomtaylor@google.com> Honor subject charset

When retrieving the subject from the pdu, we have to look at the
subject char set and use that value to decode the string.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
f23be4b40e03cda149f9e0e1459bfc37c5ea7fa8 07-Oct-2009 Wei Huang <weih@google.com> am 4f485ea3: bug 2169583: fix a thread mixup problem caused by empty draft message having an unaccounted for thread id.

Merge commit '4f485ea3aabce679b3d749ba843fee5134ebf118' into eclair-mr2

* commit '4f485ea3aabce679b3d749ba843fee5134ebf118':
bug 2169583: fix a thread mixup problem caused by empty draft message having an unaccounted for thread id.
4f485ea3aabce679b3d749ba843fee5134ebf118 07-Oct-2009 Wei Huang <weih@google.com> bug 2169583: fix a thread mixup problem caused by empty draft message having an unaccounted for thread id.

- there is a situation where if the user tries to attach an image in an empty draft message, we'd allocate
a thread id (creating one in the db), but immediately deleting it because the draft message is empty.
However, when we deleted the empty draft message, we didn't invalidate the in-memory thread id from the
initial allocation. At this point if a new message arrives and takes the same thread id, it will cause
the CMA to requery and pull in the new message to the draft message thread incorrectly (because both
have the same thread id).

Change-Id: I7981eb1ec1f4ba1e2650325093c2b60ac4324b94
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
1d95d8928940553e9e99f34ad075865b9b34781c 03-Oct-2009 Tom Taylor <tomtaylor@google.com> Respect Mms disabled

When Mms is disabled, don't let a long message trigger the logic that turns
a multi-segment Sms message into a single Mms message. In fact, when Mms
is disabled, physically disable the ability for the app to set any of the
Mms flags.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
1cf7f03f05cf0a1172f027f75f67a6fff336c79b 30-Sep-2009 Tom Taylor <tomtaylor@google.com> Handle out-of-memory while decoding image

When adding images to a mms message we attempt to resize an image, if
necessary, to keep the message within its maximum message length. In
some cases, the first crack at decoding the image can throw an
out-of-memory exception. With this change, we catch that exception and
try decoding again at a smaller scale.

Change-Id: Id8ebcab4c407f316dd850640ab8f058845fb7054
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
d62ef06699b3ca5048c5642bd50300e9a2eb04a1 23-Sep-2009 Tom Taylor <tomtaylor@google.com> Fix draft bug

Fix a special case of working on a draft and then getting a new intent for that same
draft. Recognize we've got the same conversation rather than trying to save the draft
and reload the same draft. Add more logging to Conversation and WorkingMessage and move
the common logging code into LogTag.

Change-Id: I1388967f3f2e7520e08730036243f958574a6001
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
817eb982a66303a8f87fc3061e3493a232627e96 16-Sep-2009 Satish Roddom <satishroddom@motorola.com> Support sending SMS to carrier alias via sms-to-email

To support this carrier feature without breaking other checks, the following logic is used:

If the existing Email address check fails, check whether entered recipient is a valid
phone number. If not check whether it is an alias, and if it is an alias, send it to Email
gateway.

Bug: 1999421
Change-Id: I4d8184bf0911bb4426c5a73e86cd932b999c107b
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
692636241c9858b6b535c876a79be2f04d8201b5 18-Sep-2009 Tom Taylor <tomtaylor@google.com> Calc unsent message sizes

Allow 4 * maxMessageSize worth of unsent MMS messages before blocking the
user from sending any more MMS's.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
c44a89a040956a7b9635de4a9bcf1d7230692750 17-Sep-2009 Tom Taylor <tomtaylor@google.com> Add MMS unsent limit

Don't let unsent Mms message pileup. They chew up a lot of memory. After
a configurable limit (default 4), don't allow the user to send any more
Mms's.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
782238c8102fc32f96359f6fc5a01715806d4f77 11-Sep-2009 Tom Taylor <tomtaylor@google.com> Null check

Fix a rare crasher by preventing us from passing a null uri
down the save-pdu pipeline.

Change-Id: I800548cef8bc00fd5d64db1a5acdf07f6f9d1aee
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
70262ed72605a86706b3a63810d34adbfd0868a7 09-Sep-2009 Wei Huang <weih@google.com> Fix bug 2099044: don't display "convert to SMS ..." too eagerly.

- basically, don't display message status changes when saving draft (done only in onStop and onNewIntent). I think it's sufficient to display the message status when

- the user adds/removes attachment and subject.
- the user hits send we reconcile the message protocol before sending.

Change-Id: If10e5101f11a645b66d6082fa343709fa90887ef
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
0d798c0853ead129b245ac7e8700f3a4aba92ecb 03-Sep-2009 Wei Huang <weih@google.com> tweak logging SMS sending and receiving.

Change-Id: Ia037cd8d63956c05c75f690df35a0dc4ef1b24f3
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
812391ad832f3fdac054ad3a50af563da16e99b5 25-Aug-2009 Wei Huang <weih@google.com> Add onNewIntent() to ComposeMessageActivity, and add the launchmode="singleTop" to AndroidManifest.xml. Just specifying the intent flag Intent.FLAG_ACTIVITY_SINGLE_TOP doesn't make the activity single top.

(cc: Dianne only for the activity launch mode flags in AndroidManifest.xml)

- the singletop launch mode is needed for the case when we receive a new message notification for the same contact that's on CMA already. If CMA has a MMS draft on screen (but not saved to db yet), not going thru. onNewIntent() would cause the following bad sequence.

- onCreate() would load any draft saved in db, but in this case there isn't draft saved in db yet because we only save draft in CMA.onStop(). So loadDraft() would load the empty draft.
- onStop() on the old CMA activity would now save the in-memory MMS draft to db.
- the new CMA lost the MMS draft that's there before clicking on the notification. But resulting db has the MMS draft, which is now orphaned and not associated with the conversation. From here on out, entering and exiting the CMA for this conversation would not see the MMS draft, but it's there in the part table in db. VERY BAD!

so with onNewIntent(), we can check if the new intent's recipient is the same as the old one, and skip the whole shenanigan.

- add debug logging for draft cache. Changed the log tag for draft cache to "Mms:draft", and CMA to "Mms:compose".
- guard against null cursor returned from Contacts query. Contacts is very flaky right now, and I am getting a null cursor from it all the time.
- reorg logging. Add new LogTag class. Log MMS app logs using "Mms:app" and transaction logs using "Mms:transaction".

Change-Id: I5e12c87ab378ff9b6ff326e136598f64bd423129
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
396a06af4e393f5aab3864c43392a67c60715d38 17-Aug-2009 Tom Taylor <tomtaylor@google.com> Don't show convert message

When forwarding a MMS message, the user would see "Converting to MMS" even
though the message was already an MMS. There are a couple of situations where
we are initializing a message where we are too zealous showing the message.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
edd39351defc331fc268a6ed88338f64fe6f17cf 12-Aug-2009 Tom Taylor <tomtaylor@google.com> Support multiple send intent

Allow a user to send multiple pictures/videos in an mms message. Each
gets added as its own slide.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
8b8512311239cfd2b086827a406de636c6f0e197 04-Aug-2009 Satish Roddom <satishroddom@motorola.com> Fix crash when sending SMS to email address

Must call ensureSlideshow() and syncTextToSlideshow(), otherwise in send()
function, variable "slideshow" will be NULL and results in force close.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
5cbf11ad39767245f1a9ef467963d270f19a5fab 22-Jul-2009 Tom Taylor <tomtaylor@google.com> Fix a MMS crasher

This is the fix for bug 1975670, though if you read that bug, you'll swear it's
talking about a different one than my fix description which follows. When a user
receives a MMS with an attachment and goes into ComposeMessageActivity to read it,
a new WorkingMessage is created in case the user types a response. Once inside CMP,
the user may click on the attachment (to see the picture, etc.). Eventually, CMP's
onStop gets called. The WorkingMessage is empty so it is discarded. Once the user is
back in CMP, they're sitting on a time bomb with a discarded WorkingMessage. If they
try and delete the thread (the original bug), they'll get an exception that the working
message has already been deleted. This simple fix is to undelete the WorkingMessage
in onRestart.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
07ce1878a36d2df1707dd4bbd9cd7235679bdc94 16-Jul-2009 Tom Taylor <tomtaylor@google.com> Fix a problem with drafts

This is a fix for bug 1973603. If you go into SMS from contacts and create a draft
and in the meantime receive a message from that same contact, we'd crash in the
conversation cache trying to add the new conversation. This crash occured because
the draft conversation wasn't getting cleared out of the cache after thread was
deleted on disk. Since conversations in the cache are "equal" by recipients, the
incoming recipient matched the stale conversation in the cache. It gets even more
tricky. Bottom line: anytime a thread is deleted from the database, the equivalent
conversation has to be removed from the cache.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
08a7e5fc3b213e7a89d2e31cf86d6fb0ffee197f 13-Jul-2009 Kavya H N <dxn738@motorola.com> Sms Draft issue fix.

The issue this change fixes is:
1. Compose an SMS to a contact and press back to save as draft
2. open draft again
3. Receive an SMS from the same contact.
4. drag down status bar and open SMS
5. "The application Messaging (process com.android.mms) has stopped
unexpectedly. Please try again."
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
cea16acf02be8943133bc5048b1d64286bfef1d8 07-Jul-2009 Satish Roddom <satishroddom@motorola.com> SMS-to-email improvements

MO SMS: When a message is sent to email address, if length
of any of the entered email address + message body
is greater than 160, send it as MMS. Otherwise send
it as SMS

MT SMS: When a message is received from Email gateway, from
the message body, extract the first word and treat
as "From" address and rest as actual "message text".
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
926da0d5c27e8d0e4246ea975c2226b83a81a5d3 29-Jun-2009 Tom Taylor <tomtaylor@google.com> Fix bug 1930462: Draft message disappears in Conversation List when editing a draft.

When a user creates a draft and then backs out, a thread is created for the draft. When
the user re-edits the draft, the thread is deleted after loading the conversation. When
the user backs out again, we still have a valid threadId (but no actual thread) and the
message is saved without a corresponding thread. The fix is simple. When the thread is
deleted, the threadId has to be reset in the Conversation to match. Then when the user backs
out again (or in any other code path, e.g. send), the thread will get created.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
23da10700b189ccca64b8e729631763572a0f15f 05-Jun-2009 Tom Taylor <tomtaylor@google.com> Fix bug 1895010 - Need to delete excess messages by single thread, rather than processing all threads.

This change calls the recycler with a specific thread id when sending or receiving a sms or mms message.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
3239889e9a417617b755d4cde22070843e5c070b 01-Jun-2009 Tom Taylor <tomtaylor@google.com> Checkpoint work on MMS/SMS Recycler

A user can enable a setting to limit the number of saved messages
per thread. Eventually, UI will allow a user to lock a message and
prevent it from getting automatically deleted when hitting the limit
of saved messages. Work to do includes adding a saved column to the
sms and pdu tables and then implementing the UI to modify/view the
lock per message.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
1d98ae0b203e01034ddead4214d1520ce863a23b 22-May-2009 Ficus Kirkpatrick <ficus@android.com> New data model for contact information.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
3882a23e3ac0a8ef39853e16b79e8ec17c4bb3db 06-May-2009 Ficus Kirkpatrick <ficus@android.com> Handle loadFromUri() with an empty slideshow by reverting to SMS.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
ab6141d9c98f1a6024fac52fe3c897076d8549c0 16-Apr-2009 Ficus Kirkpatrick <ficus@android.com> Add a new Conversation class for protecting access to conversations/threads.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
17688d9a397234f35ba5519e46135ea268ed6d89 14-Apr-2009 Ficus Kirkpatrick <ficus@android.com> Just insert new drafts to update them instead of querying first.

Now that SmsProvider guarantees per-thread uniqueness of drafts,
we don't have to query first to find out whether we should insert
or replace.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
b9bcfdd226bbb6f5b265f925343375192963d58a 11-Apr-2009 Ficus Kirkpatrick <ficus@android.com> Move in-progress message state out of ComposeMessageActivity and into its own class.
/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java