Merge "bug:2622719 move 'forcing of cursor execution' to ContentProvider" into froyo
This commit is contained in:
@@ -247,6 +247,8 @@ public abstract class ContentResolver {
|
|||||||
releaseProvider(provider);
|
releaseProvider(provider);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
// force query execution
|
||||||
|
qCursor.getCount();
|
||||||
long durationMillis = SystemClock.uptimeMillis() - startTime;
|
long durationMillis = SystemClock.uptimeMillis() - startTime;
|
||||||
maybeLogQueryToEventLog(durationMillis, uri, projection, selection, sortOrder);
|
maybeLogQueryToEventLog(durationMillis, uri, projection, selection, sortOrder);
|
||||||
// Wrap the cursor object into CursorWrapperInner object
|
// Wrap the cursor object into CursorWrapperInner object
|
||||||
|
|||||||
@@ -1341,18 +1341,18 @@ public class SQLiteDatabase extends SQLiteClosable {
|
|||||||
SQLiteCursorDriver driver = new SQLiteDirectCursorDriver(this, sql, editTable);
|
SQLiteCursorDriver driver = new SQLiteDirectCursorDriver(this, sql, editTable);
|
||||||
|
|
||||||
Cursor cursor = null;
|
Cursor cursor = null;
|
||||||
int count = 0;
|
|
||||||
try {
|
try {
|
||||||
cursor = driver.query(
|
cursor = driver.query(
|
||||||
cursorFactory != null ? cursorFactory : mFactory,
|
cursorFactory != null ? cursorFactory : mFactory,
|
||||||
selectionArgs);
|
selectionArgs);
|
||||||
|
} finally {
|
||||||
|
if (Config.LOGV || mSlowQueryThreshold != -1) {
|
||||||
|
|
||||||
// Force query execution
|
// Force query execution
|
||||||
|
int count = -1;
|
||||||
if (cursor != null) {
|
if (cursor != null) {
|
||||||
count = cursor.getCount();
|
count = cursor.getCount();
|
||||||
}
|
}
|
||||||
} finally {
|
|
||||||
if (Config.LOGV || mSlowQueryThreshold != -1) {
|
|
||||||
|
|
||||||
long duration = System.currentTimeMillis() - timeStart;
|
long duration = System.currentTimeMillis() - timeStart;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user