History log of /packages/apps/Mms/src/com/android/mms/util/DraftCache.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ab845dee6565a8dfc384186bc8f2e801a2b087e1 07-Jun-2014 Ye Wen <ywen@google.com> Use unified log tag for Mms app

Change-Id: Icec182674c008c2b9d01a6010a2aafc8111b2b7e
/packages/apps/Mms/src/com/android/mms/util/DraftCache.java
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/util/DraftCache.java
b542562125619f1d35958ca11c4ffa34eca55cb1 16-Mar-2012 Todor Kalaydjiev <todor@google.com> Make synchronization in DraftCache (way) more granular.

It was previously causing the main thread to block when calling
addOnDraftChangedListener until the DB query is done.

Needed for b/5928517

Change-Id: I5d5114badfb08ea8468503381a4b45920346a4cc
/packages/apps/Mms/src/com/android/mms/util/DraftCache.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/util/DraftCache.java
c6448572ff5c0be247cdb75467e54756f18c3051 05-Oct-2011 Tom Taylor <tomtaylor@google.com> NPE in DraftCache

Bug 5416424. Bug 5416250.
The cursor wasn't checked for null, but still closed in "finally".
This code is old, but now exposed because we rebuild the draft
cache when deleting all threads. I tried to repro the bug and stepped
through the debugger and we're simply getting back an empty (but
valid) cursor. Fixed the code to handle null cursor.

Change-Id: Iaac6dd8791cd12ad33e33fb9c03bee088d36198f
/packages/apps/Mms/src/com/android/mms/util/DraftCache.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/util/DraftCache.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/util/DraftCache.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/util/DraftCache.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/util/DraftCache.java
9242286c35743422051d439d7460cd0a1426899c 16-Sep-2009 Wei Huang <weih@google.com> add more logging in MMS. Try to catch an OOM error, and dump hprof data when it occurs.
/packages/apps/Mms/src/com/android/mms/util/DraftCache.java
d9d7479a8c9e10b7b3f39137e28ed0f283e4a257 11-Sep-2009 Wei Huang <weih@google.com> fix memory leak in MMS (bug 2021095); don't rebuild Contact cache and draft cache as frequently.

- fix a memory leak reported by Motorola. We weren't registering a Recycler listener, so weren't getting called back for onMovedToScrapHeap() when done with the ConversationHeaderViews, and thus not exercising unregistration for contacts changed listener.

- moved some tasks from ConversationList.onResume() and onPause() to onStart(). We were rebuilding the draft cache and contact cache in onResume(), which was too aggressive. Also, we no longer rebuild the draft cache anymore. I think it was defensive to do so, and I think draft cache is getting updated correctly in the right places (in CMA.onStop and onNewIntent) so we don't have to to play safe by doing unnecessary work.

- don't register for presence and contacts changed. We don't display presence directly in CMA ourselves anymore, and instead use ContactHeaderWidget, so we don't need to listen for presence changes there; for contact changed observer, I think it's too much to rebuild the contact cache for any contacts changes in the contacts provider. Instead we compromise and rebuild the contact cache in ConversationList.onStart(). This is a tradeoff, as when sitting on the CMA or ConversationList screen, we won't update if Contact changed. However, re-entering ConversationList will trigger the update if there is any.

- beefed up logging a bit more...

Change-Id: I97f1d7eae3ca5d3d069977e2c9fa0d7b0500dc3e
/packages/apps/Mms/src/com/android/mms/util/DraftCache.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/util/DraftCache.java
70c73e05a792832aa28da751cdaf3fa83a7b8113 23-Apr-2009 Ficus Kirkpatrick <ficus@android.com> Begin moving all conversation data behind a data model with a cache.

Remove some unused code like the stale concept of "common threads" vs.
"broadcast threads", old references to search, etc.
/packages/apps/Mms/src/com/android/mms/util/DraftCache.java
598ca14f5d7d26d6d5125d8fe0d07e50f066ff98 28-Mar-2009 Ficus Kirkpatrick <> AI 143315: am: CL 143166 am: CL 142862 Allow anonymous (recipientless) draft messages to be saved when we have no choice but to
either save the message or throw it out and can't give the user a choice with a dialog.
More aggressive refresh of draft cache to catch cases where the thread ID may have changed.
Avoid losing track of proper MMS state in image attachment add failure on resize.
Original author: ficus
Merged from: //branches/cupcake/...
Original author: android-build
Merged from: //branches/donutburger/...

Automated import of CL 143315
/packages/apps/Mms/src/com/android/mms/util/DraftCache.java
b530437ceaad97151be691067191f48e1e93b87e 25-Mar-2009 Ficus Kirkpatrick <> Automated import from //branches/master/...@142742,142742
/packages/apps/Mms/src/com/android/mms/util/DraftCache.java
07e7775d5a792334b89436bf5479bfd5abeeb8c4 25-Mar-2009 Ficus Kirkpatrick <> Automated import from //branches/master/...@142058,142058
/packages/apps/Mms/src/com/android/mms/util/DraftCache.java