/packages/apps/UniversalMediaPlayer/java/com/android/pump/db/ |
D | AudioStore.java | 88 Cursor cursor = mContentResolver.query(contentUri, projection, null, null, sortOrder); in load() local 89 if (cursor != null) { in load() 91 int idColumn = cursor.getColumnIndexOrThrow(MediaStore.Audio.Artists._ID); in load() 93 for (cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) { in load() 94 long id = cursor.getLong(idColumn); in load() 100 cursor.close(); in load() 113 Cursor cursor = mContentResolver.query(contentUri, projection, null, null, sortOrder); in load() local 114 if (cursor != null) { in load() 116 int idColumn = cursor.getColumnIndexOrThrow(MediaStore.Audio.Albums._ID); in load() 117 int artistIdColumn = cursor.getColumnIndexOrThrow( in load() [all …]
|
D | VideoStore.java | 119 Cursor cursor = mContentResolver.query(contentUri, projection, null, null, sortOrder); in load() local 120 if (cursor != null) { in load() 122 int idColumn = cursor.getColumnIndexOrThrow(MediaStore.Video.Media._ID); in load() 126 int mimeTypeColumn = cursor.getColumnIndexOrThrow( in load() 131 relativePathColumn = cursor.getColumnIndexOrThrow(RELATIVE_PATH); in load() 132 displayNameColumn = cursor.getColumnIndexOrThrow( in load() 135 dataColumn = cursor.getColumnIndexOrThrow(MediaStore.Video.Media.DATA); in load() 140 for (cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) { in load() 141 long id = cursor.getLong(idColumn); in load() 142 String mimeType = cursor.getString(mimeTypeColumn); in load() [all …]
|
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/btservice/storage/ |
D | DatabaseManagerTest.java | 580 Cursor cursor = db.query("SELECT * FROM metadata"); in testDatabaseMigration_100_101() local 583 assertHasColumn(cursor, "pbap_client_priority", false); in testDatabaseMigration_100_101() 589 cursor = db.query("SELECT * FROM metadata"); in testDatabaseMigration_100_101() 592 assertHasColumn(cursor, "pbap_client_priority", true); in testDatabaseMigration_100_101() 601 Cursor cursor = db.query("SELECT * FROM metadata"); in testDatabaseMigration_101_102() local 641 assertHasColumn(cursor, "is_unthethered_headset", true); in testDatabaseMigration_101_102() 642 assertHasColumn(cursor, "unthethered_left_icon", true); in testDatabaseMigration_101_102() 643 assertHasColumn(cursor, "unthethered_right_icon", true); in testDatabaseMigration_101_102() 644 assertHasColumn(cursor, "unthethered_case_icon", true); in testDatabaseMigration_101_102() 645 assertHasColumn(cursor, "unthethered_left_battery", true); in testDatabaseMigration_101_102() [all …]
|
/packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/ |
D | CellBroadcastCursorAdapter.java | 51 public View newView(Context context, Cursor cursor, ViewGroup parent) { in newView() argument 52 SmsCbMessage message = createFromCursor(context, cursor); in newView() 62 static SmsCbMessage createFromCursor(Context context, Cursor cursor) { in createFromCursor() argument 63 int geoScope = cursor.getInt( in createFromCursor() 64 cursor.getColumnIndexOrThrow(Telephony.CellBroadcasts.GEOGRAPHICAL_SCOPE)); in createFromCursor() 65 int serialNum = cursor.getInt( in createFromCursor() 66 cursor.getColumnIndexOrThrow(Telephony.CellBroadcasts.SERIAL_NUMBER)); in createFromCursor() 67 int category = cursor.getInt( in createFromCursor() 68 cursor.getColumnIndexOrThrow(Telephony.CellBroadcasts.SERVICE_CATEGORY)); in createFromCursor() 69 String language = cursor.getString( in createFromCursor() [all …]
|
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/ |
D | ContactDirectoryManagerTest.java | 92 MatrixCursor cursor = new MatrixCursor( in query() local 95 cursor.addRow(new Object[] { in query() 103 return cursor; in query() 186 Cursor cursor = mResolver.query(Directory.CONTENT_URI, null, null, null, in testScanAllProviders() local 190 TestUtils.dumpCursor(cursor); in testScanAllProviders() 191 assertEquals(5, cursor.getCount()); in testScanAllProviders() 193 assertTrue(cursor.moveToPosition(0)); in testScanAllProviders() 194 assertDirectoryRow(cursor, "test.package1", "authority1", "account-name1", "account-type1", in testScanAllProviders() 198 assertTrue(cursor.moveToPosition(1)); in testScanAllProviders() 199 assertDirectoryRow(cursor, "test.package1", "authority1", "account-name2", "account-type2", in testScanAllProviders() [all …]
|
/packages/modules/CellBroadcastService/tests/src/com/android/cellbroadcastservice/tests/ |
D | CellBroadcastProviderTest.java | 113 Cursor cursor = mContentResolver.query(CONTENT_URI, QUERY_COLUMNS, in testUpdate() local 115 cursor.moveToNext(); in testUpdate() 117 assertThat(cursor.getInt(cursor.getColumnIndexOrThrow(CellBroadcasts.RECEIVED_TIME))) in testUpdate() 119 assertThat(cursor.getInt(cursor.getColumnIndexOrThrow(CellBroadcasts.MESSAGE_DISPLAYED))) in testUpdate() 121 cursor.close(); in testUpdate() 160 Cursor cursor = mContentResolver.query( in testGetAllCellBroadcast() local 166 assertThat(cursor.getCount()).isEqualTo(messageNotDisplayedCount); in testGetAllCellBroadcast() 197 Cursor cursor = mContentResolver.query(CONTENT_URI, QUERY_COLUMNS, in testDelete_oneRecord_success() local 199 assertThat(cursor.getCount()).isEqualTo(1); in testDelete_oneRecord_success() 200 cursor.close(); in testDelete_oneRecord_success() [all …]
|
/packages/providers/CalendarProvider/tests/src/com/android/providers/calendar/ |
D | CalendarProvider2Test.java | 313 Cursor cursor = mResolver.query(mEventsUri, null, null, null, null); in execute() local 314 assertEquals(expected, cursor.getCount()); in execute() 315 cursor.close(); in execute() 329 Cursor cursor = mResolver.query(mEventsUri, null, null, null, null); in execute() local 330 dumpCursor(cursor); in execute() 331 cursor.close(); in execute() 351 Cursor cursor = queryInstances(begin, end); in execute() local 352 dumpCursor(cursor); in execute() 353 cursor.close(); in execute() 376 Cursor cursor = queryInstances(begin, end); in execute() local [all …]
|
/packages/apps/DocumentsUI/tests/unit/com/android/documentsui/archives/ |
D | ReadableArchiveTest.java | 100 private static void assertRowExist(Cursor cursor, String targetDocId) { in assertRowExist() argument 101 assertTrue(cursor.moveToFirst()); in assertRowExist() 104 final int count = cursor.getCount(); in assertRowExist() 106 cursor.moveToPosition(i); in assertRowExist() 107 if (TextUtils.equals(targetDocId, cursor.getString( in assertRowExist() 108 cursor.getColumnIndexOrThrow(Document.COLUMN_DOCUMENT_ID)))) { in assertRowExist() 121 final Cursor cursor = mArchive.queryChildDocuments( in testQueryChildDocument() local 124 assertRowExist(cursor, createArchiveId("/file1.txt").toDocumentId()); in testQueryChildDocument() 126 cursor.getString(cursor.getColumnIndexOrThrow(Document.COLUMN_DISPLAY_NAME))); in testQueryChildDocument() 128 cursor.getString(cursor.getColumnIndexOrThrow(Document.COLUMN_MIME_TYPE))); in testQueryChildDocument() [all …]
|
/packages/providers/MediaProvider/src/com/android/providers/media/ |
D | MediaDocumentsProvider.java | 176 private void copyNotificationUri(MatrixCursor result, Cursor cursor) { in copyNotificationUri() argument 177 result.setNotificationUri(getContext().getContentResolver(), cursor.getNotificationUri()); in copyNotificationUri() 467 Cursor cursor = null; in getDocumentMetadataFromIndex() local 474 cursor = resolver.query( in getDocumentMetadataFromIndex() 481 if (!cursor.moveToFirst()) { in getDocumentMetadataFromIndex() 485 final Bundle metadata = extractMetadataFromCursor(cursor, columnMap); in getDocumentMetadataFromIndex() 492 IoUtils.closeQuietly(cursor); in getDocumentMetadataFromIndex() 498 private static Bundle extractMetadataFromCursor(Cursor cursor, Map<String, String> columns) { in extractMetadataFromCursor() argument 500 assert (cursor.getCount() == 1); in extractMetadataFromCursor() 505 int index = cursor.getColumnIndex(col); in extractMetadataFromCursor() [all …]
|
/packages/apps/Messaging/src/com/android/messaging/datamodel/ |
D | BugleDatabaseOperations.java | 260 Cursor cursor = null; in getExistingConversation() local 263 cursor = dbWrapper.rawQuery("SELECT " + ConversationColumns._ID in getExistingConversation() 268 if (cursor.moveToFirst()) { in getExistingConversation() 269 Assert.isTrue(cursor.getCount() == 1); in getExistingConversation() 270 conversationId = cursor.getString(0); in getExistingConversation() 273 if (cursor != null) { in getExistingConversation() 274 cursor.close(); in getExistingConversation() 294 Cursor cursor = null; in getThreadId() local 296 cursor = dbWrapper.query(DatabaseHelper.CONVERSATIONS_TABLE, in getThreadId() 302 if (cursor.moveToFirst()) { in getThreadId() [all …]
|
/packages/apps/Dialer/java/com/android/contacts/common/model/ |
D | ContactLoader.java | 274 Cursor cursor = in loadContactEntity() local 276 if (cursor == null) { in loadContactEntity() 282 if (!cursor.moveToFirst()) { in loadContactEntity() 283 cursor.close(); in loadContactEntity() 288 Contact contact = loadContactHeaderData(cursor, contactUri); in loadContactEntity() 297 long rawContactId = cursor.getLong(ContactQuery.RAW_CONTACT_ID); in loadContactEntity() 302 rawContact = new RawContact(loadRawContactValues(cursor)); in loadContactEntity() 305 if (!cursor.isNull(ContactQuery.DATA_ID)) { in loadContactEntity() 306 ContentValues data = loadDataValues(cursor); in loadContactEntity() 309 } while (cursor.moveToNext()); in loadContactEntity() [all …]
|
/packages/screensavers/PhotoTable/src/com/android/dreams/phototable/ |
D | PicasaSource.java | 114 data.cursor = mResolver.query(picasaUriBuilder.build(), in openCursor() 121 if (data.cursor == null) { in findPosition() 124 if (data.cursor != null) { in findPosition() 125 int idIndex = data.cursor.getColumnIndex(PICASA_ID); in findPosition() 126 data.cursor.moveToPosition(-1); in findPosition() 127 while (data.position == -1 && data.cursor.moveToNext()) { in findPosition() 128 String id = data.cursor.getString(idIndex); in findPosition() 130 data.position = data.cursor.getPosition(); in findPosition() 142 protected ImageData unpackImageData(Cursor cursor, ImageData data) { in unpackImageData() argument 146 int idIndex = cursor.getColumnIndex(PICASA_ID); in unpackImageData() [all …]
|
D | LocalSource.java | 76 Cursor cursor = mResolver.query(uri, projection, null, null, null); in findAlbums() local 77 if (cursor != null) { in findAlbums() 78 cursor.moveToPosition(-1); in findAlbums() 80 int dataIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATA); in findAlbums() 81 int bucketIndex = cursor.getColumnIndex(MediaStore.Images.Media.BUCKET_ID); in findAlbums() 82 int nameIndex = cursor.getColumnIndex(MediaStore.Images.Media.BUCKET_DISPLAY_NAME); in findAlbums() 83 int updatedIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATE_TAKEN); in findAlbums() 88 while (cursor.moveToNext()) { in findAlbums() 89 String id = constructId(internal, cursor.getString(bucketIndex)); in findAlbums() 97 data.thumbnailUrl = cursor.getString(dataIndex); in findAlbums() [all …]
|
/packages/apps/Contacts/src/com/android/contacts/list/ |
D | ContactListAdapter.java | 169 public Uri getContactUri(int partitionIndex, Cursor cursor) { in getContactUri() argument 170 long contactId = cursor.getLong(ContactQuery.CONTACT_ID); in getContactUri() 171 String lookupKey = cursor.getString(ContactQuery.CONTACT_LOOKUP_KEY); in getContactUri() 185 final Cursor cursor = (Cursor) getItem(position); in getContactId() local 186 return cursor == null ? -1 : cursor.getLong(ContactQuery.CONTACT_ID); in getContactId() 190 final Cursor cursor = (Cursor) getItem(position); in isEnterpriseContact() local 191 if (cursor != null) { in isEnterpriseContact() 192 final long contactId = cursor.getLong(ContactQuery.CONTACT_ID); in isEnterpriseContact() 204 public boolean isSelectedContact(int partitionIndex, Cursor cursor) { in isSelectedContact() argument 211 cursor.getString(ContactQuery.CONTACT_LOOKUP_KEY))) { in isSelectedContact() [all …]
|
/packages/apps/Dialer/java/com/android/dialer/searchfragment/cp2/ |
D | ContactFilterCursor.java | 55 private final Cursor cursor; field in ContactFilterCursor 82 ContactFilterCursor(Cursor cursor, @Nullable String query, Context context) { in ContactFilterCursor() argument 83 this.cursor = createCursor(cursor); in ContactFilterCursor() 84 contactTree = buildContactSearchTree(context, this.cursor); in ContactFilterCursor() 110 private static Cursor createCursor(Cursor cursor) { in createCursor() argument 114 cursor.moveToPosition(-1); in createCursor() 115 while (cursor.moveToNext()) { in createCursor() 116 Cp2Contact contact = Cp2Contact.fromCursor(cursor); in createCursor() 118 contactIdsToPosition.put(contact.contactId(), cursor.getPosition()); in createCursor() 120 cursor.close(); in createCursor() [all …]
|
D | SearchContactViewHolder.java | 95 public void bind(SearchCursor cursor, String query) { in bind() argument 96 dialerContact = getDialerContact(context, cursor); in bind() 97 position = cursor.getPosition(); in bind() 98 number = cursor.getString(Projections.PHONE_NUMBER); in bind() 99 String name = cursor.getString(Projections.DISPLAY_NAME); in bind() 100 String label = getLabel(context.getResources(), cursor); in bind() 111 setCallToAction(cursor, query); in bind() 113 if (shouldShowPhoto(cursor)) { in bind() 116 String photoUri = cursor.getString(Projections.PHOTO_URI); in bind() 120 getContactUri(cursor), in bind() [all …]
|
/packages/apps/Contacts/src/com/android/contacts/model/ |
D | ContactLoader.java | 452 Cursor cursor = resolver.query(entityUri, ContactQuery.COLUMNS, null, null, in loadContactEntity() local 454 if (cursor == null) { in loadContactEntity() 460 if (!cursor.moveToFirst()) { in loadContactEntity() 461 cursor.close(); in loadContactEntity() 466 Contact contact = loadContactHeaderData(cursor, contactUri); in loadContactEntity() 477 long rawContactId = cursor.getLong(ContactQuery.RAW_CONTACT_ID); in loadContactEntity() 482 rawContact = new RawContact(loadRawContactValues(cursor)); in loadContactEntity() 485 if (!cursor.isNull(ContactQuery.DATA_ID)) { in loadContactEntity() 486 ContentValues data = loadDataValues(cursor); in loadContactEntity() 489 if (!cursor.isNull(ContactQuery.PRESENCE) in loadContactEntity() [all …]
|
/packages/apps/Dialer/java/com/android/dialer/calllog/datasources/systemcalllog/ |
D | SystemCallLogDataSource.java | 238 try (Cursor cursor = in handleInsertsAndUpdates() argument 248 if (cursor == null) { in handleInsertsAndUpdates() 253 if (!cursor.moveToFirst()) { in handleInsertsAndUpdates() 261 cursor.getCount()); in handleInsertsAndUpdates() 263 int idColumn = cursor.getColumnIndexOrThrow(Calls._ID); in handleInsertsAndUpdates() 264 int dateColumn = cursor.getColumnIndexOrThrow(Calls.DATE); in handleInsertsAndUpdates() 265 int lastModifiedColumn = cursor.getColumnIndexOrThrow(Calls.LAST_MODIFIED); in handleInsertsAndUpdates() 266 int numberColumn = cursor.getColumnIndexOrThrow(Calls.NUMBER); in handleInsertsAndUpdates() 267 int presentationColumn = cursor.getColumnIndexOrThrow(Calls.NUMBER_PRESENTATION); in handleInsertsAndUpdates() 268 int typeColumn = cursor.getColumnIndexOrThrow(Calls.TYPE); in handleInsertsAndUpdates() [all …]
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/dictionarypack/ |
D | MetadataDbHelper.java | 360 final Cursor cursor = defaultDb.query(MetadataDbHelper.CLIENT_TABLE_NAME, in getMetadataUriAsString() local 365 if (!cursor.moveToFirst()) return null; in getMetadataUriAsString() 366 return sMetadataUriGetter.getUri(context, cursor.getString(0)); in getMetadataUriAsString() 368 cursor.close(); in getMetadataUriAsString() 389 final Cursor cursor = MetadataDbHelper.queryClientIds(context); in saveLastUpdateTimeOfUri() local 390 if (null == cursor) return; in saveLastUpdateTimeOfUri() 392 if (!cursor.moveToFirst()) return; in saveLastUpdateTimeOfUri() 394 final String clientId = cursor.getString(0); in saveLastUpdateTimeOfUri() 401 } while (cursor.moveToNext()); in saveLastUpdateTimeOfUri() 403 cursor.close(); in saveLastUpdateTimeOfUri() [all …]
|
/packages/apps/Car/libs/car-telephony-common/src/com/android/car/telephony/common/ |
D | Contact.java | 210 public static Contact fromCursor(Context context, Cursor cursor) { in fromCursor() argument 211 return fromCursor(context, cursor, null); in fromCursor() 223 public static Contact fromCursor(Context context, Cursor cursor, @Nullable Contact contact) { in fromCursor() argument 224 int accountNameColumn = cursor.getColumnIndex(ContactsContract.RawContacts.ACCOUNT_NAME); in fromCursor() 225 int lookupKeyColumn = cursor.getColumnIndex(ContactsContract.Data.LOOKUP_KEY); in fromCursor() 226 String accountName = cursor.getString(accountNameColumn); in fromCursor() 227 String lookupKey = cursor.getString(lookupKeyColumn); in fromCursor() 231 contact.loadBasicInfo(cursor); in fromCursor() 238 contact.loadBasicInfo(cursor); in fromCursor() 241 int mimetypeColumn = cursor.getColumnIndex(ContactsContract.Data.MIMETYPE); in fromCursor() [all …]
|
/packages/apps/Contacts/src/com/android/contacts/util/ |
D | DataStatus.java | 46 public DataStatus(Cursor cursor) { in DataStatus() argument 48 fromCursor(cursor); in DataStatus() 55 public void possibleUpdate(Cursor cursor) { in possibleUpdate() argument 56 final boolean hasStatus = !isNull(cursor, Data.STATUS); in possibleUpdate() 57 final boolean hasTimestamp = !isNull(cursor, Data.STATUS_TIMESTAMP); in possibleUpdate() 66 final long newTimestamp = getLong(cursor, Data.STATUS_TIMESTAMP, -1); in possibleUpdate() 73 fromCursor(cursor); in possibleUpdate() 76 private void fromCursor(Cursor cursor) { in fromCursor() argument 77 mPresence = getInt(cursor, Data.PRESENCE, -1); in fromCursor() 78 mStatus = getString(cursor, Data.STATUS); in fromCursor() [all …]
|
/packages/apps/Contacts/src/com/android/contacts/group/ |
D | GroupUtil.java | 73 public static GroupListItem getGroupListItem(Cursor cursor, int position) { in getGroupListItem() argument 74 if (cursor == null || cursor.isClosed() || !cursor.moveToPosition(position)) { in getGroupListItem() 77 String accountName = cursor.getString(GroupListLoader.ACCOUNT_NAME); in getGroupListItem() 78 String accountType = cursor.getString(GroupListLoader.ACCOUNT_TYPE); in getGroupListItem() 79 String dataSet = cursor.getString(GroupListLoader.DATA_SET); in getGroupListItem() 80 long groupId = cursor.getLong(GroupListLoader.GROUP_ID); in getGroupListItem() 81 String title = cursor.getString(GroupListLoader.TITLE); in getGroupListItem() 82 int memberCount = cursor.getInt(GroupListLoader.MEMBER_COUNT); in getGroupListItem() 83 boolean isReadOnly = cursor.getInt(GroupListLoader.IS_READ_ONLY) == 1; in getGroupListItem() 84 String systemId = cursor.getString(GroupListLoader.SYSTEM_ID); in getGroupListItem() [all …]
|
/packages/apps/Bluetooth/src/com/android/bluetooth/opp/ |
D | BluetoothOppService.java | 615 Cursor cursor = in run() local 619 if (cursor == null) { in run() 624 cursor.moveToFirst(); in run() 628 boolean isAfterLast = cursor.isAfterLast(); in run() 630 int idColumn = cursor.getColumnIndexOrThrow(BluetoothShare._ID); in run() 659 int id = cursor.getInt(idColumn); in run() 662 insertShare(cursor, arrayPos); in run() 667 cursor.moveToNext(); in run() 668 isAfterLast = cursor.isAfterLast(); in run() 683 updateShare(cursor, arrayPos); in run() [all …]
|
/packages/apps/Gallery2/src/com/android/gallery3d/gadget/ |
D | WidgetDatabaseHelper.java | 78 private Entry(int id, Cursor cursor) { in Entry() argument 80 type = cursor.getInt(INDEX_WIDGET_TYPE); in Entry() 82 imageUri = cursor.getString(INDEX_IMAGE_URI); in Entry() 83 imageData = cursor.getBlob(INDEX_PHOTO_BLOB); in Entry() 85 albumPath = cursor.getString(INDEX_ALBUM_PATH); in Entry() 86 relativePath = cursor.getString(INDEX_RELATIVE_PATH); in Entry() 90 private Entry(Cursor cursor) { in Entry() argument 91 this(cursor.getInt(INDEX_APPWIDGET_ID), cursor); in Entry() 112 Cursor cursor = db.query("photos", in saveData() local 115 if (cursor == null) return; in saveData() [all …]
|
/packages/providers/TvProvider/tests/src/com/android/providers/tv/ |
D | ColumnFilterTest.java | 88 Cursor cursor = mResolver.query(Channels.CONTENT_URI, projection, null, null, null); in testQueryChannel() local 89 assertNotNull(cursor); in testQueryChannel() 90 cursor.moveToNext(); in testQueryChannel() 91 assertEquals(FAKE_INPUT_ID, cursor.getString(0)); in testQueryChannel() 92 assertNull(cursor.getString(1)); in testQueryChannel() 93 assertEquals(channelId, cursor.getLong(2)); in testQueryChannel() 101 Cursor cursor = mResolver.query(Channels.CONTENT_URI, projection, null, null, null); in testQueryChannel_count() local 102 assertNotNull(cursor); in testQueryChannel_count() 103 cursor.moveToNext(); in testQueryChannel_count() 104 assertEquals(1, cursor.getInt(0)); in testQueryChannel_count() [all …]
|