Searched refs:cursor (Results 1 - 25 of 207) sorted by relevance

123456789

/frameworks/support/leanback/src/main/java/androidx/leanback/database/
H A DCursorMapper.java31 protected abstract void bindColumns(Cursor cursor); argument
38 protected abstract Object bind(Cursor cursor); argument
43 public Object convert(Cursor cursor) { argument
44 if (cursor != mCursor) {
45 mCursor = cursor;
/frameworks/base/core/tests/coretests/src/android/database/
H A DMatrixCursorTest.java28 Cursor cursor = new MatrixCursor(new String[] { "a" });
29 assertEquals(0, cursor.getCount());
33 MatrixCursor cursor = new MatrixCursor(new String[] { "a" });
34 cursor.newRow().add(null);
35 cursor.moveToNext();
36 assertTrue(cursor.isNull(0));
37 assertNull(cursor.getString(0));
38 assertNull(cursor.getBlob(0));
39 assertEquals(0, cursor.getShort(0));
40 assertEquals(0, cursor
200 checkValues(MatrixCursor cursor) argument
[all...]
/frameworks/base/apct-tests/perftests/core/src/android/database/
H A DTableHelper.java37 public abstract CursorReader createReader(Cursor cursor); argument
69 public CursorReader createReader(final Cursor cursor) {
70 final int cursorIndexOfA = cursor.getColumnIndexOrThrow("a");
72 cursor.getInt(cursorIndexOfA);
124 public CursorReader createReader(final Cursor cursor) {
125 final int cursorIndexOfA = cursor.getColumnIndexOrThrow("a");
126 final int cursorIndexOfB = cursor.getColumnIndexOrThrow("b");
127 final int cursorIndexOfC = cursor.getColumnIndexOrThrow("c");
128 final int cursorIndexOfD = cursor.getColumnIndexOrThrow("d");
129 final int cursorIndexOfE = cursor
[all...]
H A DSQLiteDatabasePerfTest.java83 try (Cursor cursor = mDatabase.rawQuery("SELECT _ID, COL_A, COL_B, COL_C FROM T1 "
85 assertTrue(cursor.moveToNext());
86 assertEquals(index, cursor.getInt(0));
87 assertEquals(index, cursor.getInt(1));
88 assertEquals("T1Value" + index, cursor.getString(2));
89 assertEquals(1.1 * index, cursor.getDouble(3), 0.0000001d);
103 try (Cursor cursor = mDatabase.rawQuery("SELECT _ID, COL_A, COL_B, COL_C FROM T1 "
107 while(cursor.moveToNext()) {
108 assertEquals(index, cursor.getInt(0));
109 assertEquals(index, cursor
[all...]
/frameworks/support/core/ktx/src/androidTest/java/androidx/core/database/
H A DCursorTest.kt28 val cursor = scalarCursor(byteArrayOf(0x01))
29 val blob = cursor.getBlob("data")
34 val cursor = scalarCursor(1.5)
35 val double = cursor.getDouble("data")
40 val cursor = scalarCursor(1.5f)
41 val float = cursor.getFloat("data")
46 val cursor = scalarCursor(1)
47 val int = cursor.getInt("data")
52 val cursor = scalarCursor(1L)
53 val long = cursor
[all...]
/frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/
H A DMtpDatabaseTest.java70 private static int getInt(Cursor cursor, String columnName) { argument
71 return cursor.getInt(cursor.getColumnIndex(columnName));
74 private static boolean isNull(Cursor cursor, String columnName) { argument
75 return cursor.isNull(cursor.getColumnIndex(columnName));
78 private static String getString(Cursor cursor, String columnName) { argument
79 return cursor.getString(cursor.getColumnIndex(columnName));
92 final Cursor cursor
[all...]
H A DMtpDocumentsProviderTest.java153 try (final Cursor cursor = mProvider.queryRoots(columns)) {
154 assertEquals(1, cursor.getCount());
155 assertTrue(cursor.moveToNext());
156 assertEquals("Device A", cursor.getString(0));
157 assertEquals(1, cursor.getLong(1));
164 try (final Cursor cursor = mProvider.queryChildDocuments("1", null, (String) null)) {}
211 final Cursor cursor = mProvider.queryRoots(null);
212 assertEquals(2, cursor.getCount());
213 cursor.moveToNext();
214 assertEquals("1", cursor
940 getStrings(Cursor cursor) argument
[all...]
/frameworks/ex/common/java/com/android/common/io/
H A DMoreCloseables.java26 * Closes the supplied cursor iff it is not null.
28 public static void closeQuietly(Cursor cursor) { argument
29 if (cursor != null) {
30 cursor.close();
/frameworks/layoutlib/create/src/com/android/tools/layoutlib/java/
H A DIntegralToString.java140 int cursor = bufLen;
144 buf[--cursor] = DIGITS[radix * q - i];
149 buf[--cursor] = '-';
152 return new String(buf, cursor, bufLen - cursor);
210 int cursor = bufLen;
217 buf[--cursor] = ONES[r];
218 buf[--cursor] = TENS[r];
227 buf[--cursor] = DIGITS[r];
232 buf[--cursor]
393 intIntoCharArray(char[] buf, int cursor, int n) argument
[all...]
/frameworks/base/core/java/android/widget/
H A DCursorTreeAdapter.java44 /** The cursor helper that is used to get the groups */
48 * The map of a group position to the group's children cursor helper (the
49 * cursor helper that is used to get the children for that group)
58 * Constructor. The adapter will call {@link Cursor#requery()} on the cursor whenever
61 * @param cursor The cursor from which to get the data for the groups.
63 public CursorTreeAdapter(Cursor cursor, Context context) { argument
64 init(cursor, context, true);
70 * @param cursor The cursor fro
76 CursorTreeAdapter(Cursor cursor, Context context, boolean autoRequery) argument
80 init(Cursor cursor, Context context, boolean autoRequery) argument
139 setGroupCursor(Cursor cursor) argument
221 newGroupView(Context context, Cursor cursor, boolean isExpanded, ViewGroup parent) argument
233 bindGroupView(View view, Context context, Cursor cursor, boolean isExpanded) argument
265 newChildView(Context context, Cursor cursor, boolean isLastChild, ViewGroup parent) argument
277 bindChildView(View view, Context context, Cursor cursor, boolean isLastChild) argument
343 convertToString(Cursor cursor) argument
382 changeCursor(Cursor cursor) argument
408 MyCursorHelper(Cursor cursor) argument
453 changeCursor(Cursor cursor, boolean releaseCursors) argument
[all...]
H A DResourceCursorTreeAdapter.java41 * @param cursor The database cursor
51 public ResourceCursorTreeAdapter(Context context, Cursor cursor, int collapsedGroupLayout, argument
53 super(cursor, context);
68 * @param cursor The database cursor
76 public ResourceCursorTreeAdapter(Context context, Cursor cursor, int collapsedGroupLayout, argument
78 this(context, cursor, collapsedGroupLayout, expandedGroupLayout, childLayout, childLayout);
86 * @param cursor The database cursor
92 ResourceCursorTreeAdapter(Context context, Cursor cursor, int groupLayout, int childLayout) argument
98 newChildView(Context context, Cursor cursor, boolean isLastChild, ViewGroup parent) argument
104 newGroupView(Context context, Cursor cursor, boolean isExpanded, ViewGroup parent) argument
[all...]
H A DSimpleCursorTreeAdapter.java25 * An easy adapter to map columns from a cursor to TextViews or ImageViews
75 * @param cursor The database cursor
102 public SimpleCursorTreeAdapter(Context context, Cursor cursor, int collapsedGroupLayout, argument
105 super(context, cursor, collapsedGroupLayout, expandedGroupLayout, childLayout,
116 * @param cursor The database cursor
139 public SimpleCursorTreeAdapter(Context context, Cursor cursor, int collapsedGroupLayout, argument
142 super(context, cursor, collapsedGroupLayout, expandedGroupLayout, childLayout);
152 * @param cursor Th
172 SimpleCursorTreeAdapter(Context context, Cursor cursor, int groupLayout, String[] groupFrom, int[] groupTo, int childLayout, String[] childFrom, int[] childTo) argument
212 bindView(View view, Context context, Cursor cursor, int[] from, int[] to) argument
241 initFromColumns(Cursor cursor, String[] fromColumnNames, int[] fromColumns) argument
248 bindChildView(View view, Context context, Cursor cursor, boolean isLastChild) argument
258 bindGroupView(View view, Context context, Cursor cursor, boolean isExpanded) argument
324 setViewValue(View view, Cursor cursor, int columnIndex) argument
[all...]
/frameworks/support/work/workmanager/src/androidTest/java/androidx/work/
H A DWorkDatabaseMigrationTest.java145 Cursor cursor = database.query(CHECK_SYSTEM_ID_INFO);
146 assertThat(cursor.getCount(), is(2));
147 cursor.moveToFirst();
148 assertThat(cursor.getString(cursor.getColumnIndex(COLUMN_WORKSPEC_ID)), is(workSpecId1));
149 assertThat(cursor.getInt(cursor.getColumnIndex(COLUMN_SYSTEM_ID)), is(1));
150 cursor.moveToNext();
151 assertThat(cursor.getString(cursor
[all...]
/frameworks/base/core/java/android/provider/
H A DCalendarContract.java114 * <data android:mimeType="vnd.android.cursor.item/event" />
502 * Creates an entity iterator for the given cursor. It assumes the
503 * cursor contains a calendars query.
505 * @param cursor query on {@link #CONTENT_URI}
508 public static EntityIterator newEntityIterator(Cursor cursor) { argument
509 return new EntityIteratorImpl(cursor);
514 public EntityIteratorImpl(Cursor cursor) { argument
515 super(cursor);
519 public Entity getEntityAndIncrementCursor(Cursor cursor) throws RemoteException { argument
520 // we expect the cursor i
1292 newEntityIterator(Cursor cursor, ContentResolver resolver) argument
1304 newEntityIterator(Cursor cursor, ContentProviderClient provider) argument
1348 EntityIteratorImpl(Cursor cursor, ContentResolver resolver) argument
1354 EntityIteratorImpl(Cursor cursor, ContentProviderClient provider) argument
1361 getEntityAndIncrementCursor(Cursor cursor) argument
[all...]
/frameworks/support/compat/src/main/java/androidx/core/database/sqlite/
H A DSQLiteCursorCompat.java34 * Controls whether the cursor is filled starting at the position passed to
44 @NonNull SQLiteCursor cursor, boolean fillWindowForwardOnly) {
46 cursor.setFillWindowForwardOnly(fillWindowForwardOnly);
43 setFillWindowForwardOnly( @onNull SQLiteCursor cursor, boolean fillWindowForwardOnly) argument
/frameworks/ex/common/java/com/android/common/widget/
H A DCompositeCursorAdapter.java38 Cursor cursor; field in class:CompositeCursorAdapter.Partition
84 * Registers a partition. The cursor for that partition can be set later.
105 Cursor cursor = mPartitions.get(partitionIndex).cursor;
106 if (cursor != null && !cursor.isClosed()) {
107 cursor.close();
122 partition.cursor = null;
133 Cursor cursor = partition.cursor;
216 changeCursor(int partition, Cursor cursor) argument
368 getHeaderView(int partition, Cursor cursor, View convertView, ViewGroup parent) argument
380 newHeaderView(Context context, int partition, Cursor cursor, ViewGroup parent) argument
388 bindHeaderView(View view, int partition, Cursor cursor) argument
394 getView(int partition, Cursor cursor, int position, View convertView, ViewGroup parent) argument
410 newView(Context context, int partition, Cursor cursor, int position, ViewGroup parent) argument
417 bindView(View v, int partition, Cursor cursor, int position) argument
[all...]
/frameworks/support/tv-provider/src/main/java/androidx/tvprovider/media/tv/
H A DBaseProgram.java332 * Sets the fields in the cursor to the given builder instance.
334 * @param cursor A row from the TV Input Framework database.
337 static void setFieldsFromCursor(Cursor cursor, Builder builder) { argument
340 if ((index = cursor.getColumnIndex(BaseTvColumns._ID)) >= 0 && !cursor.isNull(index)) {
341 builder.setId(cursor.getLong(index));
343 if ((index = cursor.getColumnIndex(BaseTvColumns.COLUMN_PACKAGE_NAME)) >= 0
344 && !cursor.isNull(index)) {
345 builder.setPackageName(cursor.getString(index));
347 if ((index = cursor
[all...]
/frameworks/base/tests/JankBench/app/src/main/java/com/android/benchmark/results/
H A DGlobalResultsStore.java150 Cursor cursor = db.query(
156 while (cursor.moveToNext()) {
157 int iteration = cursor.getInt(cursor.getColumnIndexOrThrow("iteration"));
159 values[0] = cursor.getDouble(
160 cursor.getColumnIndexOrThrow("unknown_delay"));
161 values[1] = cursor.getDouble(
162 cursor.getColumnIndexOrThrow("input"));
163 values[2] = cursor.getDouble(
164 cursor
[all...]
/frameworks/opt/telephony/src/java/android/telephony/
H A DCellBroadcastMessage.java36 * in the database cursor returned by the ContentProvider.
125 * @param cursor an open SQLite cursor pointing to the row to read
129 public static CellBroadcastMessage createFromCursor(Cursor cursor) { argument
130 int geoScope = cursor.getInt(
131 cursor.getColumnIndexOrThrow(Telephony.CellBroadcasts.GEOGRAPHICAL_SCOPE));
132 int serialNum = cursor.getInt(
133 cursor.getColumnIndexOrThrow(Telephony.CellBroadcasts.SERIAL_NUMBER));
134 int category = cursor.getInt(
135 cursor
[all...]
/frameworks/base/core/java/android/content/
H A DCursorEntityIterator.java23 * Abstract implementation of EntityIterator that makes it easy to wrap a cursor
32 * Constructor that makes initializes the cursor such that the iterator points to the
34 * @param cursor the cursor that contains the rows that make up the entities
36 public CursorEntityIterator(Cursor cursor) { argument
38 mCursor = cursor;
43 * Returns the entity that the cursor is currently pointing to. This must take care to advance
44 * the cursor past this entity. This will never be called if the cursor is at the end.
45 * @param cursor th
49 getEntityAndIncrementCursor(Cursor cursor) argument
[all...]
H A DCursorLoader.java31 * querying cursors, building on {@link AsyncTaskLoader} to perform the cursor
68 Cursor cursor = getContext().getContentResolver().query(mUri, mProjection, mSelection,
70 if (cursor != null) {
72 // Ensure the cursor window is filled.
73 cursor.getCount();
74 cursor.registerContentObserver(mObserver);
76 cursor.close();
80 return cursor;
101 public void deliverResult(Cursor cursor) { argument
104 if (cursor !
175 onCanceled(Cursor cursor) argument
[all...]
H A DContentQueryMap.java28 * Caches the contents of a cursor into a Map of String->ContentValues and optionally
29 * keeps the cache fresh by registering for updates on the content backing the cursor. The column of
33 * The cursor data is accessed by row key and column name via getValue().
47 /** Set when a cursor change notification is received and is cleared on a call to requery(). */
51 * Creates a ContentQueryMap that caches the content backing the cursor
53 * @param cursor the cursor whose contents should be cached
55 * @param keepUpdated true if the cursor's ContentProvider should be monitored for changes and
62 public ContentQueryMap(Cursor cursor, String columnNameOfKey, boolean keepUpdated, argument
64 mCursor = cursor;
148 readCursorIntoCache(Cursor cursor) argument
[all...]
/frameworks/base/tests/LocationTracker/src/com/android/locationtracker/data/
H A DTrackerDataHelper.java111 Cursor cursor = mContext.getContentResolver().query(
114 if (cursor == null) {
115 return cursor;
117 int pos = (cursor.getCount() < limit ? 0 : cursor.getCount() - limit);
118 cursor.moveToPosition(pos);
119 return cursor;
123 * Retrieves a cursor that starts at the last limit rows
126 * @return a cursor, null if bad things happened
158 * Helper method which converts row referenced by given cursor t
165 getNextOutput(Cursor cursor) argument
[all...]
/frameworks/opt/photoviewer/src/com/android/ex/photo/adapters/
H A DPhotoPagerAdapter.java50 public Fragment getItem(Context context, Cursor cursor, int position) { argument
51 final String photoUri = getPhotoUri(cursor);
52 final String thumbnailUri = getThumbnailUri(cursor);
53 final String contentDescription = getPhotoName(cursor);
54 boolean loading = shouldShowLoadingIndicator(cursor);
102 public String getPhotoUri(Cursor cursor) { argument
103 return getString(cursor, PhotoViewColumns.CONTENT_URI);
106 public String getThumbnailUri(Cursor cursor) { argument
107 return getString(cursor, PhotoViewColumns.THUMBNAIL_URI);
110 public String getContentType(Cursor cursor) { argument
114 getPhotoName(Cursor cursor) argument
118 shouldShowLoadingIndicator(Cursor cursor) argument
127 getString(Cursor cursor, String column) argument
[all...]
/frameworks/support/loader/src/main/java/androidx/loader/content/
H A DCursorLoader.java63 Cursor cursor = ContentResolverCompat.query(getContext().getContentResolver(),
66 if (cursor != null) {
68 // Ensure the cursor window is filled.
69 cursor.getCount();
70 cursor.registerContentObserver(mObserver);
72 cursor.close();
76 return cursor;
97 public void deliverResult(Cursor cursor) { argument
100 if (cursor != null) {
101 cursor
172 onCanceled(Cursor cursor) argument
[all...]

Completed in 489 milliseconds

123456789