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