/frameworks/base/core/tests/coretests/src/android/database/ |
D | MatrixCursorTest.java | 28 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/apct-tests/perftests/core/src/android/database/ |
D | TableHelper.java | 37 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 …]
|
D | SQLiteDatabasePerfTest.java | 98 try (Cursor cursor = mDatabase.rawQuery("SELECT _ID, COL_A, COL_B, COL_C FROM T1 " in testSelect() argument 100 assertTrue(cursor.moveToNext()); in testSelect() 101 assertEquals(index, cursor.getInt(0)); in testSelect() 102 assertEquals(index, cursor.getInt(1)); in testSelect() 103 assertEquals("T1Value" + index, cursor.getString(2)); in testSelect() 104 assertEquals(1.1 * index, cursor.getDouble(3), 0.0000001d); in testSelect() 118 try (Cursor cursor = mDatabase.rawQuery("SELECT _ID, COL_A, COL_B, COL_C FROM T1 " in testSelectMultipleRows() argument 122 while(cursor.moveToNext()) { in testSelectMultipleRows() 123 assertEquals(index, cursor.getInt(0)); in testSelectMultipleRows() 124 assertEquals(index, cursor.getInt(1)); in testSelectMultipleRows() [all …]
|
/frameworks/ex/common/java/com/android/common/widget/ |
D | CompositeCursorAdapter.java | 38 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/opt/net/ims/src/java/com/android/ims/rcs/uce/eab/ |
D | EabUtil.java | 49 try (Cursor cursor = context.getContentResolver().query( in getContactFromEab() argument 57 if (cursor != null && cursor.moveToFirst()) { in getContactFromEab() 58 result.append(cursor.getString(cursor.getColumnIndex( in getContactFromEab() 61 result.append(cursor.getString(cursor.getColumnIndex( in getContactFromEab() 64 result.append(cursor.getString(cursor.getColumnIndex( in getContactFromEab() 67 result.append(cursor.getString(cursor.getColumnIndex( in getContactFromEab() 85 try (Cursor cursor = context.getContentResolver().query( in getCapabilityFromEab() argument 94 if (cursor != null && cursor.moveToFirst()) { in getCapabilityFromEab() 95 result.append(cursor.getString(cursor.getColumnIndex( in getCapabilityFromEab() 98 result.append(cursor.getString(cursor.getColumnIndex( in getCapabilityFromEab() [all …]
|
/frameworks/base/core/java/android/widget/ |
D | CursorTreeAdapter.java | 63 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 …]
|
D | SimpleCursorTreeAdapter.java | 102 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/core/java/android/provider/ |
D | CalendarContract.java | 587 public static EntityIterator newEntityIterator(Cursor cursor) { in newEntityIterator() argument 588 return new EntityIteratorImpl(cursor); in newEntityIterator() 593 public EntityIteratorImpl(Cursor cursor) { in EntityIteratorImpl() argument 594 super(cursor); in EntityIteratorImpl() 598 public Entity getEntityAndIncrementCursor(Cursor cursor) throws RemoteException { in getEntityAndIncrementCursor() argument 600 final long calendarId = cursor.getLong(cursor.getColumnIndexOrThrow(_ID)); in getEntityAndIncrementCursor() 606 DatabaseUtils.cursorStringToContentValuesIfPresent(cursor, cv, ACCOUNT_NAME); in getEntityAndIncrementCursor() 607 DatabaseUtils.cursorStringToContentValuesIfPresent(cursor, cv, ACCOUNT_TYPE); in getEntityAndIncrementCursor() 609 DatabaseUtils.cursorStringToContentValuesIfPresent(cursor, cv, _SYNC_ID); in getEntityAndIncrementCursor() 610 DatabaseUtils.cursorLongToContentValuesIfPresent(cursor, cv, DIRTY); in getEntityAndIncrementCursor() [all …]
|
/frameworks/base/tests/JankBench/app/src/main/java/com/android/benchmark/results/ |
D | GlobalResultsStore.java | 150 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/telephony/java/android/telephony/ |
D | SmsCbMessage.java | 630 public static SmsCbMessage createFromCursor(@NonNull Cursor cursor) { in createFromCursor() argument 631 int geoScope = cursor.getInt( in createFromCursor() 632 cursor.getColumnIndexOrThrow(CellBroadcasts.GEOGRAPHICAL_SCOPE)); in createFromCursor() 633 int serialNum = cursor.getInt(cursor.getColumnIndexOrThrow(CellBroadcasts.SERIAL_NUMBER)); in createFromCursor() 634 int category = cursor.getInt(cursor.getColumnIndexOrThrow(CellBroadcasts.SERVICE_CATEGORY)); in createFromCursor() 635 String language = cursor.getString( in createFromCursor() 636 cursor.getColumnIndexOrThrow(CellBroadcasts.LANGUAGE_CODE)); in createFromCursor() 637 String body = cursor.getString(cursor.getColumnIndexOrThrow(CellBroadcasts.MESSAGE_BODY)); in createFromCursor() 638 int format = cursor.getInt(cursor.getColumnIndexOrThrow(CellBroadcasts.MESSAGE_FORMAT)); in createFromCursor() 639 int priority = cursor.getInt(cursor.getColumnIndexOrThrow(CellBroadcasts.MESSAGE_PRIORITY)); in createFromCursor() [all …]
|
/frameworks/base/packages/SystemUI/tests/src/com/android/keyguard/clock/ |
D | ClockOptionsProviderTest.java | 112 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/base/packages/SystemUI/customization/src/com/android/systemui/shared/customization/data/content/ |
D | CustomizationProviderClient.kt | 231 ?.use { cursor -> in querySlots() method 234 cursor.getColumnIndex( in querySlots() 238 cursor.getColumnIndex( in querySlots() 245 while (cursor.moveToNext()) { in querySlots() 248 id = cursor.getString(idColumnIndex), in querySlots() 249 capacity = cursor.getInt(capacityColumnIndex), in querySlots() 269 ?.use { cursor -> in queryFlags() method 272 cursor.getColumnIndex(Contract.FlagsTable.Columns.NAME) in queryFlags() 274 cursor.getColumnIndex(Contract.FlagsTable.Columns.VALUE) in queryFlags() 279 while (cursor.moveToNext()) { in queryFlags() [all …]
|
/frameworks/base/core/java/android/database/ |
D | DatabaseUtils.java | 436 public static void cursorFillWindow(final Cursor cursor, in cursorFillWindow() argument 438 if (position < 0 || position >= cursor.getCount()) { in cursorFillWindow() 441 final int oldPos = cursor.getPosition(); in cursorFillWindow() 442 final int numColumns = cursor.getColumnCount(); in cursorFillWindow() 446 if (cursor.moveToPosition(position)) { in cursorFillWindow() 452 final int type = cursor.getType(i); in cursorFillWindow() 460 success = window.putLong(cursor.getLong(i), position, i); in cursorFillWindow() 464 success = window.putDouble(cursor.getDouble(i), position, i); in cursorFillWindow() 468 final byte[] value = cursor.getBlob(i); in cursorFillWindow() 476 final String value = cursor.getString(i); in cursorFillWindow() [all …]
|
/frameworks/base/services/core/java/com/android/server/notification/ |
D | CalendarTracker.java | 99 Cursor cursor = null; in getCalendarsWithAccess() local 101 cursor = mUserContext.getContentResolver().query(Calendars.CONTENT_URI, projection, in getCalendarsWithAccess() 103 while (cursor != null && cursor.moveToNext()) { in getCalendarsWithAccess() 104 rt.add(cursor.getLong(0)); in getCalendarsWithAccess() 109 if (cursor != null) { in getCalendarsWithAccess() 110 cursor.close(); in getCalendarsWithAccess() 124 Cursor cursor = null; in checkEvent() local 128 cursor = mUserContext.getContentResolver().query(uri, INSTANCE_PROJECTION, in checkEvent() 131 while (cursor != null && cursor.moveToNext()) { in checkEvent() 132 final long begin = cursor.getLong(0); in checkEvent() [all …]
|
/frameworks/opt/photoviewer/src/com/android/ex/photo/adapters/ |
D | PhotoPagerAdapter.java | 50 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/ex/common/java/com/android/common/contacts/ |
D | BaseEmailAddressAdapter.java | 174 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/base/services/core/java/com/android/server/locksettings/recoverablekeystore/storage/ |
D | RecoverableKeyStoreDb.java | 137 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/opt/telephony/src/java/com/android/internal/telephony/ |
D | CarrierResolver.java | 329 Cursor cursor = mContext.getContentResolver().query( in loadCarrierMatchingRulesOnMccMnc() local 335 if (cursor != null) { in loadCarrierMatchingRulesOnMccMnc() 337 logd("[loadCarrierMatchingRules]- " + cursor.getCount() in loadCarrierMatchingRulesOnMccMnc() 341 while (cursor.moveToNext()) { in loadCarrierMatchingRulesOnMccMnc() 342 mCarrierMatchingRulesOnMccMnc.add(makeCarrierMatchingRule(cursor)); in loadCarrierMatchingRulesOnMccMnc() 350 if (cursor != null) { in loadCarrierMatchingRulesOnMccMnc() 351 cursor.close(); in loadCarrierMatchingRulesOnMccMnc() 361 Cursor cursor = mContext.getContentResolver().query( in getCarrierNameFromId() local 367 if (cursor != null) { in getCarrierNameFromId() 369 logd("[getCarrierNameFromId]- " + cursor.getCount() in getCarrierNameFromId() [all …]
|
/frameworks/base/tests/LocationTracker/src/com/android/locationtracker/data/ |
D | TrackerEntry.java | 208 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 …]
|
D | TrackerDataHelper.java | 111 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/services/people/java/com/android/server/people/data/ |
D | ContactsQueryHelper.java | 119 try (Cursor cursor = mContext.getContentResolver().query( in queryContact() argument 121 if (cursor == null) { in queryContact() 125 while (cursor.moveToNext()) { in queryContact() 127 int idIndex = cursor.getColumnIndex(Contacts._ID); in queryContact() 128 contactId = cursor.getLong(idIndex); in queryContact() 131 int lookupKeyIndex = cursor.getColumnIndex(Contacts.LOOKUP_KEY); in queryContact() 132 lookupKey = cursor.getString(lookupKeyIndex); in queryContact() 137 int starredIndex = cursor.getColumnIndex(Contacts.STARRED); in queryContact() 138 mIsStarred = cursor.getInt(starredIndex) != 0; in queryContact() 141 int hasPhoneNumIndex = cursor.getColumnIndex(Contacts.HAS_PHONE_NUMBER); in queryContact() [all …]
|
D | MmsQueryHelper.java | 77 try (Cursor cursor = mContext.getContentResolver().query( in querySince() argument 79 if (cursor == null) { in querySince() 83 while (cursor.moveToNext()) { in querySince() 85 int msgIdIndex = cursor.getColumnIndex(Mms._ID); in querySince() 86 String msgId = cursor.getString(msgIdIndex); in querySince() 89 int dateIndex = cursor.getColumnIndex(Mms.DATE); in querySince() 90 long date = cursor.getLong(dateIndex) * MILLIS_PER_SECONDS; in querySince() 93 int msgBoxIndex = cursor.getColumnIndex(Mms.MESSAGE_BOX); in querySince() 94 int msgBox = cursor.getInt(msgBoxIndex); in querySince() 118 try (Cursor cursor = mContext.getContentResolver().query( in getMmsAddress() argument [all …]
|
/frameworks/base/services/core/java/com/android/server/accounts/ |
D | AccountsDb.java | 350 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/core/tests/coretests/src/android/content/ |
D | RedactingProvider.java | 36 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 …]
|
/frameworks/base/core/java/android/content/ |
D | CursorLoader.java | 72 Cursor cursor = getContext().getContentResolver().query(mUri, mProjection, mSelection, in loadInBackground() local 74 if (cursor != null) { in loadInBackground() 77 cursor.getCount(); in loadInBackground() 78 cursor.registerContentObserver(mObserver); in loadInBackground() 80 cursor.close(); in loadInBackground() 84 return cursor; in loadInBackground() 105 public void deliverResult(Cursor cursor) { in deliverResult() argument 108 if (cursor != null) { in deliverResult() 109 cursor.close(); in deliverResult() 114 mCursor = cursor; in deliverResult() [all …]
|