summaryrefslogtreecommitdiff
path: root/core/java/android/os/AsyncTask.java
Commit message (Collapse)AuthorAgeFilesLines
* Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-1/+1
| | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I534e3fd1305e2f4af076986770033478448a665c
* Deprecate AsyncTaskCharles Munger2019-11-061-3/+19
| | | | | Change-Id: Ie142c281c48bda35f5c8fb01ec8a001e0229fd2e BUG=144042891
* Add @UnsupportedAppUsage annotationsAndrei Onea2019-03-181-0/+7
| | | | | | | | | | | | | | | | | For packages: android.os This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Merged-In: I4ece0a3f37f88fc2508cb965092aed7cabc61819 Change-Id: I0d942254f06c1a355fb906640e223ad34cced6ab
* Adjust AsyncTask.THREAD_POOL_EXECUTOR configHans Boehm2019-02-121-12/+40
| | | | | | | | | | | | | Remove the queue, reduce core pool size but no longer let it time out. Reduce the timeout for additional threads. If necessary, use a special executor, with an unbounded queue, to run overflow tasks. Bug: 123762797 Test: AOSP boots, also with MAXIMUM_POOL_SIZE = 1. Change-Id: I4bc9593a044d1773ff1878684e2397a7c2a9a87a
* Improve AsyncTask API documentationHans Boehm2019-01-311-15/+40
| | | | | | Bug: 34278255 Test: TreeHugger Change-Id: I0347072112254f98d257a72ef1fc7c21b086df39
* SelectionActionModeHelper should use target view's threadMakoto Onuki2017-05-251-6/+34
| | | | | | | | | Use the looper from the TextView's thread for the helper Bug 62043115 Test: Manual, type on edit field and select text Change-Id: I501430a500016a81963a9f9fa636474b708b9b36
* AsyncTask terminating with exception calls onCancelledTony Mantler2016-09-281-0/+3
| | | | | | | Test: cts/tests/tests/os/src/android/os/cts/AsyncTaskTest.java b/30304893 Change-Id: Icb50cda8026ddd70d457b5e62eb29c81313ee47d
* docs: Fix typo and broken link in AsyncTask.java am: 53415ff24eMark Lu2016-08-261-3/+3
|\ | | | | | | | | | | am: bae52ec98c Change-Id: Idb695142488874d52dd406bede0fb4848f7663a9
| * docs: Fix typo and broken link in AsyncTask.javaMark Lu2016-08-121-3/+3
| | | | | | | | | | Bug: 29323321 Change-Id: Ie3a62480bfee881083b5d266cbc1481fb148d237
* | Fix AsyncTask to handle exceptions in doInBackgroundTony Mantler2016-08-051-6/+10
|/ | | | | | | | | | When cancelling, the exception will be eaten by FutureTask, but onCancelled would end up never being called due to the exception causing the code to skip calling postResult. b/30304893 Change-Id: I47d859d9ef77245889816b2b6e10bb380bc4979b
* Tweak AsyncTask#THREAD_POOL_EXECUTOR settingsJohn Reck2015-11-301-5/+14
| | | | | | Bug: 24821101 Bug: 23722178 Change-Id: I73741eb4f812e754d5823b27efec98fca9938329
* More maybe fix issue #22765972: Binder transactions running out...Dianne Hackborn2015-07-291-1/+3
| | | | | | | | ...of address space causing package manager to fail Make sure to flush binder commands when done with an async task. Change-Id: I9f171add7051587ab854226b97a12c7e1844ad5d
* Annotate some APIs with threading annotationsTor Norbye2015-04-231-0/+13
| | | | Change-Id: I24bda29261cdecbe78b2529866624b9313ca5c03
* Fix typoAdrian Roos2015-02-181-1/+1
| | | | Change-Id: If59381862e3332675fd7b929bcee2928ecd0da21
* Explicitly bind AsyncTask to main looper.Jeff Brown2014-11-141-8/+16
| | | | | | | | | | It seems we were sort of trying to do this by forcing the AsyncTask static initializer to run at certain times but it was not sufficiently reliable. In particular, this resulted in occasional system server crashes. Bug: 18192406 Change-Id: Ief73210c60e7680fbed6df74e3e58809b7ec7e4d
* Fix typo in documentationPatrick Tjin2014-02-251-1/+1
| | | | Change-Id: Ida827957623cf49981e5a0c2c9193ef4efe8d1ce
* Docfixes: three typos and escape */*.John Spurlock2014-01-061-1/+1
| | | | Change-Id: I418d855b5d08a1a20eaca3d8e4d2e5d0fca23dd5
* Prevent AsyncTask from creating too many threadsRomain Guy2013-08-091-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | Bug #10228005 From the ThreadPoolExecutor documentation: - If fewer than corePoolSize threads are running, the Executor always prefers adding a new thread rather than queuing. - If corePoolSize or more threads are running, the Executor always prefers queuing a request rather than adding a new thread. - If a request cannot be queued, a new thread is created unless this would exceed maximumPoolSize, in which case, the task will be rejected. Before this change AsyncTask could create up to 128 threads because of the limited queue of 10 items (the capacity of a blocking queue is fixed.) This change increases the size of the queue to 128 items and reduces the maximum number of threads to the number of CPU cores * 2 + 1. Apps can still submit the same number of tasks. Change-Id: I015d77b53b6a9fda39c618830b34d45a10de5571
* Fix javadocRomain Guy2012-10-171-1/+1
| | | | Change-Id: Ie98dd00f41add876f3740f5d37781a10c6bd41fe
* Update AsyncTask documentationRomain Guy2012-05-211-6/+34
| | | | Change-Id: I678506309f027bb12d0c3f42436a60611aca5d8c
* Shouldn't catch Throwable in AsyncTask.Jeff Brown2012-03-011-3/+0
| | | | | | | Throwable includes classes of Error that really should be fatal. Bug: 5945222 Change-Id: I602f958396048451f404dd2306cdf5e57172acf0
* Always initialize AsyncTask on the main thread.Romain Guy2012-01-301-0/+2
| | | | Change-Id: I039e5d6cb7157a0c8873e0d29161daf1cbda5577
* Make sure onPostExecute() is never called after cancel()Romain Guy2011-12-051-4/+6
| | | | | | | | Bug #5651553 As dfined by the documentation. Change-Id: I627a49ee000d6990b61fd64dde9b06f72cd5cbae
* Revert "Check whether an AsyncTask is created/executed on a looper thread."Romain Guy2011-10-111-61/+28
| | | | This reverts commit 7498ccb6b9a1e61281d998fc81adc9a4a5e87e56.
* Revert "Fix the build"Romain Guy2011-10-111-1/+4
| | | | This reverts commit 4db2504adab21e4439c123d2675db555e0143afa.
* Fix the buildRomain Guy2011-10-111-4/+1
| | | | Change-Id: I3071feab62abee7393557ceb920786b476fb0b02
* Check whether an AsyncTask is created/executed on a looper thread.Romain Guy2011-10-111-28/+61
| | | | Change-Id: I181b253c50a6579f35e61cd4b0c500379462e035
* docs: add developer guide cross-references, Project ACREJoe Fernandez2011-10-041-0/+7
| | | | Change-Id: I5df1c4e13af67ff4c4a5b22f3cb1247bf0103b09
* Revert "Forces AsyncTask to use the main looper Bug #5333924"Jeff Brown2011-09-161-7/+1
| | | | | This reverts commit 6dafefb0f44c4e57384e2ec3e08fefac5cc7e071 This change is breaking the system on startup with an NPE. Need to fix that first then resubmit.
* Forces AsyncTask to use the main looperRomain Guy2011-09-161-1/+7
| | | | | | | | | | | | Bug #5333924 This might break applications trying to use AsyncTask on a looper that is not the main thread, but such apps would already have issues (AsyncTask has a single static handler and attempting to use AsyncTask outside of the main thread would likely result in weird threading issues in other parts of the app.) Change-Id: Ibbf480627fc7b91326a27d4f5e5af49e8c5b5115
* AsyncTask now uses the poll executor for apps up through HC MR1 and the ↵Joe Onorato2011-03-171-3/+8
| | | | | | serialized one after that. Change-Id: I47d135ace5f8e78e4fa44ac9d1bf7abeeb9d3ba0
* Change AsyncTask.execute() back to using a thread pool...Dianne Hackborn2011-01-251-16/+44
| | | | | | ...for now. Change-Id: I1fe64f3e3a575f85add11dfe4d405f0c3a4a49de
* fix the build... sorry... bad docs...Joe Onorato2011-01-161-1/+1
| | | | Change-Id: I4b543f306d58ec95693c8e3515dffcb7dd55dc29
* Change the default of how AsyncTask enqueues.Joe Onorato2011-01-161-6/+73
| | | | | | | | | | | | | | | | | The default is now to serialize everything onto the thread pool. If you would like to have finer grained control over how AsyncTasks are executed, you can call the new executeOnExecutor method, which takes a custom Executor. The pool used by the default is handily now accessible as THREAD_POOL_EXECUTOR. This change is because it is too tempting to convert single threaded Janky™ code to use AsyncTask in a way that is unsafe and ends up calling the AsyncTasks in parallel. Also, this adds a static execute(Runnable) method to AsyncTask that posts onto the serialized queue, so that if you don't have any parameters or return values, you can just use Runnable instead of AsyncTask. Change-Id: I91bdfb00193542bfc2e101bcad56e3430421884a
* Make sure onCancelled() is called if cancel() is called early.Romain Guy2011-01-101-21/+59
| | | | | | | In some situations, when cancel() was called before the task had a chance to start its execution, onCancelled() would not be invoked. Change-Id: I6c1f4cd28a209fb8cc779bb212f500565dfceaae
* Tighten up AsyncTask's semantics and behavior.Romain Guy2011-01-091-38/+45
| | | | | | | | | | | | | Bug #3109366 Bug #3109382 The new behavior of AsyncTask is the following: - Unchanged if you don't call cancel() - If you call cancel(): - Either onCancelled() *OR* onPostExecute() is invoked - onCancelled() is invoked only after doInBackground() finishes Change-Id: If53faec5890d2fa7098aea76973186a0b1026b39
* More cleanup of Loader APIs.Dianne Hackborn2010-12-201-1/+1
| | | | | | | | - Remove old method names. - Introduce onXxx() hooks to Loader. - Improve debugging. Change-Id: I3fba072a05c7023aa7d2c3eb4e126feb514ab6d8
* am 282315e1: am 52e19d59: Merge "Change the keep alive time for excess idle ↵Romain Guy2010-09-151-1/+1
|\ | | | | | | | | | | | | | | | | threads." into gingerbread Merge commit '282315e154b63a2eec84609600c81ad9e1c72994' * commit '282315e154b63a2eec84609600c81ad9e1c72994': Change the keep alive time for excess idle threads.
| * Change the keep alive time for excess idle threads.Romain Guy2010-09-141-1/+1
| | | | | | | | Change-Id: Ie076544df5ee8df185f0824333fdc62203a565c2
* | Added "Memory observability" to javadoc.Makoto Onuki2010-09-081-0/+10
| | | | | | | | Change-Id: I4fba91922f033af408903cc4b455daa291e3f6ac
* | Add new ContentProvider for doing conversions to data streams.Dianne Hackborn2010-08-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces basic infrastructure that should allow content providers holding complex data to perform on-demand conversion of their data to streams of various types. It is achieved through two new content provider APIs, one to interrogate the possible stream MIME types the provider can return, and the other to request a stream of data in a particular MIME type. Because implementations of this will often need to do on-demand data conversion, there is also a utility intoduced in ContentProvider for subclasses to easily run a function to write data into a pipe that is read by the client. This feature is mostly intended for cut and paste and drag and drop, as the complex data interchange allowing the source and destination to negotiate data types and copy (possible large) data between them. However because it is fundamental facility of ContentProvider, it can be used in other places, such as for more advanced GET_CONTENT data exchanges. An example implementation of this would be in ContactsProvider, which can now provider a data stream when a client opens certain pieces of it data, to return data as flat text, a vcard, or other format. Change-Id: I58627ea4ed359aa7cf2c66274adb18306c209cb2
* | Preventing cursor leaks when a query is interruptedDmitri Plotnikov2010-06-161-1/+12
| | | | | | | | | | | | Re-ran runtest cts-os Change-Id: I518a2a4f842b01d082078e16643aa377a4575237
* | Do not invoke onProgressUpdate if the task is canceled.Romain Guy2010-06-031-2/+7
| | | | | | | | | | | | Bug #2734382 Change-Id: I8d507ae72af2f6dfe66598fb9090872520111a6b
* | Changed steps names in documentation.Gilles Debunne2010-04-271-8/+8
|/ | | | Change-Id: I0541709a719e35575bb2c42e6f2ea457d21c545b
* Fix a typo.Owen Lin2009-12-281-1/+1
| | | | Change-Id: Idbe649678a7321a6bd9511218788bc4dfb3cbdb4
* Make sure AsyncTask sens a null result to onPostExecute() when cancelled.Romain Guy2009-10-051-0/+1
| | | | | | | This is in accordance to the documentation. This bug was approved by hackbod. The change is safe and is a single line of code. Change-Id: I9b771df3ae2aa4f496d15e6c43b677f3245539ac
* Tweak the core and maximum pool sizes for AsyncTask.Romain Guy2009-06-261-3/+3
| | | | | | | This change allows up to 5 AsyncTasks to run concurrently. Before, only 1 task could run at a time, which was too limited. This change also bumps up the maximum number of tasks that can be created; this large number is not an issue because tasks are queued up and run only 5 at a time.
* Fix another HTML formatting in android.os.AsyncTaskRomain Guy2009-05-021-1/+1
|
* Fix HTML formatting in android.os.AsyncTaskRomain Guy2009-05-021-1/+1
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+454
|