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

Commit 6dc0ef00 authored by Karl Rosaen's avatar Karl Rosaen
Browse files

BulkCursorToCursorAdaptor.respond no longer assumes RemoteException is...

BulkCursorToCursorAdaptor.respond no longer assumes RemoteException is impossible, fails more gracefully.

This fixes bug 1923131 which was crashing the system process in some cases when the search dialog
was calling respond on its cursor to GlobalSearch.
parent d6dd686b
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -247,9 +247,11 @@ public final class BulkCursorToCursorAdaptor extends AbstractWindowedCursor {
        try {
            return mBulkCursor.respond(extras);
        } catch (RemoteException e) {
            // This should never happen because the system kills processes that are using remote
            // cursors when the provider process is killed.
            throw new RuntimeException(e);
            // the system kills processes that are using remote cursors when the provider process
            // is killed, but this can still happen if this is being called from the system process,
            // so, better to log and return an empty bundle.
            Log.w(TAG, "respond() threw RemoteException, returning an empty bundle.", e);
            return Bundle.EMPTY;
        }
    }
}