Home
last modified time | relevance | path

Searched refs:cursor (Results 1 – 25 of 175) sorted by relevance

1234567

/frameworks/base/core/tests/coretests/src/android/database/
DMatrixCursorTest.java28 Cursor cursor = new MatrixCursor(new String[] { "a" }); in testEmptyCursor() local
29 assertEquals(0, cursor.getCount()); in testEmptyCursor()
33 MatrixCursor cursor = new MatrixCursor(new String[] { "a" }); in testNullValue() local
34 cursor.newRow().add(null); in testNullValue()
35 cursor.moveToNext(); in testNullValue()
36 assertTrue(cursor.isNull(0)); in testNullValue()
37 assertNull(cursor.getString(0)); in testNullValue()
38 assertNull(cursor.getBlob(0)); in testNullValue()
39 assertEquals(0, cursor.getShort(0)); in testNullValue()
40 assertEquals(0, cursor.getInt(0)); in testNullValue()
[all …]
/frameworks/base/packages/MtpDocumentsProvider/tests/src/com/android/mtp/
DMtpDatabaseTest.java70 private static int getInt(Cursor cursor, String columnName) { in getInt() argument
71 return cursor.getInt(cursor.getColumnIndex(columnName)); in getInt()
74 private static boolean isNull(Cursor cursor, String columnName) { in isNull() argument
75 return cursor.isNull(cursor.getColumnIndex(columnName)); in isNull()
78 private static String getString(Cursor cursor, String columnName) { in getString() argument
79 return cursor.getString(cursor.getColumnIndex(columnName)); in getString()
92 final Cursor cursor = mDatabase.queryRootDocuments(COLUMN_NAMES); in testPutSingleStorageDocuments() local
93 assertEquals(1, cursor.getCount()); in testPutSingleStorageDocuments()
95 cursor.moveToNext(); in testPutSingleStorageDocuments()
96 assertEquals(2, getInt(cursor, COLUMN_DOCUMENT_ID)); in testPutSingleStorageDocuments()
[all …]
DMtpDocumentsProviderTest.java153 try (final Cursor cursor = mProvider.queryRoots(columns)) { in testOpenDeviceOnDemand() argument
154 assertEquals(1, cursor.getCount()); in testOpenDeviceOnDemand()
155 assertTrue(cursor.moveToNext()); in testOpenDeviceOnDemand()
156 assertEquals("Device A", cursor.getString(0)); in testOpenDeviceOnDemand()
157 assertEquals(1, cursor.getLong(1)); in testOpenDeviceOnDemand()
164 try (final Cursor cursor = mProvider.queryChildDocuments("1", null, (String) null)) {} in testOpenDeviceOnDemand() argument
211 final Cursor cursor = mProvider.queryRoots(null); in testQueryRoots() local
212 assertEquals(2, cursor.getCount()); in testQueryRoots()
213 cursor.moveToNext(); in testQueryRoots()
214 assertEquals("1", cursor.getString(0)); in testQueryRoots()
[all …]
/frameworks/base/apct-tests/perftests/core/src/android/database/
DTableHelper.java37 public abstract CursorReader createReader(Cursor cursor); in createReader() 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.getColumnIndexOrThrow("e");
[all …]
DSQLiteDatabasePerfTest.java84 try (Cursor cursor = mDatabase.rawQuery("SELECT _ID, COL_A, COL_B, COL_C FROM T1 " in testSelect() argument
86 assertTrue(cursor.moveToNext()); in testSelect()
87 assertEquals(index, cursor.getInt(0)); in testSelect()
88 assertEquals(index, cursor.getInt(1)); in testSelect()
89 assertEquals("T1Value" + index, cursor.getString(2)); in testSelect()
90 assertEquals(1.1 * index, cursor.getDouble(3), 0.0000001d); in testSelect()
104 try (Cursor cursor = mDatabase.rawQuery("SELECT _ID, COL_A, COL_B, COL_C FROM T1 " in testSelectMultipleRows() argument
108 while(cursor.moveToNext()) { in testSelectMultipleRows()
109 assertEquals(index, cursor.getInt(0)); in testSelectMultipleRows()
110 assertEquals(index, cursor.getInt(1)); in testSelectMultipleRows()
[all …]
/frameworks/ex/common/java/com/android/common/widget/
DCompositeCursorAdapter.java38 Cursor cursor; field in CompositeCursorAdapter.Partition
105 Cursor cursor = mPartitions.get(partitionIndex).cursor; in removePartition() local
106 if (cursor != null && !cursor.isClosed()) { in removePartition()
107 cursor.close(); in removePartition()
122 partition.cursor = null; in clearPartitions()
133 Cursor cursor = partition.cursor; in close() local
134 if (cursor != null && !cursor.isClosed()) { in close()
135 cursor.close(); in close()
172 Cursor cursor = partition.cursor; in ensureCacheValid() local
174 if (cursor == null || cursor.isClosed()) { in ensureCacheValid()
[all …]
/frameworks/base/core/java/android/provider/
DCalendarContract.java585 public static EntityIterator newEntityIterator(Cursor cursor) { in newEntityIterator() argument
586 return new EntityIteratorImpl(cursor); in newEntityIterator()
591 public EntityIteratorImpl(Cursor cursor) { in EntityIteratorImpl() argument
592 super(cursor); in EntityIteratorImpl()
596 public Entity getEntityAndIncrementCursor(Cursor cursor) throws RemoteException { in getEntityAndIncrementCursor() argument
598 final long calendarId = cursor.getLong(cursor.getColumnIndexOrThrow(_ID)); in getEntityAndIncrementCursor()
604 DatabaseUtils.cursorStringToContentValuesIfPresent(cursor, cv, ACCOUNT_NAME); in getEntityAndIncrementCursor()
605 DatabaseUtils.cursorStringToContentValuesIfPresent(cursor, cv, ACCOUNT_TYPE); in getEntityAndIncrementCursor()
607 DatabaseUtils.cursorStringToContentValuesIfPresent(cursor, cv, _SYNC_ID); in getEntityAndIncrementCursor()
608 DatabaseUtils.cursorLongToContentValuesIfPresent(cursor, cv, DIRTY); in getEntityAndIncrementCursor()
[all …]
/frameworks/base/core/java/android/widget/
DCursorTreeAdapter.java63 public CursorTreeAdapter(Cursor cursor, Context context) { in CursorTreeAdapter() argument
64 init(cursor, context, true); in CursorTreeAdapter()
76 public CursorTreeAdapter(Cursor cursor, Context context, boolean autoRequery) { in CursorTreeAdapter() argument
77 init(cursor, context, autoRequery); in CursorTreeAdapter()
80 private void init(Cursor cursor, Context context, boolean autoRequery) { in init() argument
85 mGroupCursorHelper = new MyCursorHelper(cursor); in init()
105 final Cursor cursor = getChildrenCursor(mGroupCursorHelper.getCursor()); in getChildrenCursorHelper()
106 cursorHelper = new MyCursorHelper(cursor); in getChildrenCursorHelper()
139 public void setGroupCursor(Cursor cursor) { in setGroupCursor() argument
140 mGroupCursorHelper.changeCursor(cursor, false); in setGroupCursor()
[all …]
DSimpleCursorTreeAdapter.java102 public SimpleCursorTreeAdapter(Context context, Cursor cursor, int collapsedGroupLayout, in SimpleCursorTreeAdapter() argument
105 super(context, cursor, collapsedGroupLayout, expandedGroupLayout, childLayout, in SimpleCursorTreeAdapter()
139 public SimpleCursorTreeAdapter(Context context, Cursor cursor, int collapsedGroupLayout, in SimpleCursorTreeAdapter() argument
142 super(context, cursor, collapsedGroupLayout, expandedGroupLayout, childLayout); in SimpleCursorTreeAdapter()
172 public SimpleCursorTreeAdapter(Context context, Cursor cursor, int groupLayout, in SimpleCursorTreeAdapter() argument
175 super(context, cursor, groupLayout, childLayout); in SimpleCursorTreeAdapter()
212 private void bindView(View view, Context context, Cursor cursor, int[] from, int[] to) { in bindView() argument
220 bound = binder.setViewValue(v, cursor, from[i]); in bindView()
224 String text = cursor.getString(from[i]); in bindView()
241 private void initFromColumns(Cursor cursor, String[] fromColumnNames, int[] fromColumns) { in initFromColumns() argument
[all …]
/frameworks/base/tests/JankBench/app/src/main/java/com/android/benchmark/results/
DGlobalResultsStore.java150 Cursor cursor = db.query( in loadTestResults() local
156 while (cursor.moveToNext()) { in loadTestResults()
157 int iteration = cursor.getInt(cursor.getColumnIndexOrThrow("iteration")); in loadTestResults()
159 values[0] = cursor.getDouble( in loadTestResults()
160 cursor.getColumnIndexOrThrow("unknown_delay")); in loadTestResults()
161 values[1] = cursor.getDouble( in loadTestResults()
162 cursor.getColumnIndexOrThrow("input")); in loadTestResults()
163 values[2] = cursor.getDouble( in loadTestResults()
164 cursor.getColumnIndexOrThrow("animation")); in loadTestResults()
165 values[3] = cursor.getDouble( in loadTestResults()
[all …]
/frameworks/base/core/java/android/database/
DDatabaseUtils.java354 public static void cursorFillWindow(final Cursor cursor, in cursorFillWindow() argument
356 if (position < 0 || position >= cursor.getCount()) { in cursorFillWindow()
359 final int oldPos = cursor.getPosition(); in cursorFillWindow()
360 final int numColumns = cursor.getColumnCount(); in cursorFillWindow()
364 if (cursor.moveToPosition(position)) { in cursorFillWindow()
370 final int type = cursor.getType(i); in cursorFillWindow()
378 success = window.putLong(cursor.getLong(i), position, i); in cursorFillWindow()
382 success = window.putDouble(cursor.getDouble(i), position, i); in cursorFillWindow()
386 final byte[] value = cursor.getBlob(i); in cursorFillWindow()
394 final String value = cursor.getString(i); in cursorFillWindow()
[all …]
/frameworks/base/telephony/java/android/telephony/
DSmsCbMessage.java629 public static SmsCbMessage createFromCursor(@NonNull Cursor cursor) { in createFromCursor() argument
630 int geoScope = cursor.getInt( in createFromCursor()
631 cursor.getColumnIndexOrThrow(CellBroadcasts.GEOGRAPHICAL_SCOPE)); in createFromCursor()
632 int serialNum = cursor.getInt(cursor.getColumnIndexOrThrow(CellBroadcasts.SERIAL_NUMBER)); in createFromCursor()
633 int category = cursor.getInt(cursor.getColumnIndexOrThrow(CellBroadcasts.SERVICE_CATEGORY)); in createFromCursor()
634 String language = cursor.getString( in createFromCursor()
635 cursor.getColumnIndexOrThrow(CellBroadcasts.LANGUAGE_CODE)); in createFromCursor()
636 String body = cursor.getString(cursor.getColumnIndexOrThrow(CellBroadcasts.MESSAGE_BODY)); in createFromCursor()
637 int format = cursor.getInt(cursor.getColumnIndexOrThrow(CellBroadcasts.MESSAGE_FORMAT)); in createFromCursor()
638 int priority = cursor.getInt(cursor.getColumnIndexOrThrow(CellBroadcasts.MESSAGE_PRIORITY)); in createFromCursor()
[all …]
/frameworks/base/packages/SystemUI/tests/src/com/android/keyguard/clock/
DClockOptionsProviderTest.java112 Cursor cursor = mProvider.query(mListOptionsUri, null, null, null); in testQuery_noClocks() local
113 assertThat(cursor.getCount()).isEqualTo(0); in testQuery_noClocks()
128 Cursor cursor = mProvider.query(mListOptionsUri, null, null, null); in testQuery_listOptions() local
129 assertThat(cursor.getCount()).isEqualTo(2); in testQuery_listOptions()
130 cursor.moveToFirst(); in testQuery_listOptions()
131 assertThat(cursor.getString( in testQuery_listOptions()
132 cursor.getColumnIndex(NAME_COLUMN))).isEqualTo("name_a"); in testQuery_listOptions()
133 assertThat(cursor.getString( in testQuery_listOptions()
134 cursor.getColumnIndex(TITLE_COLUMN))).isEqualTo("title_a"); in testQuery_listOptions()
135 assertThat(cursor.getString( in testQuery_listOptions()
[all …]
/frameworks/opt/telephony/src/java/com/android/internal/telephony/
DCarrierResolver.java252 Cursor cursor = mContext.getContentResolver().query( in loadCarrierMatchingRulesOnMccMnc() local
258 if (cursor != null) { in loadCarrierMatchingRulesOnMccMnc()
260 logd("[loadCarrierMatchingRules]- " + cursor.getCount() in loadCarrierMatchingRulesOnMccMnc()
264 while (cursor.moveToNext()) { in loadCarrierMatchingRulesOnMccMnc()
265 mCarrierMatchingRulesOnMccMnc.add(makeCarrierMatchingRule(cursor)); in loadCarrierMatchingRulesOnMccMnc()
270 if (cursor != null) { in loadCarrierMatchingRulesOnMccMnc()
271 cursor.close(); in loadCarrierMatchingRulesOnMccMnc()
281 Cursor cursor = mContext.getContentResolver().query( in getCarrierNameFromId() local
287 if (cursor != null) { in getCarrierNameFromId()
289 logd("[getCarrierNameFromId]- " + cursor.getCount() in getCarrierNameFromId()
[all …]
/frameworks/ex/common/java/com/android/common/contacts/
DBaseEmailAddressAdapter.java174 Cursor cursor = null; in performFiltering() local
185 cursor = mContentResolver.query(uri, EmailQuery.PROJECTION, null, null, null); in performFiltering()
186 results.count = cursor.getCount(); in performFiltering()
188 results.values = new Cursor[] { directoryCursor, cursor }; in performFiltering()
238 Cursor cursor = mContentResolver.query( in performFiltering() local
240 results.values = cursor; in performFiltering()
247 Cursor cursor = (Cursor) results.values; in publishResults() local
248 onPartitionLoadFinished(constraint, mPartitionIndex, cursor); in publishResults()
314 protected View newView(Context context, int partitionIndex, Cursor cursor, in newView() argument
325 protected void bindView(View v, int partition, Cursor cursor, int position) { in bindView() argument
[all …]
/frameworks/opt/photoviewer/src/com/android/ex/photo/adapters/
DPhotoPagerAdapter.java50 public Fragment getItem(Context context, Cursor cursor, int position) { in getItem() argument
51 final String photoUri = getPhotoUri(cursor); in getItem()
52 final String thumbnailUri = getThumbnailUri(cursor); in getItem()
53 final String contentDescription = getPhotoName(cursor); in getItem()
54 boolean loading = shouldShowLoadingIndicator(cursor); in getItem()
102 public String getPhotoUri(Cursor cursor) { in getPhotoUri() argument
103 return getString(cursor, PhotoViewColumns.CONTENT_URI); in getPhotoUri()
106 public String getThumbnailUri(Cursor cursor) { in getThumbnailUri() argument
107 return getString(cursor, PhotoViewColumns.THUMBNAIL_URI); in getThumbnailUri()
110 public String getContentType(Cursor cursor) { in getContentType() argument
[all …]
/frameworks/base/services/core/java/com/android/server/notification/
DCalendarTracker.java98 Cursor cursor = null; in getCalendarsWithAccess() local
100 cursor = mUserContext.getContentResolver().query(Calendars.CONTENT_URI, projection, in getCalendarsWithAccess()
102 while (cursor != null && cursor.moveToNext()) { in getCalendarsWithAccess()
103 rt.add(cursor.getLong(0)); in getCalendarsWithAccess()
106 if (cursor != null) { in getCalendarsWithAccess()
107 cursor.close(); in getCalendarsWithAccess()
121 final Cursor cursor = mUserContext.getContentResolver().query(uri, INSTANCE_PROJECTION, in checkEvent() local
127 while (cursor != null && cursor.moveToNext()) { in checkEvent()
128 final long begin = cursor.getLong(0); in checkEvent()
129 final long end = cursor.getLong(1); in checkEvent()
[all …]
/frameworks/base/services/core/java/com/android/server/locksettings/recoverablekeystore/storage/
DRecoverableKeyStoreDb.java137 Cursor cursor = db.query( in getKey() argument
146 int count = cursor.getCount(); in getKey()
157 cursor.moveToFirst(); in getKey()
158 byte[] nonce = cursor.getBlob( in getKey()
159 cursor.getColumnIndexOrThrow(KeysEntry.COLUMN_NAME_NONCE)); in getKey()
160 byte[] keyMaterial = cursor.getBlob( in getKey()
161 cursor.getColumnIndexOrThrow(KeysEntry.COLUMN_NAME_WRAPPED_KEY)); in getKey()
162 int generationId = cursor.getInt( in getKey()
163 cursor.getColumnIndexOrThrow(KeysEntry.COLUMN_NAME_GENERATION_ID)); in getKey()
164 int recoveryStatus = cursor.getInt( in getKey()
[all …]
/frameworks/base/services/core/java/com/android/server/accounts/
DAccountsDb.java350 Cursor cursor = db.query(CE_TABLE_AUTHTOKENS, in findAuthTokensByAccount() local
356 while (cursor.moveToNext()) { in findAuthTokensByAccount()
357 final String type = cursor.getString(0); in findAuthTokensByAccount()
358 final String authToken = cursor.getString(1); in findAuthTokensByAccount()
362 cursor.close(); in findAuthTokensByAccount()
417 Cursor cursor = db.query( in findExtrasIdByAccountId() local
422 if (cursor.moveToNext()) { in findExtrasIdByAccountId()
423 return cursor.getLong(0); in findExtrasIdByAccountId()
427 cursor.close(); in findExtrasIdByAccountId()
454 try (Cursor cursor = db.query(CE_TABLE_EXTRAS, in findUserExtrasForAccount() argument
[all …]
/frameworks/base/tests/LocationTracker/src/com/android/locationtracker/data/
DTrackerEntry.java208 static TrackerEntry createEntry(Cursor cursor) { in createEntry() argument
209 String timestamp = cursor.getString(cursor.getColumnIndex(TIMESTAMP)); in createEntry()
210 String tag = cursor.getString(cursor.getColumnIndex(TAG)); in createEntry()
211 String sType = cursor.getString(cursor.getColumnIndex(ENTRY_TYPE)); in createEntry()
216 location.setLatitude(cursor.getFloat(cursor in createEntry()
218 location.setLongitude(cursor.getFloat(cursor in createEntry()
221 Float accuracy = getNullableFloat(cursor, ACCURACY); in createEntry()
225 Float altitude = getNullableFloat(cursor, ALTITUDE); in createEntry()
229 Float bearing = getNullableFloat(cursor, BEARING); in createEntry()
233 Float speed = getNullableFloat(cursor, SPEED); in createEntry()
[all …]
DTrackerDataHelper.java111 Cursor cursor = mContext.getContentResolver().query( in query() local
114 if (cursor == null) { in query()
115 return cursor; in query()
117 int pos = (cursor.getCount() < limit ? 0 : cursor.getCount() - limit); in query()
118 cursor.moveToPosition(pos); in query()
119 return cursor; in query()
165 public String getNextOutput(Cursor cursor) { in getNextOutput() argument
166 if (cursor == null || cursor.isAfterLast()) { in getNextOutput()
169 String output = mFormatter.getOutput(TrackerEntry.createEntry(cursor)); in getNextOutput()
170 cursor.moveToNext(); in getNextOutput()
/frameworks/base/packages/MtpDocumentsProvider/src/com/android/mtp/
DMtpDatabase.java260 try (final Cursor cursor = mDatabase.query( in getStorageDocumentIds() argument
273 final String[] ids = new String[cursor.getCount()]; in getStorageDocumentIds()
274 for (int i = 0; cursor.moveToNext(); i++) { in getStorageDocumentIds()
275 ids[i] = cursor.getString(0); in getStorageDocumentIds()
300 final Cursor cursor = mDatabase.query( in getDocumentIdForDevice() local
310 if (cursor.moveToNext()) { in getDocumentIdForDevice()
311 return cursor.getString(0); in getDocumentIdForDevice()
316 cursor.close(); in getDocumentIdForDevice()
327 final Cursor cursor = mDatabase.query( in getParentIdentifier() local
337 if (cursor.moveToNext()) { in getParentIdentifier()
[all …]
/frameworks/base/telecomm/java/android/telecom/
DCallerInfo.java207 public static CallerInfo getCallerInfo(Context context, Uri contactRef, Cursor cursor) { in getCallerInfo() argument
220 if (cursor != null) { in getCallerInfo()
221 if (cursor.moveToFirst()) { in getCallerInfo()
229 columnIndex = cursor.getColumnIndex(PhoneLookup.DISPLAY_NAME); in getCallerInfo()
231 info.name = cursor.getString(columnIndex); in getCallerInfo()
235 columnIndex = cursor.getColumnIndex(PhoneLookup.NUMBER); in getCallerInfo()
237 info.phoneNumber = cursor.getString(columnIndex); in getCallerInfo()
241 columnIndex = cursor.getColumnIndex(PhoneLookup.NORMALIZED_NUMBER); in getCallerInfo()
243 info.normalizedNumber = cursor.getString(columnIndex); in getCallerInfo()
247 columnIndex = cursor.getColumnIndex(PhoneLookup.LABEL); in getCallerInfo()
[all …]
/frameworks/base/core/java/android/content/
DCursorLoader.java71 Cursor cursor = getContext().getContentResolver().query(mUri, mProjection, mSelection, in loadInBackground() local
73 if (cursor != null) { in loadInBackground()
76 cursor.getCount(); in loadInBackground()
77 cursor.registerContentObserver(mObserver); in loadInBackground()
79 cursor.close(); in loadInBackground()
83 return cursor; in loadInBackground()
104 public void deliverResult(Cursor cursor) { in deliverResult() argument
107 if (cursor != null) { in deliverResult()
108 cursor.close(); in deliverResult()
113 mCursor = cursor; in deliverResult()
[all …]
/frameworks/base/core/tests/coretests/src/android/content/
DRedactingProvider.java36 final MatrixCursor cursor = new MatrixCursor( in query() local
38 cursor.addRow(new Object[] { "foo", 10, "/path/to/foo" }); in query()
39 cursor.addRow(new Object[] { "bar", 20, "/path/to/bar" }); in query()
43 return RedactingCursor.create(cursor, redactions); in query()
46 final MatrixCursor cursor = new MatrixCursor( in query() local
48 cursor.addRow(new Object[] { "foo", 10, "/path/to/foo" }); in query()
49 cursor.addRow(new Object[] { "bar", 20, "/path/to/bar" }); in query()
54 return RedactingCursor.create(cursor, redactions); in query()
57 final MatrixCursor cursor = new MatrixCursor( in query() local
59 cursor.addRow(new Object[] { "/path", "foo", "/path" }); in query()
[all …]

1234567