Searched refs:cursor (Results 1 - 25 of 346) sorted by relevance

1234567891011>>

/packages/providers/ContactsProvider/src/com/android/providers/contacts/util/
H A DCloseUtils.java27 /** 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 DSuggestionPosition.java30 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 DCursorBackedSuggestionExtras.java27 * 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 DSyncCalendarTest.java74 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 DStreamItemPhotoEntry.java48 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 DDataStatus.java46 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 DNotifyingAsyncQueryHandler.java40 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();
H A DStreamItemEntry.java83 public StreamItemEntry(Cursor cursor) { argument
84 // This is expected to be populated via a cursor containing all StreamItems columns in
86 mId = getLong(cursor, StreamItems._ID);
87 mText = getString(cursor, StreamItems.TEXT);
88 mComments = getString(cursor, StreamItems.COMMENTS);
89 mTimestamp = getLong(cursor, StreamItems.TIMESTAMP);
90 mAccountType = getString(cursor, StreamItems.ACCOUNT_TYPE);
91 mAccountName = getString(cursor, StreamItems.ACCOUNT_NAME);
92 mDataSet = getString(cursor, StreamItems.DATA_SET);
93 mResPackage = getString(cursor, StreamItem
186 getString(Cursor cursor, String columnName) argument
190 getLong(Cursor cursor, String columnName) argument
[all...]
/packages/experimental/LoaderApp/src/com/android/loaderapp/util/
H A DDataStatus.java44 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 DAbstractPublicApiTest.java48 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 DImageList.java41 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 DContactDirectoryManagerTest.java89 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 DPartnerBookmarksProviderTest.java40 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/Contacts/src/com/android/contacts/list/
H A DLegacyContactListAdapter.java28 * 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 DLegacyPhoneNumberListAdapter.java30 * 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 DLegacyPostalAddressListAdapter.java30 * 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 DContactListAdapter.java34 * 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/apps/Gallery2/src/com/android/gallery3d/data/
H A DLocalVideo.java75 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
130 updateFromCursor(Cursor cursor) argument
[all...]
H A DLocalImage.java85 public LocalImage(Path path, GalleryApp application, Cursor cursor) { argument
88 loadFromCursor(cursor);
96 Cursor cursor = LocalAlbum.getItemCursor(resolver, uri, PROJECTION, id);
97 if (cursor == null) {
98 throw new RuntimeException("cannot get cursor for: " + path);
101 if (cursor.moveToNext()) {
102 loadFromCursor(cursor);
107 cursor.close();
111 private void loadFromCursor(Cursor cursor) { argument
112 id = cursor
127 updateFromCursor(Cursor cursor) argument
[all...]
/packages/apps/Mms/src/com/android/mms/util/
H A DRecycler.java80 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 DApplicationsAdapter.java40 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/providers/DownloadProvider/src/com/android/providers/downloads/
H A DDownloadReceiver.java95 Cursor cursor = context.getContentResolver().query(uri, null, null, null, null);
96 if (cursor == null) {
100 if (!cursor.moveToFirst()) {
105 openDownload(context, cursor);
106 hideNotification(context, uri, cursor);
108 sendNotificationClickedIntent(intent, cursor);
110 hideNotification(context, uri, cursor);
113 cursor.close();
120 * @param cursor Cursor for reading the download's fields
122 private void hideNotification(Context context, Uri uri, Cursor cursor) { argument
143 openDownload(Context context, Cursor cursor) argument
169 sendNotificationClickedIntent(Intent intent, Cursor cursor) argument
[all...]
/packages/apps/Contacts/src/com/android/contacts/
H A DCallDetailActivityQueryHandler.java66 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 DWidgetDatabaseHelper.java73 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 DContactListItemViewTest.java64 Cursor cursor = createCursor("John Doe", "Doe John");
67 view.showDisplayName(cursor, 0, ContactsContract.Preferences.DISPLAY_ORDER_PRIMARY);
73 Cursor cursor = createCursor("", "");
77 view.showDisplayName(cursor, 0, ContactsContract.Preferences.DISPLAY_ORDER_PRIMARY);
83 Cursor cursor = createCursor("John Doe", "Doe John");
87 view.showDisplayName(cursor, 0, ContactsContract.Preferences.DISPLAY_ORDER_PRIMARY);
94 Cursor cursor = createCursor("John Doe", "Doe John");
98 view.showDisplayName(cursor, 0, ContactsContract.Preferences.DISPLAY_ORDER_ALTERNATIVE);
121 * Creates a cursor containing a pair of values.
123 * @param name the name to insert in the first column of the cursor
[all...]

Completed in 974 milliseconds

1234567891011>>