Go to file
Makoto Onuki ee82e34a28 Fix ANR/crash when you open & close a large EML
The problem was:
- MessageFileViewFragment.clearContent (A) is called in onDestroy
- MessageFileViewFragment.openMessageSync (B) is called in a bg thread
  to load an eml file
- And both try to hold the same lock. (mLock)
- If EML is large enough, B takes _seconds_.  If you press back during this,
  onDestroy gets blocked trying to lock mLock.
- This could also cause a crash, because the task that runs openMessageSync
  won't get cancelled in this case, because that's done in clearContent.
  Because of this, the task's onPostExecute tries to touch a UI element
  when the fragment is actually being destroyed.

The lock was introduced to protect mFileEmailUri, only to keep the same
semantics for openMessage() as MessageViewFragment. i.e. openMessage can be
called multiple times for the same instance of the fragment.

However, in practice, this won't happen.  Unlike the regular message view,
we never reuse MessageFileViewFragment.  MessageFileViewFragment instances
are created per message.  This lock was just reminiscence from the early
developmen stage.

So, fix is simple -- just remove the lock.

Bug 3500487

Change-Id: If2b22a683666de535454bb1293563796fa7acfd7
2011-03-02 13:38:34 -08:00
assets Remove empty.html, which isn't used any more. 2010-12-22 11:59:31 -08:00
docs auto import from //depot/cupcake/@135843 2009-03-03 19:32:22 -08:00
emailcommon New debug setting to enable strict mode logging. 2011-03-02 10:41:48 -08:00
images auto import from //depot/cupcake/@135843 2009-03-03 19:32:22 -08:00
res New debug setting to enable strict mode logging. 2011-03-02 10:41:48 -08:00
src/com Fix ANR/crash when you open & close a large EML 2011-03-02 13:38:34 -08:00
tests Change "appendQuotedText" to "useSmartReply" in Rfc822Output 2011-03-01 13:30:21 -08:00
.classpath Initial Contribution 2008-10-21 07:00:00 -07:00
.project Initial Contribution 2008-10-21 07:00:00 -07:00
Android.mk Split out emailcommon/Android.mk 2011-03-01 15:56:27 -08:00
AndroidManifest.xml Email split, part dix 2011-02-25 10:46:16 -08:00
CleanSpec.mk Split out emailcommon/Android.mk 2011-03-01 15:56:27 -08:00
MODULE_LICENSE_APACHE2 auto import from //depot/cupcake/@135843 2009-03-03 19:32:22 -08:00
NOTICE auto import from //depot/cupcake/@135843 2009-03-03 19:32:22 -08:00
proguard.flags Fix proguard.flags so that unit tests pass 2011-02-28 17:52:37 -08:00
remove-exchange-support.sh remove-exchange-support.sh supports MacOS 2011-01-28 13:39:39 -08:00