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

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

Mask OOBE when filtering recent documents.

There is a data ownership issue related to recent documents Cursors,
and the loader and UI threads can end up traversing the same Cursor
at runtime.  This change masks OOBE crashes caused by this race until
we have time to fix cleanly.

Bug: 11736668
Change-Id: I2039a5edcf341fcaedacc2f08bde96fc5a271782
parent 55d12486
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ public class FilteringCursorWrapper extends AbstractCursor {
        mPosition = new int[count];

        cursor.moveToPosition(-1);
        while (cursor.moveToNext()) {
        while (cursor.moveToNext() && mCount < count) {
            final String mimeType = getCursorString(cursor, Document.COLUMN_MIME_TYPE);
            final long lastModified = getCursorLong(cursor, Document.COLUMN_LAST_MODIFIED);
            if (rejectMimes != null && MimePredicate.mimeMatches(rejectMimes, mimeType)) {
+4 −0
Original line number Diff line number Diff line
@@ -55,6 +55,10 @@ import java.util.concurrent.TimeUnit;
public class RecentLoader extends AsyncTaskLoader<DirectoryResult> {
    private static final boolean LOGD = true;

    // TODO: clean up cursor ownership so background thread doesn't traverse
    // previously returned cursors for filtering/sorting; this currently races
    // with the UI thread.

    private static final int MAX_OUTSTANDING_RECENTS = 4;
    private static final int MAX_OUTSTANDING_RECENTS_SVELTE = 2;