Home
last modified time | relevance | path

Searched refs:cursor (Results 1 – 25 of 197) sorted by relevance

12345678

/frameworks/base/core/tests/coretests/src/android/database/
DMatrixCursorTest.java28 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/
DTableHelper.java37 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 …]
DSQLiteDatabasePerfTest.java100 try (Cursor cursor = mDatabase.rawQuery("SELECT _ID, COL_A, COL_B, COL_C FROM T1 " in testSelect() argument
102 assertTrue(cursor.moveToNext()); in testSelect()
103 assertEquals(index, cursor.getInt(0)); in testSelect()
104 assertEquals(index, cursor.getInt(1)); in testSelect()
105 assertEquals("T1Value" + index, cursor.getString(2)); in testSelect()
106 assertEquals(1.1 * index, cursor.getDouble(3), 0.0000001d); in testSelect()
137 try (Cursor cursor = mDatabase.rawQuery( in testSelectCacheMissRate() argument
139 assertTrue(cursor.moveToNext()); in testSelectCacheMissRate()
165 try (Cursor cursor = mDatabase.rawQuery("SELECT _ID, COL_A, COL_B, COL_C FROM T1 "
169 while(cursor.moveToNext()) {
[all …]
/frameworks/ex/common/java/com/android/common/widget/
DCompositeCursorAdapter.java38 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/
DEabUtil.java49 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/
DCursorTreeAdapter.java63 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 …]
DSimpleCursorTreeAdapter.java102 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/
DCalendarContract.java587 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/
DGlobalResultsStore.java150 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/opt/telephony/src/java/com/android/internal/telephony/analytics/
DServiceStateAnalyticsProvider.java138 Cursor cursor = null; in insertDataToDb() local
140 cursor = in insertDataToDb()
150 updateIfEntryExistsOtherwiseInsert(cursor, values); in insertDataToDb()
154 if (cursor != null) { in insertDataToDb()
155 cursor.close(); in insertDataToDb()
160 private void updateIfEntryExistsOtherwiseInsert(Cursor cursor, ContentValues values) { in updateIfEntryExistsOtherwiseInsert() argument
161 if (cursor != null && cursor.moveToFirst()) { in updateIfEntryExistsOtherwiseInsert()
162 int idIndex = cursor.getColumnIndex(ServiceStateAnalyticsTable._ID); in updateIfEntryExistsOtherwiseInsert()
163 int timeDurationIndex = cursor.getColumnIndex(ServiceStateAnalyticsTable.TIME_DURATION); in updateIfEntryExistsOtherwiseInsert()
165 int id = cursor.getInt(idIndex); in updateIfEntryExistsOtherwiseInsert()
[all …]
/frameworks/libs/systemui/weathereffects/tests/src/com/google/android/wallpaper/weathereffects/provider/
DWeatherEffectsContentProviderTest.kt62 val cursor = weatherEffectsContentProvider.query( in query_updateWallpaper_returnsCorrectData() constant
70 assertThat(cursor.count).isEqualTo(1) in query_updateWallpaper_returnsCorrectData()
71 cursor.moveToFirst() in query_updateWallpaper_returnsCorrectData()
73 assertThat(cursor.getString( in query_updateWallpaper_returnsCorrectData()
74 cursor.getColumnIndex(WallpaperGenerationData.FOREGROUND_TEXTURE)) in query_updateWallpaper_returnsCorrectData()
76 assertThat(cursor.getString( in query_updateWallpaper_returnsCorrectData()
77 cursor.getColumnIndex(WallpaperGenerationData.BACKGROUND_TEXTURE)) in query_updateWallpaper_returnsCorrectData()
79 assertThat(cursor.getString( in query_updateWallpaper_returnsCorrectData()
80 cursor.getColumnIndex(WallpaperGenerationData.WEATHER_EFFECT)) in query_updateWallpaper_returnsCorrectData()
82 assertThat(cursor.columnNames).isEqualTo(WallpaperGenerationData.DEFAULT_PROJECTION) in query_updateWallpaper_returnsCorrectData()
[all …]
/frameworks/base/telephony/java/android/telephony/
DSmsCbMessage.java630 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/customization/src/com/android/systemui/shared/customization/data/content/
DCustomizationProviderClient.kt231 ?.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/
DDatabaseUtils.java449 public static void cursorFillWindow(final Cursor cursor, in cursorFillWindow() argument
451 if (position < 0 || position >= cursor.getCount()) { in cursorFillWindow()
454 final int oldPos = cursor.getPosition(); in cursorFillWindow()
455 final int numColumns = cursor.getColumnCount(); in cursorFillWindow()
459 if (cursor.moveToPosition(position)) { in cursorFillWindow()
465 final int type = cursor.getType(i); in cursorFillWindow()
473 success = window.putLong(cursor.getLong(i), position, i); in cursorFillWindow()
477 success = window.putDouble(cursor.getDouble(i), position, i); in cursorFillWindow()
481 final byte[] value = cursor.getBlob(i); in cursorFillWindow()
489 final String value = cursor.getString(i); in cursorFillWindow()
[all …]
/frameworks/base/services/core/java/com/android/server/notification/
DCalendarTracker.java99 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/
DPhotoPagerAdapter.java50 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/
DBaseEmailAddressAdapter.java174 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/
DRecoverableKeyStoreDb.java137 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/subscription/
DSubscriptionDatabaseManager.java2180 try (Cursor cursor = mContext.getContentResolver().query( in loadDatabaseInternal() argument
2187 while (cursor != null && cursor.moveToNext()) { in loadDatabaseInternal()
2188 SubscriptionInfoInternal subInfo = createSubscriptionInfoFromCursor(cursor); in loadDatabaseInternal()
2244 private SubscriptionInfoInternal createSubscriptionInfoFromCursor(@NonNull Cursor cursor) { in createSubscriptionInfoFromCursor() argument
2246 int id = cursor.getInt(cursor.getColumnIndexOrThrow( in createSubscriptionInfoFromCursor()
2249 .setIccId(TextUtils.emptyIfNull(cursor.getString(cursor.getColumnIndexOrThrow( in createSubscriptionInfoFromCursor()
2251 .setSimSlotIndex(cursor.getInt(cursor.getColumnIndexOrThrow( in createSubscriptionInfoFromCursor()
2253 .setDisplayName(TextUtils.emptyIfNull(cursor.getString(cursor.getColumnIndexOrThrow( in createSubscriptionInfoFromCursor()
2255 .setCarrierName(TextUtils.emptyIfNull(cursor.getString(cursor.getColumnIndexOrThrow( in createSubscriptionInfoFromCursor()
2257 .setDisplayNameSource(cursor.getInt(cursor.getColumnIndexOrThrow( in createSubscriptionInfoFromCursor()
[all …]
/frameworks/av/services/audiopolicy/permission/
DNativePermissionController.cpp75 const auto& cursor = package_map_.find(newPackageState.uid); in updatePackagesForUid() local
78 if (cursor != package_map_.end()) { in updatePackagesForUid()
79 package_map_.erase(cursor); in updatePackagesForUid()
82 if (cursor != package_map_.end()) { in updatePackagesForUid()
83 cursor->second = newPackageState.packageNames; in updatePackagesForUid()
97 auto& cursor = permission_map_[static_cast<size_t>(perm)]; in populatePermissionState() local
98 cursor = std::vector<uid_t>{uids.begin(), uids.end()}; in populatePermissionState()
100 std::sort(cursor.begin(), cursor.end()); in populatePermissionState()
120 const auto cursor = package_map_.find(uid); in getPackagesForUid() local
121 if (cursor != package_map_.end()) { in getPackagesForUid()
[all …]
/frameworks/base/tests/LocationTracker/src/com/android/locationtracker/data/
DTrackerEntry.java208 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 …]
/frameworks/opt/telephony/src/java/com/android/internal/telephony/
DCarrierResolver.java331 Cursor cursor = mContext.getContentResolver().query( in loadCarrierMatchingRulesOnMccMnc() local
337 if (cursor != null) { in loadCarrierMatchingRulesOnMccMnc()
339 logd("[loadCarrierMatchingRules]- " + cursor.getCount() in loadCarrierMatchingRulesOnMccMnc()
343 while (cursor.moveToNext()) { in loadCarrierMatchingRulesOnMccMnc()
344 mCarrierMatchingRulesOnMccMnc.add(makeCarrierMatchingRule(cursor)); in loadCarrierMatchingRulesOnMccMnc()
352 if (cursor != null) { in loadCarrierMatchingRulesOnMccMnc()
353 cursor.close(); in loadCarrierMatchingRulesOnMccMnc()
363 Cursor cursor = mContext.getContentResolver().query( in getCarrierNameFromId() local
369 if (cursor != null) { in getCarrierNameFromId()
371 logd("[getCarrierNameFromId]- " + cursor.getCount() in getCarrierNameFromId()
[all …]
/frameworks/base/services/people/java/com/android/server/people/data/
DContactsQueryHelper.java119 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 …]
/frameworks/base/core/tests/coretests/src/android/content/
DRedactingProvider.java36 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/services/core/java/com/android/server/accounts/
DAccountsDb.java350 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 …]

12345678