Bug 1247557 - Close Cursors in AndroidImport. r=sebastian

MozReview-Commit-ID: KcKAXLxJr7l
This commit is contained in:
Michael Comella 2016-02-22 14:55:43 -08:00
parent 283e5223a8
commit 2ec4d618b2

View File

@ -151,13 +151,14 @@ public class AndroidImport implements Runnable {
flushBatchOperations();
}
protected Cursor query (Uri mainUri, Uri fallbackUri, String condition) {
Cursor cursor = mCr.query(mainUri, null, condition, null, null);
protected Cursor query(Uri mainUri, Uri fallbackUri, String condition) {
final Cursor cursor = mCr.query(mainUri, null, condition, null, null);
if (Build.MANUFACTURER.equals(SAMSUNG_MANUFACTURER) && (cursor == null || cursor.getCount() == 0)) {
cursor = mCr.query(fallbackUri, null, null, null, null);
if (cursor != null) {
cursor.close();
}
return mCr.query(fallbackUri, null, null, null, null);
}
return cursor;
}