Loading src/com/android/contacts/list/JoinContactListFragment.java +5 −2 Original line number Diff line number Diff line Loading @@ -81,8 +81,11 @@ public class JoinContactListFragment extends ContactEntryListFragment<JoinContac break; } case JoinContactListAdapter.PARTITION_ALL_CONTACTS: { Cursor suggestionsCursor = ((JoinContactLoaderResult) data).suggestionCursor; if (data != null) { final Cursor suggestionsCursor = ((JoinContactLoaderResult) data).suggestionCursor; onContactListLoaded(suggestionsCursor, data); } break; } } Loading src/com/android/contacts/list/JoinContactLoader.java +25 −4 Original line number Diff line number Diff line Loading @@ -52,12 +52,16 @@ public class JoinContactLoader extends CursorLoader { @Override public void close() { try { if (suggestionCursor != null) { suggestionCursor.close(); } } finally { if (super.getWrappedCursor() != null) { super.close(); } } } } public JoinContactLoader(Context context) { super(context, null, null, null, null, null); Loading @@ -79,6 +83,23 @@ public class JoinContactLoader extends CursorLoader { // to load the entire list final Cursor suggestionsCursor = getContext().getContentResolver() .query(mSuggestionUri, mProjection, null, null, null); return new JoinContactLoaderResult(super.loadInBackground(), suggestionsCursor); if (suggestionsCursor == null) { return null; } Cursor cursorToClose = suggestionsCursor; try { final Cursor baseCursor = super.loadInBackground(); if (baseCursor != null) { final JoinContactLoaderResult result = new JoinContactLoaderResult(baseCursor, suggestionsCursor); cursorToClose = null; return result; } } finally { if (cursorToClose != null) { cursorToClose.close(); } } return null; } } Loading
src/com/android/contacts/list/JoinContactListFragment.java +5 −2 Original line number Diff line number Diff line Loading @@ -81,8 +81,11 @@ public class JoinContactListFragment extends ContactEntryListFragment<JoinContac break; } case JoinContactListAdapter.PARTITION_ALL_CONTACTS: { Cursor suggestionsCursor = ((JoinContactLoaderResult) data).suggestionCursor; if (data != null) { final Cursor suggestionsCursor = ((JoinContactLoaderResult) data).suggestionCursor; onContactListLoaded(suggestionsCursor, data); } break; } } Loading
src/com/android/contacts/list/JoinContactLoader.java +25 −4 Original line number Diff line number Diff line Loading @@ -52,12 +52,16 @@ public class JoinContactLoader extends CursorLoader { @Override public void close() { try { if (suggestionCursor != null) { suggestionCursor.close(); } } finally { if (super.getWrappedCursor() != null) { super.close(); } } } } public JoinContactLoader(Context context) { super(context, null, null, null, null, null); Loading @@ -79,6 +83,23 @@ public class JoinContactLoader extends CursorLoader { // to load the entire list final Cursor suggestionsCursor = getContext().getContentResolver() .query(mSuggestionUri, mProjection, null, null, null); return new JoinContactLoaderResult(super.loadInBackground(), suggestionsCursor); if (suggestionsCursor == null) { return null; } Cursor cursorToClose = suggestionsCursor; try { final Cursor baseCursor = super.loadInBackground(); if (baseCursor != null) { final JoinContactLoaderResult result = new JoinContactLoaderResult(baseCursor, suggestionsCursor); cursorToClose = null; return result; } } finally { if (cursorToClose != null) { cursorToClose.close(); } } return null; } }