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

Commit 2b9578f9 authored by Garfield Tan's avatar Garfield Tan
Browse files

Omit the authority if moving returned cursor failed.

Bug: 31945164
Change-Id: I1b3a9e2dd389a7d178062f864755599df2a6d4eb
parent bd9f05aa
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ public class RecentsLoader extends AsyncTaskLoader<DirectoryResult> {
        // Collect all finished tasks
        boolean allDone = true;
        int totalQuerySize = 0;
        List<Cursor> cursors = new ArrayList<>();
        List<Cursor> cursors = new ArrayList<>(mTasks.size());
        for (RecentsTask task : mTasks.values()) {
            if (task.isDone()) {
                try {
@@ -168,6 +168,10 @@ public class RecentsLoader extends AsyncTaskLoader<DirectoryResult> {
                    throw new RuntimeException(e);
                } catch (ExecutionException e) {
                    // We already logged on other side
                } catch (Exception e) {
                    // Catch exceptions thrown when we read the cursor.
                    Log.e(TAG, "Failed to query Recents for authority: " + task.authority
                            + ". Skip this authority in Recents.", e);
                }
            } else {
                allDone = false;
@@ -189,7 +193,6 @@ public class RecentsLoader extends AsyncTaskLoader<DirectoryResult> {
            merged = new MatrixCursor(new String[0]);
        }


        final Cursor sorted = mState.sortModel.sortCursor(merged);

        // Tell the UI if this is an in-progress result. When loading is complete, another update is