/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/packages/MtpDocumentsProvider/tests/src/com/android/mtp/ |
D | MtpDatabaseTest.java | 70 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 …]
|
D | MtpDocumentsProviderTest.java | 151 try (final Cursor cursor = mProvider.queryRoots(columns)) { in testOpenDeviceOnDemand() argument 152 assertEquals(1, cursor.getCount()); in testOpenDeviceOnDemand() 153 assertTrue(cursor.moveToNext()); in testOpenDeviceOnDemand() 154 assertEquals("Device A", cursor.getString(0)); in testOpenDeviceOnDemand() 155 assertEquals(1, cursor.getLong(1)); in testOpenDeviceOnDemand() 162 try (final Cursor cursor = mProvider.queryChildDocuments("1", null, null)) {} in testOpenDeviceOnDemand() argument 209 final Cursor cursor = mProvider.queryRoots(null); in testQueryRoots() local 210 assertEquals(2, cursor.getCount()); in testQueryRoots() 211 cursor.moveToNext(); in testQueryRoots() 212 assertEquals("1", cursor.getString(0)); in testQueryRoots() [all …]
|
/frameworks/base/tools/layoutlib/create/src/com/android/tools/layoutlib/java/ |
D | IntegralToString.java | 140 int cursor = bufLen; in intToString() 144 buf[--cursor] = DIGITS[radix * q - i]; in intToString() 149 buf[--cursor] = '-'; in intToString() 152 return new String(buf, cursor, bufLen - cursor); in intToString() 210 int cursor = bufLen; 217 buf[--cursor] = ONES[r]; 218 buf[--cursor] = TENS[r]; 227 buf[--cursor] = DIGITS[r]; 232 buf[--cursor] = '-'; 236 sb.append(buf, cursor, bufLen - cursor); [all …]
|
/frameworks/support/documents-archive/tests/src/android/support/provider/ |
D | DocumentArchiveTest.java | 90 final Cursor cursor = mArchive.queryChildDocuments(DOCUMENT_ID, null, null); in testQueryChildDocument() local 92 assertTrue(cursor.moveToFirst()); in testQueryChildDocument() 94 cursor.getString(cursor.getColumnIndexOrThrow(Document.COLUMN_DOCUMENT_ID))); in testQueryChildDocument() 96 cursor.getString(cursor.getColumnIndexOrThrow(Document.COLUMN_DISPLAY_NAME))); in testQueryChildDocument() 98 cursor.getString(cursor.getColumnIndexOrThrow(Document.COLUMN_MIME_TYPE))); in testQueryChildDocument() 100 cursor.getInt(cursor.getColumnIndexOrThrow(Document.COLUMN_SIZE))); in testQueryChildDocument() 102 assertTrue(cursor.moveToNext()); in testQueryChildDocument() 104 cursor.getString(cursor.getColumnIndexOrThrow(Document.COLUMN_DOCUMENT_ID))); in testQueryChildDocument() 106 cursor.getString(cursor.getColumnIndexOrThrow(Document.COLUMN_DISPLAY_NAME))); in testQueryChildDocument() 108 cursor.getString(cursor.getColumnIndexOrThrow(Document.COLUMN_MIME_TYPE))); in testQueryChildDocument() [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/base/core/java/android/provider/ |
D | CalendarContract.java | 508 public static EntityIterator newEntityIterator(Cursor cursor) { in newEntityIterator() argument 509 return new EntityIteratorImpl(cursor); in newEntityIterator() 514 public EntityIteratorImpl(Cursor cursor) { in EntityIteratorImpl() argument 515 super(cursor); in EntityIteratorImpl() 519 public Entity getEntityAndIncrementCursor(Cursor cursor) throws RemoteException { in getEntityAndIncrementCursor() argument 521 final long calendarId = cursor.getLong(cursor.getColumnIndexOrThrow(_ID)); in getEntityAndIncrementCursor() 527 DatabaseUtils.cursorStringToContentValuesIfPresent(cursor, cv, ACCOUNT_NAME); in getEntityAndIncrementCursor() 528 DatabaseUtils.cursorStringToContentValuesIfPresent(cursor, cv, ACCOUNT_TYPE); in getEntityAndIncrementCursor() 530 DatabaseUtils.cursorStringToContentValuesIfPresent(cursor, cv, _SYNC_ID); in getEntityAndIncrementCursor() 531 DatabaseUtils.cursorLongToContentValuesIfPresent(cursor, cv, DIRTY); in getEntityAndIncrementCursor() [all …]
|
/frameworks/opt/telephony/src/java/android/telephony/ |
D | CellBroadcastMessage.java | 129 public static CellBroadcastMessage createFromCursor(Cursor cursor) { in createFromCursor() argument 130 int geoScope = cursor.getInt( in createFromCursor() 131 cursor.getColumnIndexOrThrow(Telephony.CellBroadcasts.GEOGRAPHICAL_SCOPE)); in createFromCursor() 132 int serialNum = cursor.getInt( in createFromCursor() 133 cursor.getColumnIndexOrThrow(Telephony.CellBroadcasts.SERIAL_NUMBER)); in createFromCursor() 134 int category = cursor.getInt( in createFromCursor() 135 cursor.getColumnIndexOrThrow(Telephony.CellBroadcasts.SERVICE_CATEGORY)); in createFromCursor() 136 String language = cursor.getString( in createFromCursor() 137 cursor.getColumnIndexOrThrow(Telephony.CellBroadcasts.LANGUAGE_CODE)); in createFromCursor() 138 String body = cursor.getString( in createFromCursor() [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 …]
|
D | AlphabetIndexer.java | 82 public AlphabetIndexer(Cursor cursor, int sortedColumnIndex, CharSequence alphabet) { in AlphabetIndexer() argument 83 mDataCursor = cursor; in AlphabetIndexer() 92 if (cursor != null) { in AlphabetIndexer() 93 cursor.registerDataSetObserver(this); in AlphabetIndexer() 112 public void setCursor(Cursor cursor) { in setCursor() argument 116 mDataCursor = cursor; in setCursor() 117 if (cursor != null) { in setCursor() 148 final Cursor cursor = mDataCursor; in getPositionForSection() local 150 if (cursor == null || mAlphabet == null) { in getPositionForSection() 162 int savedCursorPos = cursor.getPosition(); in getPositionForSection() [all …]
|
/frameworks/base/core/java/android/database/ |
D | DatabaseUtils.java | 262 public static void cursorFillWindow(final Cursor cursor, in cursorFillWindow() argument 264 if (position < 0 || position >= cursor.getCount()) { in cursorFillWindow() 267 final int oldPos = cursor.getPosition(); in cursorFillWindow() 268 final int numColumns = cursor.getColumnCount(); in cursorFillWindow() 272 if (cursor.moveToPosition(position)) { in cursorFillWindow() 278 final int type = cursor.getType(i); in cursorFillWindow() 286 success = window.putLong(cursor.getLong(i), position, i); in cursorFillWindow() 290 success = window.putDouble(cursor.getDouble(i), position, i); in cursorFillWindow() 294 final byte[] value = cursor.getBlob(i); in cursorFillWindow() 302 final String value = cursor.getString(i); in cursorFillWindow() [all …]
|
/frameworks/ml/bordeaux/service/src/android/bordeaux/services/ |
D | BordeauxSessionStorage.java | 101 private BordeauxSessionManager.Session getSessionFromCursor(Cursor cursor) { in getSessionFromCursor() argument 103 String className = cursor.getString(cursor.getColumnIndex(COLUMN_CLASS)); in getSessionFromCursor() 110 byte[] model = cursor.getBlob(cursor.getColumnIndex(COLUMN_MODEL)); in getSessionFromCursor() 116 Cursor cursor = mDbSessions.query(true, SESSION_TABLE, in getSession() local 119 if ((cursor == null) | (cursor.getCount() == 0)) { in getSession() 120 cursor.close(); in getSession() 123 if (cursor.getCount() > 1) { in getSession() 124 cursor.close(); in getSession() 127 cursor.moveToFirst(); in getSession() 128 BordeauxSessionManager.Session s = getSessionFromCursor(cursor); in getSession() [all …]
|
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/model/ |
D | DocumentInfo.java | 141 public static DocumentInfo fromDirectoryCursor(Cursor cursor) { in fromDirectoryCursor() argument 142 assert(cursor != null); in fromDirectoryCursor() 143 final String authority = getCursorString(cursor, RootCursorWrapper.COLUMN_AUTHORITY); in fromDirectoryCursor() 144 return fromCursor(cursor, authority); in fromDirectoryCursor() 147 public static DocumentInfo fromCursor(Cursor cursor, String authority) { in fromCursor() argument 148 assert(cursor != null); in fromCursor() 150 info.updateFromCursor(cursor, authority); in fromCursor() 154 public void updateFromCursor(Cursor cursor, String authority) { in updateFromCursor() argument 156 this.documentId = getCursorString(cursor, Document.COLUMN_DOCUMENT_ID); in updateFromCursor() 157 this.mimeType = getCursorString(cursor, Document.COLUMN_MIME_TYPE); in updateFromCursor() [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/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/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/core/java/com/android/server/notification/ |
D | CalendarTracker.java | 98 Cursor cursor = null; in getPrimaryCalendars() local 100 cursor = mUserContext.getContentResolver().query(Calendars.CONTENT_URI, projection, in getPrimaryCalendars() 102 while (cursor != null && cursor.moveToNext()) { in getPrimaryCalendars() 103 rt.add(cursor.getLong(0)); in getPrimaryCalendars() 106 if (cursor != null) { in getPrimaryCalendars() 107 cursor.close(); in getPrimaryCalendars() 119 final Cursor cursor = mUserContext.getContentResolver().query(uri, INSTANCE_PROJECTION, in checkEvent() local 125 while (cursor != null && cursor.moveToNext()) { in checkEvent() 126 final long begin = cursor.getLong(0); in checkEvent() 127 final long end = cursor.getLong(1); in checkEvent() [all …]
|
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/ |
D | FilteringCursorWrapper.java | 39 public FilteringCursorWrapper(Cursor cursor, String[] acceptMimes) { in FilteringCursorWrapper() argument 40 this(cursor, acceptMimes, null, Long.MIN_VALUE); in FilteringCursorWrapper() 43 public FilteringCursorWrapper(Cursor cursor, String[] acceptMimes, String[] rejectMimes) { in FilteringCursorWrapper() argument 44 this(cursor, acceptMimes, rejectMimes, Long.MIN_VALUE); in FilteringCursorWrapper() 48 Cursor cursor, String[] acceptMimes, String[] rejectMimes, long rejectBefore) { in FilteringCursorWrapper() argument 49 mCursor = cursor; in FilteringCursorWrapper() 51 final int count = cursor.getCount(); in FilteringCursorWrapper() 54 cursor.moveToPosition(-1); in FilteringCursorWrapper() 55 while (cursor.moveToNext() && mCount < count) { in FilteringCursorWrapper() 56 final String mimeType = getCursorString(cursor, Document.COLUMN_MIME_TYPE); in FilteringCursorWrapper() [all …]
|
/frameworks/base/packages/MtpDocumentsProvider/src/com/android/mtp/ |
D | MtpDatabase.java | 262 try (final Cursor cursor = mDatabase.query( in getStorageDocumentIds() argument 275 final String[] ids = new String[cursor.getCount()]; in getStorageDocumentIds() 276 for (int i = 0; cursor.moveToNext(); i++) { in getStorageDocumentIds() 277 ids[i] = cursor.getString(0); in getStorageDocumentIds() 302 final Cursor cursor = mDatabase.query( in getDocumentIdForDevice() local 312 if (cursor.moveToNext()) { in getDocumentIdForDevice() 313 return cursor.getString(0); in getDocumentIdForDevice() 318 cursor.close(); in getDocumentIdForDevice() 329 final Cursor cursor = mDatabase.query( in getParentIdentifier() local 339 if (cursor.moveToNext()) { in getParentIdentifier() [all …]
|
/frameworks/base/core/java/android/content/ |
D | CursorLoader.java | 64 Cursor cursor = getContext().getContentResolver().query(mUri, mProjection, mSelection, in loadInBackground() local 66 if (cursor != null) { in loadInBackground() 69 cursor.getCount(); in loadInBackground() 70 cursor.registerContentObserver(mObserver); in loadInBackground() 72 cursor.close(); in loadInBackground() 76 return cursor; in loadInBackground() 97 public void deliverResult(Cursor cursor) { in deliverResult() argument 100 if (cursor != null) { in deliverResult() 101 cursor.close(); in deliverResult() 106 mCursor = cursor; in deliverResult() [all …]
|
/frameworks/support/v4/java/android/support/v4/content/ |
D | CursorLoader.java | 59 Cursor cursor = ContentResolverCompat.query(getContext().getContentResolver(), in loadInBackground() local 62 if (cursor != null) { in loadInBackground() 65 cursor.getCount(); in loadInBackground() 66 cursor.registerContentObserver(mObserver); in loadInBackground() 68 cursor.close(); in loadInBackground() 72 return cursor; in loadInBackground() 93 public void deliverResult(Cursor cursor) { in deliverResult() argument 96 if (cursor != null) { in deliverResult() 97 cursor.close(); in deliverResult() 102 mCursor = cursor; in deliverResult() [all …]
|
/frameworks/base/core/tests/coretests/src/android/app/ |
D | DownloadManagerBaseTest.java | 150 Cursor cursor = dm.query(new Query().setFilterById(id)); in onReceive() local 152 if (cursor.moveToFirst()) { in onReceive() 153 int status = cursor.getInt(cursor.getColumnIndex( in onReceive() 160 cursor.close(); in onReceive() 451 protected void logDBColumnData(Cursor cursor, String column) { in logDBColumnData() argument 452 int index = cursor.getColumnIndex(column); in logDBColumnData() 454 Log.i(LOG_TAG, "columnValue: " + cursor.getString(index)); in logDBColumnData() 485 Cursor cursor = mDownloadManager.query(new Query().setFilterById(requestId)); in verifyAndCleanupSingleFileDownload() local 488 assertEquals(1, cursor.getCount()); in verifyAndCleanupSingleFileDownload() 489 assertTrue(cursor.moveToFirst()); in verifyAndCleanupSingleFileDownload() [all …]
|
/frameworks/base/telephony/java/com/android/internal/telephony/ |
D | CallerInfo.java | 173 public static CallerInfo getCallerInfo(Context context, Uri contactRef, Cursor cursor) { in getCallerInfo() argument 186 if (cursor != null) { in getCallerInfo() 187 if (cursor.moveToFirst()) { in getCallerInfo() 195 columnIndex = cursor.getColumnIndex(PhoneLookup.DISPLAY_NAME); in getCallerInfo() 197 info.name = cursor.getString(columnIndex); in getCallerInfo() 201 columnIndex = cursor.getColumnIndex(PhoneLookup.NUMBER); in getCallerInfo() 203 info.phoneNumber = cursor.getString(columnIndex); in getCallerInfo() 207 columnIndex = cursor.getColumnIndex(PhoneLookup.NORMALIZED_NUMBER); in getCallerInfo() 209 info.normalizedNumber = cursor.getString(columnIndex); in getCallerInfo() 213 columnIndex = cursor.getColumnIndex(PhoneLookup.LABEL); in getCallerInfo() [all …]
|