use of android.database.CrossProcessCursor in project platform_frameworks_base by android.
the class CrossProcessCursorWrapper method fillWindow.
@Override
public void fillWindow(int position, CursorWindow window) {
if (mCursor instanceof CrossProcessCursor) {
final CrossProcessCursor crossProcessCursor = (CrossProcessCursor) mCursor;
crossProcessCursor.fillWindow(position, window);
return;
}
DatabaseUtils.cursorFillWindow(mCursor, position, window);
}
use of android.database.CrossProcessCursor in project android_frameworks_base by ParanoidAndroid.
the class CrossProcessCursorWrapper method fillWindow.
@Override
public void fillWindow(int position, CursorWindow window) {
if (mCursor instanceof CrossProcessCursor) {
final CrossProcessCursor crossProcessCursor = (CrossProcessCursor) mCursor;
crossProcessCursor.fillWindow(position, window);
return;
}
DatabaseUtils.cursorFillWindow(mCursor, position, window);
}
use of android.database.CrossProcessCursor in project android_frameworks_base by ResurrectionRemix.
the class CrossProcessCursorWrapper method fillWindow.
@Override
public void fillWindow(int position, CursorWindow window) {
if (mCursor instanceof CrossProcessCursor) {
final CrossProcessCursor crossProcessCursor = (CrossProcessCursor) mCursor;
crossProcessCursor.fillWindow(position, window);
return;
}
DatabaseUtils.cursorFillWindow(mCursor, position, window);
}
use of android.database.CrossProcessCursor in project android_frameworks_base by crdroidandroid.
the class CrossProcessCursorWrapper method fillWindow.
@Override
public void fillWindow(int position, CursorWindow window) {
if (mCursor instanceof CrossProcessCursor) {
final CrossProcessCursor crossProcessCursor = (CrossProcessCursor) mCursor;
crossProcessCursor.fillWindow(position, window);
return;
}
DatabaseUtils.cursorFillWindow(mCursor, position, window);
}
use of android.database.CrossProcessCursor in project greenDAO by greenrobot.
the class AbstractDao method loadAllFromCursor.
/**
* Reads all available rows from the given cursor and returns a list of entities.
*/
protected List<T> loadAllFromCursor(Cursor cursor) {
int count = cursor.getCount();
if (count == 0) {
return new ArrayList<T>();
}
List<T> list = new ArrayList<T>(count);
CursorWindow window = null;
boolean useFastCursor = false;
if (cursor instanceof CrossProcessCursor) {
window = ((CrossProcessCursor) cursor).getWindow();
if (window != null) {
// E.g. Robolectric has no Window at this point
if (window.getNumRows() == count) {
cursor = new FastCursor(window);
useFastCursor = true;
} else {
DaoLog.d("Window vs. result size: " + window.getNumRows() + "/" + count);
}
}
}
if (cursor.moveToFirst()) {
if (identityScope != null) {
identityScope.lock();
identityScope.reserveRoom(count);
}
try {
if (!useFastCursor && window != null && identityScope != null) {
loadAllUnlockOnWindowBounds(cursor, window, list);
} else {
do {
list.add(loadCurrent(cursor, 0, false));
} while (cursor.moveToNext());
}
} finally {
if (identityScope != null) {
identityScope.unlock();
}
}
}
return list;
}
Aggregations