Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca494a7d authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Manage mode shouldn't block for other providers.

When loading DocumentsUI in management mode (for Downloads), we
normally focus on a single authority and let the other providers
keep loading async.  However, when one of the providers kicks a
change notification, we end up blocking the main thread.

Simple fix is to move the blocking into the AsyncTask.

Bug: 17452691
Change-Id: Ie5212ad825b7df719690b29941c9ae9ba2cabe4b
parent 4275284f
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -116,9 +116,6 @@ public class RootsCache {
     * Gather roots from storage providers belonging to given package name.
     */
    public void updatePackageAsync(String packageName) {
        // Need at least first load, since we're going to be using previously
        // cached values for non-matching packages.
        waitForFirstLoad();
        new UpdateTask(packageName).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    }

@@ -183,6 +180,12 @@ public class RootsCache {
        protected Void doInBackground(Void... params) {
            final long start = SystemClock.elapsedRealtime();

            if (mFilterPackage != null) {
                // Need at least first load, since we're going to be using
                // previously cached values for non-matching packages.
                waitForFirstLoad();
            }

            mTaskRoots.put(mRecentsRoot.authority, mRecentsRoot);

            final ContentResolver resolver = mContext.getContentResolver();