OSDN Git Service

Isolate calls to each remote DocumentsProvider.
authorJeff Sharkey <jsharkey@android.com>
Wed, 2 Oct 2013 00:57:41 +0000 (17:57 -0700)
committerJeff Sharkey <jsharkey@android.com>
Wed, 2 Oct 2013 15:54:02 +0000 (08:54 -0700)
commitd01571e6d4e1c403534e19142720530d324eac9b
tree397106adf0cda15ea986a3d33e1e6ba3ba05c074
parentee3e1603fdbbe24b0cbf3cb85c456696cf3b7941
Isolate calls to each remote DocumentsProvider.

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: 1099330111014856
Change-Id: I7f8a5bbb5f64437e006cb2c48b7e854136d5c38c
core/java/android/content/AsyncTaskLoader.java
packages/DocumentsUI/src/com/android/documentsui/CreateDirectoryFragment.java
packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java
packages/DocumentsUI/src/com/android/documentsui/DirectoryLoader.java
packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
packages/DocumentsUI/src/com/android/documentsui/ProviderExecutor.java [new file with mode: 0644]
packages/DocumentsUI/src/com/android/documentsui/RecentLoader.java
packages/ExternalStorageProvider/src/com/android/externalstorage/TestDocumentsProvider.java