Commit Graph

5 Commits

Author SHA1 Message Date
Tony Mantler feeb1e3ada Mark otherwise unused method as @VisibleForTesting
Also fix spelling cancellAllInterrupt -> cancelAllInterrupt

b/13082964

Change-Id: I2fef949bb351a536fdd0d7058b3df2b03eecb39e
2014-02-18 15:59:03 -08:00
Makoto Onuki 50d934360d Fix the "onPostExecute executed even when cancelled" issue
Renamed onPostExecute to onSuccess and made sure it won't called
if a task is cancelled in time.

Also removed isCancelled().  To implement it right we should make sure
that onPostExecute() isn't finished when setting mCancelled, but it's a bit
of a pain to implement right, and we don't really have to use it.

Change-Id: I3a0baf504506ffc4952a5553f7098a8415842fa3
2011-06-29 10:22:38 -07:00
Ben Komalo 0bb7f1c37c Fixes to MessageCompose saving.
- "save draft" no longer closes the message
- ensure consistent state if there are successive saves
- misc changes to the way a message is loaded if there is a pending save

Bug: 3072398
Change-Id: I9cd01319772293e4d410020ab27603821a95ec9f
2011-05-03 10:35:11 -07:00
Makoto Onuki d72f7bdf11 Improve EmailAsyncTask
Added 6 methods:
- execute{Parallel,Serial}
- cancelPreviousAndExecute{Parallel,Serial}
- runAsyncParallel{Parallel,Serial} (replacement for Utility.runAsync)

Bug 4083415

Change-Id: I5ca33000e52fc5265ccc84a6e5acb0d3359d0eb4
2011-03-21 16:41:08 -07:00
Makoto Onuki ba125ab5ac Fix ANR: Run getPreviewIcon on bg thread
The new class EmailAsyncTask might look overkill, but
this is what I've been wanting for long time.
In many activities we store all AsyncTasks we start to member fields
so that we can cancel them in onDestroy().  (e.g.
MessageViewFragmentBase.mLoadMessageTask and mReloadMessageTask)
With EmailAsyncTask these fields will no longer be necessary.
We'll be able to just fire up as many AsyncTasks as we want, and clean them
up in onDestroy() with just cancellAllInterrupt().

Bug 3480136

Change-Id: Id8aa1ba1500eee58cfab8b562b95e9ed852b3e29
2011-03-03 14:43:07 -08:00