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

Commit c948d1a7 authored by Michael Chan's avatar Michael Chan
Browse files

If we get a closed cursor in onLoadComplete, log.wtf

Change-Id: I1f42d353776f4a0b298bd3b546ddfdf7242b7c08
parent c6972487
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -472,16 +472,22 @@ public class CalendarAppWidgetService extends RemoteViewsService {
         */
        @Override
        public void onLoadComplete(Loader<Cursor> loader, Cursor cursor) {
            if (cursor == null || cursor.isClosed()) {
            if (cursor == null) {
                return;
            }
            // If a newer update has happened since we started clean up and
            // return
            synchronized (mLock) {
                if (cursor.isClosed()) {
                    Log.wtf(TAG, "Got a closed cursor from onLoadComplete");
                    return;
                }

                if (mLastLock != mLock) {
                    cursor.close();
                    return;
                }

                // Copy it to a local static cursor.
                MatrixCursor matrixCursor = Utils.matrixCursorFromCursor(cursor);
                cursor.close();