/packages/providers/ContactsProvider/src/com/android/providers/contacts/util/ |
H A D | CloseUtils.java | 27 /** If the argument is non-null, close the cursor. */ 28 public static void closeQuietly(Cursor cursor) { argument 29 if (cursor != null) { 30 cursor.close();
|
/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/ |
H A D | SuggestionPosition.java | 30 public SuggestionPosition(SuggestionCursor cursor) { argument 31 this(cursor, cursor.getPosition()); 34 public SuggestionPosition(SuggestionCursor cursor, int suggestionPos) { argument 35 mCursor = cursor; 44 * Gets the suggestion cursor, moved to point to the right suggestion.
|
H A D | CursorBackedSuggestionExtras.java | 27 * SuggestionExtras taking values from the extra columns in a suggestion cursor. 41 static CursorBackedSuggestionExtras createExtrasIfNecessary(Cursor cursor, int position) { argument 42 List<String> extraColumns = getExtraColumns(cursor); 44 return new CursorBackedSuggestionExtras(cursor, position, extraColumns); 50 static String[] getCursorColumns(Cursor cursor) { argument 52 return cursor.getColumnNames(); 60 static boolean cursorContainsExtras(Cursor cursor) { argument 61 String[] columns = getCursorColumns(cursor); 70 static List<String> getExtraColumns(Cursor cursor) { argument 71 String[] columns = getCursorColumns(cursor); 85 CursorBackedSuggestionExtras(Cursor cursor, int position, List<String> extraColumns) argument [all...] |
/packages/providers/CalendarProvider/tests/src/com/android/providers/calendar/ |
H A D | SyncCalendarTest.java | 74 Cursor cursor; 75 cursor = mResolver.query(mEventsUri, null, null, null, null); 77 int countBeforeNewEvent = cursor.getCount(); 78 cursor.moveToNext(); 81 String newTitle = cursor.getString(cursor.getColumnIndex("title")) + time.toString(); 82 long dtStart = cursor.getLong(cursor.getColumnIndex("dtstart")); 83 long dtEnd = cursor.getLong(cursor [all...] |
/packages/apps/Contacts/src/com/android/contacts/util/ |
H A D | StreamItemPhotoEntry.java | 48 public StreamItemPhotoEntry(Cursor cursor) { argument 49 // This is expected to be populated via a cursor containing a join of all 51 mId = getLong(cursor, StreamItemPhotos._ID); 52 mSortIndex = getInt(cursor, StreamItemPhotos.SORT_INDEX, -1); 53 mPhotoFileId = getLong(cursor, StreamItemPhotos.PHOTO_FILE_ID); 54 mPhotoUri = getString(cursor, StreamItemPhotos.PHOTO_URI); 55 mHeight = getInt(cursor, PhotoFiles.HEIGHT, -1); 56 mWidth = getInt(cursor, PhotoFiles.WIDTH, -1); 57 mFileSize = getInt(cursor, PhotoFiles.FILESIZE, -1); 112 private static String getString(Cursor cursor, Strin argument 116 getInt(Cursor cursor, String columnName, int missingValue) argument 121 getLong(Cursor cursor, String columnName) argument [all...] |
H A D | DataStatus.java | 46 public DataStatus(Cursor cursor) { argument 47 // When creating from cursor row, fill normally 48 fromCursor(cursor); 55 public void possibleUpdate(Cursor cursor) { argument 56 final boolean hasStatus = !isNull(cursor, Data.STATUS); 57 final boolean hasTimestamp = !isNull(cursor, Data.STATUS_TIMESTAMP); 66 final long newTimestamp = getLong(cursor, Data.STATUS_TIMESTAMP, -1); 72 // Fill in remaining details from cursor 73 fromCursor(cursor); 76 private void fromCursor(Cursor cursor) { argument 144 getString(Cursor cursor, String columnName) argument 148 getInt(Cursor cursor, String columnName) argument 152 getInt(Cursor cursor, String columnName, int missingValue) argument 157 getLong(Cursor cursor, String columnName, long missingValue) argument 162 isNull(Cursor cursor, String columnName) argument [all...] |
H A D | NotifyingAsyncQueryHandler.java | 40 void onQueryComplete(int token, Object cookie, Cursor cursor); argument 58 protected void onQueryComplete(int token, Object cookie, Cursor cursor) { argument 61 listener.onQueryComplete(token, cookie, cursor); 62 } else if (cursor != null) { 63 cursor.close();
|
/packages/experimental/LoaderApp/src/com/android/loaderapp/util/ |
H A D | DataStatus.java | 44 public DataStatus(Cursor cursor) { argument 45 // When creating from cursor row, fill normally 46 fromCursor(cursor); 53 public void possibleUpdate(Cursor cursor) { argument 54 final boolean hasStatus = !isNull(cursor, Data.STATUS); 55 final boolean hasTimestamp = !isNull(cursor, Data.STATUS_TIMESTAMP); 64 final long newTimestamp = getLong(cursor, Data.STATUS_TIMESTAMP, -1); 70 // Fill in remaining details from cursor 71 fromCursor(cursor); 74 private void fromCursor(Cursor cursor) { argument 138 getString(Cursor cursor, String columnName) argument 142 getInt(Cursor cursor, String columnName) argument 146 getInt(Cursor cursor, String columnName, int missingValue) argument 151 getLong(Cursor cursor, String columnName, long missingValue) argument 156 isNull(Cursor cursor, String columnName) argument [all...] |
/packages/providers/DownloadProvider/tests/src/com/android/providers/downloads/ |
H A D | AbstractPublicApiTest.java | 48 Cursor cursor = mManager.query(new DownloadManager.Query().setFilterById(mId)); 50 if (cursor.getCount() > 0) { 51 cursor.moveToFirst(); 52 return (int) cursor.getLong(cursor.getColumnIndexOrThrow( 59 cursor.close(); 64 Cursor cursor = mManager.query(new DownloadManager.Query().setFilterById(mId)); 66 assertEquals(1, cursor.getCount()); 67 cursor.moveToFirst(); 68 return cursor [all...] |
/packages/apps/Gallery/src/com/android/camera/gallery/ |
H A D | ImageList.java | 41 Cursor cursor = Media.query( 49 while (cursor.moveToNext()) { 50 hash.put(cursor.getString(1), cursor.getString(0)); 54 cursor.close(); 115 protected long getImageId(Cursor cursor) { argument 116 return cursor.getLong(INDEX_ID); 120 protected BaseImage loadImageFromCursor(Cursor cursor) { argument 121 long id = cursor.getLong(INDEX_ID); 122 String dataPath = cursor [all...] |
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/ |
H A D | ContactDirectoryManagerTest.java | 89 MatrixCursor cursor = new MatrixCursor( 92 cursor.addRow(new Object[] { 100 return cursor; 173 Cursor cursor = mResolver.query(Directory.CONTENT_URI, null, null, null, null); 174 assertEquals(5, cursor.getCount()); 176 cursor.moveToPosition(2); 177 assertDirectoryRow(cursor, "test.package1", "authority1", "account-name1", "account-type1", 181 cursor.moveToNext(); 182 assertDirectoryRow(cursor, "test.package1", "authority1", "account-name2", "account-type2", 186 cursor 600 addDirectoryRow(MatrixCursor cursor, String accountName, String accountType, String displayName, int typeResourceId, int exportSupport, int shortcutSupport, int photoSupport) argument 614 assertDirectoryRow(Cursor cursor, String packageName, String authority, String accountName, String accountType, String displayName, int typeResourceId, int exportSupport, int shortcutSupport, int photoSupport) argument [all...] |
/packages/providers/PartnerBookmarksProvider/tests/src/com/android/providers/partnerbookmarks/ |
H A D | PartnerBookmarksProviderTest.java | 40 Cursor cursor = null; 42 cursor = providerClient.query(PartnerBookmarksContract.Bookmarks.CONTENT_URI, 44 assertNotNull("Failed to query for bookmarks", cursor); 46 while (cursor.moveToNext()) { 47 long id = cursor.getLong( 48 cursor.getColumnIndexOrThrow(PartnerBookmarksContract.Bookmarks.ID)); 49 long parent = cursor.getLong( 50 cursor.getColumnIndexOrThrow(PartnerBookmarksContract.Bookmarks.PARENT)); 51 boolean isFolder = cursor.getInt( 52 cursor [all...] |
/packages/apps/Gallery2/src/com/android/gallery3d/data/ |
H A D | LocalVideo.java | 75 public LocalVideo(Path path, GalleryApp application, Cursor cursor) { argument 78 loadFromCursor(cursor); 86 Cursor cursor = LocalAlbum.getItemCursor(resolver, uri, PROJECTION, id); 87 if (cursor == null) { 88 throw new RuntimeException("cannot get cursor for: " + path); 91 if (cursor.moveToNext()) { 92 loadFromCursor(cursor); 97 cursor.close(); 101 private void loadFromCursor(Cursor cursor) { argument 102 id = cursor 132 updateFromCursor(Cursor cursor) argument [all...] |
/packages/apps/Contacts/src/com/android/contacts/list/ |
H A D | LegacyContactListAdapter.java | 28 * A cursor adapter for the People.CONTENT_TYPE content type. 67 Cursor cursor = ((Cursor)getItem(position)); 68 long personId = cursor.getLong(PERSON_ID_COLUMN_INDEX); 73 protected View newView(Context context, int partition, Cursor cursor, int position, argument 81 protected void bindView(View itemView, int partition, Cursor cursor, int position) { argument 83 bindName(view, cursor); 84 bindPresence(view, cursor); 87 protected void bindName(final ContactListItemView view, Cursor cursor) { argument 88 view.showDisplayName(cursor, PERSON_DISPLAY_NAME_COLUMN_INDEX, 90 view.showPhoneticName(cursor, PERSON_PHONETIC_NAME_COLUMN_INDE 93 bindPresence(final ContactListItemView view, Cursor cursor) argument [all...] |
H A D | LegacyPhoneNumberListAdapter.java | 30 * A cursor adapter for the Phones.CONTENT_TYPE content type. 71 Cursor cursor = ((Cursor)getItem(position)); 72 long id = cursor.getLong(PHONE_ID_COLUMN_INDEX); 77 protected View newView(Context context, int partition, Cursor cursor, int position, argument 85 protected void bindView(View itemView, int partition, Cursor cursor, int position) { argument 87 bindName(view, cursor); 88 bindPhoneNumber(view, cursor); 91 protected void bindName(final ContactListItemView view, Cursor cursor) { argument 92 view.showDisplayName(cursor, PHONE_DISPLAY_NAME_COLUMN_INDEX, getContactNameDisplayOrder()); 93 view.showPhoneticName(cursor, PHONE_PHONETIC_NAME_COLUMN_INDE 96 bindPhoneNumber(ContactListItemView view, Cursor cursor) argument [all...] |
H A D | LegacyPostalAddressListAdapter.java | 30 * A cursor adapter for the ContactMethods.CONTENT_TYPE content type. 72 Cursor cursor = ((Cursor)getItem(position)); 73 long id = cursor.getLong(POSTAL_ID_COLUMN_INDEX); 78 protected View newView(Context context, int partition, Cursor cursor, int position, argument 86 protected void bindView(View itemView, int partition, Cursor cursor, int position) { argument 88 bindName(view, cursor); 89 bindPostalAddress(view, cursor); 92 protected void bindName(final ContactListItemView view, Cursor cursor) { argument 93 view.showDisplayName(cursor, POSTAL_DISPLAY_NAME_COLUMN_INDEX, 95 view.showPhoneticName(cursor, POSTAL_PHONETIC_NAME_COLUMN_INDE 98 bindPostalAddress(ContactListItemView view, Cursor cursor) argument [all...] |
H A D | ContactListAdapter.java | 34 * A cursor adapter for the {@link ContactsContract.Contacts#CONTENT_TYPE} content type. 152 public Uri getContactUri(int partitionIndex, Cursor cursor) { argument 153 long contactId = cursor.getLong(ContactQuery.CONTACT_ID); 154 String lookupKey = cursor.getString(ContactQuery.CONTACT_LOOKUP_KEY); 170 public boolean isSelectedContact(int partitionIndex, Cursor cursor) { argument 177 cursor.getString(ContactQuery.CONTACT_LOOKUP_KEY))) { 182 && getSelectedContactId() == cursor.getLong(ContactQuery.CONTACT_ID); 186 protected View newView(Context context, int partition, Cursor cursor, int position, argument 196 Cursor cursor) { 201 if (position == 0 && cursor 195 bindSectionHeaderAndDivider(ContactListItemView view, int position, Cursor cursor) argument 215 bindPhoto(final ContactListItemView view, int partitionIndex, Cursor cursor) argument 236 bindName(final ContactListItemView view, Cursor cursor) argument 242 bindPresenceAndStatusMessage(final ContactListItemView view, Cursor cursor) argument 247 bindSearchSnippet(final ContactListItemView view, Cursor cursor) argument 333 changeCursor(int partitionIndex, Cursor cursor) argument [all...] |
/packages/providers/DownloadProvider/src/com/android/providers/downloads/ |
H A D | OpenHelper.java | 43 final Cursor cursor = downManager.query(new DownloadManager.Query().setFilterById(id)); 45 if (!cursor.moveToFirst()) { 49 final Uri localUri = getCursorUri(cursor, COLUMN_LOCAL_URI); 50 final String filename = getCursorString(cursor, COLUMN_LOCAL_FILENAME); 51 String mimeType = getCursorString(cursor, COLUMN_MEDIA_TYPE); 62 final Uri remoteUri = getCursorUri(cursor, COLUMN_URI); 75 cursor.close(); 100 final Cursor cursor = context.getContentResolver().query(uri, new String[]{Constants.UID}, 102 if (cursor != null) { 104 if (cursor 114 getCursorString(Cursor cursor, String column) argument 118 getCursorUri(Cursor cursor, String column) argument 122 getCursorLong(Cursor cursor, String column) argument [all...] |
/packages/apps/Mms/src/com/android/mms/util/ |
H A D | Recycler.java | 80 Cursor cursor = getAllThreads(context); 83 while (cursor.moveToNext()) { 84 long threadId = getThreadId(cursor); 88 cursor.close(); 122 abstract protected long getThreadId(Cursor cursor); argument 128 abstract protected void dumpMessage(Cursor cursor, Context context); argument 178 protected long getThreadId(Cursor cursor) { argument 179 return cursor.getLong(ID); 184 Cursor cursor = SqliteWrapper.query(context, resolver, 188 return cursor; 235 dumpMessage(Cursor cursor, Context context) argument 318 getThreadId(Cursor cursor) argument 433 dumpMessage(Cursor cursor, Context context) argument [all...] |
/packages/providers/ApplicationsProvider/src/com/android/providers/applications/ |
H A D | ApplicationsAdapter.java | 40 public void bindView(View view, Context context, Cursor cursor) { argument 43 Uri iconUri = getColumnUri(cursor, Applications.ApplicationColumns.ICON); 44 String name = getColumnString(cursor, Applications.ApplicationColumns.NAME); 50 public static Uri getColumnUri(Cursor cursor, String columnName) { argument 51 String uriString = getColumnString(cursor, columnName); 56 public static String getColumnString(Cursor cursor, String columnName) { argument 57 int col = cursor.getColumnIndex(columnName); 58 return getStringOrNull(cursor, col); 61 private static String getStringOrNull(Cursor cursor, int col) { argument 64 return cursor [all...] |
/packages/screensavers/PhotoTable/src/com/android/dreams/phototable/ |
H A D | LocalSource.java | 65 Cursor cursor = mResolver.query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, 67 if (cursor != null) { 68 cursor.moveToFirst(); 70 int dataIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATA); 71 int bucketIndex = cursor.getColumnIndex(MediaStore.Images.Media.BUCKET_ID); 72 int nameIndex = cursor.getColumnIndex(MediaStore.Images.Media.BUCKET_DISPLAY_NAME); 73 int updatedIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATE_TAKEN); 78 while (!cursor.isAfterLast()) { 79 String id = TAG + ":" + cursor.getString(bucketIndex); 87 data.thumbnailUrl = cursor [all...] |
H A D | PicasaSource.java | 162 Cursor cursor = mResolver.query(picasaUriBuilder.build(), 164 if (cursor != null) { 165 if (cursor.getCount() > howMany && mNextPosition == -1) { 167 (int) Math.abs(mRNG.nextInt() % (cursor.getCount() - howMany)); 173 cursor.moveToPosition(mNextPosition); 175 int idIndex = cursor.getColumnIndex(PICASA_ID); 176 int urlIndex = cursor.getColumnIndex(PICASA_URL); 177 int orientationIndex = cursor.getColumnIndex(PICASA_ROTATION); 178 int bucketIndex = cursor.getColumnIndex(PICASA_ALBUM_ID); 183 while (foundImages.size() < howMany && !cursor [all...] |
/packages/apps/Contacts/src/com/android/contacts/ |
H A D | CallDetailActivityQueryHandler.java | 66 protected synchronized void onQueryComplete(int token, Object cookie, Cursor cursor) { argument 70 if (moveToFirst(cursor) && hasNoAudio(cursor)) { 72 Status.buildSourceUri(getSourcePackage(cursor)), 79 mCallDetailActivity.updateVoicemailStatusMessage(cursor); 84 MoreCloseables.closeQuietly(cursor); 88 /** Check that the cursor is non-null and can be moved to first. */ 89 private boolean moveToFirst(Cursor cursor) { argument 90 if (cursor == null || !cursor [all...] |
/packages/apps/Gallery2/src/com/android/gallery3d/gadget/ |
H A D | WidgetDatabaseHelper.java | 73 private Entry(int id, Cursor cursor) { argument 75 type = cursor.getInt(INDEX_WIDGET_TYPE); 77 imageUri = cursor.getString(INDEX_IMAGE_URI); 78 imageData = cursor.getBlob(INDEX_PHOTO_BLOB); 80 albumPath = cursor.getString(INDEX_ALBUM_PATH); 84 private Entry(Cursor cursor) { argument 85 this(cursor.getInt(INDEX_APPWIDGET_ID), cursor); 105 Cursor cursor = db.query("photos", 108 if (cursor [all...] |
/packages/apps/Contacts/tests/src/com/android/contacts/list/ |
H A D | ContactListItemViewTest.java | 67 Cursor cursor = createCursor("John Doe", "Doe John"); 70 view.showDisplayName(cursor, 0, ContactsContract.Preferences.DISPLAY_ORDER_PRIMARY); 76 Cursor cursor = createCursor("", ""); 80 view.showDisplayName(cursor, 0, ContactsContract.Preferences.DISPLAY_ORDER_PRIMARY); 86 Cursor cursor = createCursor("John Doe", "Doe John"); 90 view.showDisplayName(cursor, 0, ContactsContract.Preferences.DISPLAY_ORDER_PRIMARY); 98 Cursor cursor = createCursor("John Doe", "Doe John"); 102 view.showDisplayName(cursor, 0, ContactsContract.Preferences.DISPLAY_ORDER_ALTERNATIVE); 129 * Creates a cursor containing a pair of values. 131 * @param name the name to insert in the first column of the cursor [all...] |