d2911c3e86
We discovered that AsyncTask.cancel() doesn't quite perform as expected; In particular, if you call cancel() during a particularly slow background worker, the result is discarded and onPostExecute() is never called. If the result is an open cursor, then we "leak" by not closing it. For AccountFolderList, which has a multi-step doInBackground(): 1. Check for isCancelled() during the long doInBackground() which will reduce the number of discarded cursors in the first place. 2. Check for isCancelled() at the end of the long doInBackground() and if true, close the result cursors and return null. 3. In the existing isCancelled() code in onPostExecute(), close the cursors. For other Activities (with simpler configurations): 1. Check for isCancelled() at the end of doInBackground() and if true, close the just-opened cursor and return null. Bug: 3088870 Change-Id: Ie63a3197af563baa8bb0fe6f1ef9423e281cbf4c |
||
---|---|---|
assets | ||
docs | ||
images | ||
res | ||
src | ||
tests | ||
.classpath | ||
.project | ||
Android.mk | ||
AndroidManifest.xml | ||
CleanSpec.mk | ||
MODULE_LICENSE_APACHE2 | ||
NOTICE | ||
proguard.flags | ||
remove-exchange-support.sh |