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: 10993301, 11014856
Change-Id: I7f8a5bbb5f64437e006cb2c48b7e854136d5c38c
diff --git a/src/com/android/documentsui/CreateDirectoryFragment.java b/src/com/android/documentsui/CreateDirectoryFragment.java
index 23a3f22..22dd6e4 100644
--- a/src/com/android/documentsui/CreateDirectoryFragment.java
+++ b/src/com/android/documentsui/CreateDirectoryFragment.java
@@ -69,7 +69,12 @@
             @Override
             public void onClick(DialogInterface dialog, int which) {
                 final String displayName = text1.getText().toString();
-                new CreateDirectoryTask(displayName).execute();
+
+                final DocumentsActivity activity = (DocumentsActivity) getActivity();
+                final DocumentInfo cwd = activity.getCurrentDirectory();
+
+                new CreateDirectoryTask(displayName).executeOnExecutor(
+                        ProviderExecutor.forAuthority(cwd.authority));
             }
         });
         builder.setNegativeButton(android.R.string.cancel, null);