summaryrefslogtreecommitdiff
path: root/core/java/android/content/AsyncTaskLoader.java
Commit message (Collapse)AuthorAgeFilesLines
* Migrate frameworks/base javadocs references to androidxAlan Viverette2022-02-091-1/+1
| | | | | | | | | | | Does not remove Support Library artifacts from docs classpath (ApiDocs.bp) because they are still used in development/samples, which is not as easy to migrate as javadoc. Bug: 158779503 Test: make docs Exempt-From-Owner-Approval: Mass find/replace for androidx migration Change-Id: Icf7f53ec36a0e970413352e2ebf40ce9d60ed17e
* 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: I6ab53570aca580fbee1fcc927871caa09780f58f
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | For packages: android.content.res android.content.pm.split android.content.pm.permission android.content.pm.dex android.content.pm android.content.om android.content 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 Change-Id: Ia79256a3d04e16dd78331a61af0dcddc5fc1599b
* Improve Fragment+Loader deprecation JavadocIan Lake2017-12-201-1/+2
| | | | | | | | | | | | | | | Make it clear that the framework versions of Fragments and Loaders should be replaced with their identically named versions in the Support Library. Reference the recent work on Lifecycle as an example of a Support Library only change that should motivate developers to switch to the Support Library equivalents. Test: Reviewed new Javadoc BUG: 70336450 Change-Id: I93151fa0a316bba824c2e55f80f7de9d30bed3c6
* Deprecate framework Fragments and LoadersIan Lake2017-11-131-0/+3
| | | | | | | | | | | | Redirect developers to use the Support Library versions of Fragments and Loaders to ensure that they get consistent behavior across versions of Android and all devices as well as access to Lifecycle improvements. Test: Confirmed APIs deprecated in current.txt BUG: 68381801 Change-Id: I58ec599e557fc93c8547c45ba7c9ced96b0c8616
* Fix stale data due to stopped loader.George Mount2017-03-081-0/+3
| | | | | | | | | | | Bug 33185424 When stopping an CursorLoader while data is being loaded, the load task will be canceled. This CL marks the data as changed if the cancel is called while the loader is stopped. Test: I63b48210a25be72d13a2a6182eb1757cbe6a1949 Change-Id: Ibf9c5facdcc5160f6ed146c5fdd063549ac2a7a8
* Minor code cleanup in loaders.Jeff Brown2013-10-091-17/+17
| | | | Change-Id: I38147eb9e494b53d41ca3cad042d804631916941
* Isolate calls to each remote DocumentsProvider.Jeff Sharkey2013-10-021-1/+10
| | | | | | | | | | | | | | | | | | | | All background work is going through AsyncTasks, which uses a shared thread pool. Even with the new ContentProviderClient logic to detect ANRs, the UI can still appear to be unresponsive for 20 seconds, even if the user attempted to switch to a different backend. In the worst case, a backlog of thumbnail requests would end up wedging Loaders for a long time, since they all share the same THREAD_POOL_EXECUTOR. This change isolates calls to each provider onto their own thread, which they're free to wedge and recover from over time. It also means we no longer need a dedicated thread pool for recents loading, and can use a simpler Semaphore instead. Disables thumbnails in recents on svelte devices. Bug: 10993301, 11014856 Change-Id: I7f8a5bbb5f64437e006cb2c48b7e854136d5c38c
* Fix a bug where we could lose a loader content change.Dianne Hackborn2013-03-141-0/+2
| | | | | | | | | | | | | | | | | If AsyncTaskLoader starts a background update due to a content change, and that update is cancelled, we drop the data when it finally arrives and forget that the content changed. If we later come back to the loader, we then end up showing stale data because we don't know that we still need to update due to the old content change. This change adds a couple new APIs to Loader to deal with the time between when you ask for whether there is a content change and finally either commit the data or cancel the update. AsyncTaskLoader is changed to make use of this so that it doesn't lose changes. Change-Id: I3866236b1c22bb9138f2d9f6032b126aeaee2e6e
* Fix cursor window leak when query execution fails.Jeff Brown2013-01-081-1/+1
| | | | | | | | | | | | | Ensure that the Cursor object is closed if a query on a content provider fails due to an error or is canceled during execution. There are several places in the code where similar problems can occur. To further reduce the likelihood of leaks, close the cursor window immediately when a query fails. Bug: 7278577 Change-Id: I8c686c259de80a162b9086628a817d57f09fdd13
* Move CancellationSignal to android.os package.Jeff Brown2012-05-071-0/+1
| | | | | Bug: 6427830 Change-Id: I39451bb1e1d4a8d976ed1c671234f0c8c61658dd
* Support automatic cancellation of Loaders.Jeff Brown2012-02-011-50/+96
| | | | Change-Id: I18d3f49e413f48fcdd519d15e99c238ad54d35b9
* Implement a cancelation mechanism for queries.Jeff Brown2012-01-271-0/+20
| | | | | | | | | | | | | Added new API to enable cancelation of SQLite and content provider queries by means of a CancelationSignal object. The application creates a CancelationSignal object and passes it as an argument to the query. The cancelation signal can then be used to cancel the query while it is executing. If the cancelation signal is raised before the query is executed, then it is immediately terminated. Change-Id: If2c76e9a7e56ea5e98768b6d4f225f0a1ca61c61
* Deprecate a bunch of APIs.Dianne Hackborn2011-04-201-1/+18
| | | | | | And clean up some documentation. Change-Id: I7882183b3daf883b7ac6098d19f88dc7cfbcdf61
* Fix issue #3381489: IllegalStateException: attempt to re-open...Dianne Hackborn2011-01-301-9/+9
| | | | | | | | | | | | | | | | | | | ...an already-closed object: android.database.sqlite.SQLiteQuery It turns out there is a state we are missing -- the loader is still needed, but in the inactive list. In this case the loader needs to continue holding on to its current data, and not deliver any new data (which would result in it releasing its old data). This introduces the new state to Loader, and uses it in AsyncTaskLoader so all subclasses of that should get the new correct behavior. A further improvement would be to unregister CursorLoader's content listener when going in to this state, but that can wait for later. Change-Id: I6d30173b94f8e30b5be31d018accd328cc3388ec
* Maybe fix issue #3093599: java.lang.IndexOutOfBoundsException...Dianne Hackborn2011-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...Invalid index 0, size is 0 at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2326) It looks like if an arrow key is dispatched between the time the list view is told its data set has changed and it does the resulting layout pass, we could try to move the position to a now invalid index. This may prevent that from happening. Also put in a better error message if saving state of a fragment whose target is no longer in the fragment manager. And fix a bug in PackageManager where we could return a null from queryIntentActivities(). And add a new API to find out whether a fragment is being removed, to help fix issue #3306021: NPE at android.app.AlertDialog.getDefaultDialogTheme(AlertDialog.java) Next, for new HC apps we can delay committing data to storage until the activity is stopped. Finally, use the new multi-threaded AyncTask executor in a few places, so we don't have worked blocked by long-running tasks from the application. Change-Id: I27b2aafedf2e1bf3a2316309889613fa539760f3
* Hiding the AsyncTaskLoader.waitForLoader methodDmitri Plotnikov2011-01-181-1/+3
| | | | | | | | | | | | | I introduced this method a couple of weeks ago, but then we had a chat with Dianne and she made a good point that rather than having this behavior on AsyncTaskLoader, we should have it on LoaderManager and then it will cover all kinds of loaders, not just the ones inheriting from AsyncTaskLoader. She suggested that we postpone that work until after Honeycomb. Change-Id: I1939956296cddb678791ba652ab5f4a0dd45eea1
* Fix a bunch of API review bugs.Dianne Hackborn2011-01-171-2/+7
| | | | | | | | | | 3362464 API REVIEW: android.content potpourri 3362445 API REVIEW: Fragment transaction stuff 3362428 API REVIEW: Fragment stuff 3362418 API REVIEW: Loader stuff 3362414 API REVIEW: android.content.pm.ActivityInfo Change-Id: I6475421a4735759b458acb67df4380cc6234f147
* Get rid of old ParcelFileDescriptor API.Dianne Hackborn2011-01-111-3/+20
| | | | | | Also some new debugging code in AsyncTaskLoader. Change-Id: Ib13386b7862821cf0ee31b003bedef78f46240f1
* Fixed the waitForLoader method.Dmitri Plotnikov2011-01-091-10/+18
| | | | | | | | | | The reason we need a separate latch is that AsyncTask will post onPostExecute/onCancelled _after_ executing mFuture.get(). The previous implementation would only wait for mFuture.get() to complete and not the entire task. Change-Id: I96964591980965148eb09af38b5838bfa5d28277
* Implement issue # 3255887 could CursorLoader offer...Dianne Hackborn2011-01-081-19/+134
| | | | | | | | | | | | | | | | | | ...to throttle contentobserver-based requeries Why yes, I guess it could. This also reworks AsyncTaskLoader to not generate multiple concurrent tasks if it is getting change notifications before the last background task is complete. And removes some of the old APIs that had been deprecated but need to be gone for final release. And fixes a few little problems with applying the wrong theme in system code. Change-Id: Ic7a665b666d0fb9d348e5f23595532191065884f
* Adding AsyncTaskLoader.waitForLoader() for testingDmitri Plotnikov2011-01-071-1/+28
| | | | Change-Id: I8a4c13d48c9deca70594be58beafb68f08da65ea
* Fix issue #3301572: onCreateLoader must not be a member class: ↵Dianne Hackborn2010-12-211-4/+9
| | | | | | | | VolumeMetadataLoader Also some various cleanup. Change-Id: I8e8616a86c50c86817f7ec9bb02a5954c1ccd84f
* More cleanup of Loader APIs.Dianne Hackborn2010-12-201-5/+1
| | | | | | | | - Remove old method names. - Introduce onXxx() hooks to Loader. - Improve debugging. Change-Id: I3fba072a05c7023aa7d2c3eb4e126feb514ab6d8
* Preventing cursor leaks when a query is interruptedDmitri Plotnikov2010-06-161-5/+24
| | | | | | Re-ran runtest cts-os Change-Id: I518a2a4f842b01d082078e16643aa377a4575237
* Another try at fixing the docs build.Jeff Hamilton2010-05-181-2/+2
| | | | Change-Id: Ief60f4e71efee1d3bb4ee36e2f2a2fcaeb996284
* Fix a broken docs link.Jeff Hamilton2010-05-181-2/+4
| | | | Change-Id: I2e940165726ecfce306cd143ed049045c927b6a0
* Add the Loader and supporting classes.Jeff Hamilton2010-05-181-0/+86
Loaders are designed to make it easier to manage asynchronously loading data. Change-Id: I948db08c721411e94fca071dc6fb4db2b83ea4d6