Home
last modified time | relevance | path

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

/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/
DContactsDatabaseHelperTest.java50 private SQLiteDatabase mDb; field in ContactsDatabaseHelperTest
56 mDb = mDbHelper.getWritableDatabase(); in setUp()
147 assertEquals(-1, ContactsDatabaseHelper.queryIdWithOneArg(mDb, query, "value1")); in testQueryIdWithOneArg_insertWithOneArgAndReturnId()
148 assertEquals(-1, ContactsDatabaseHelper.queryIdWithOneArg(mDb, query, "value2")); in testQueryIdWithOneArg_insertWithOneArgAndReturnId()
151 final long id1 = ContactsDatabaseHelper.insertWithOneArgAndReturnId(mDb, insert, "value1"); in testQueryIdWithOneArg_insertWithOneArgAndReturnId()
154 assertEquals(id1, ContactsDatabaseHelper.queryIdWithOneArg(mDb, query, "value1")); in testQueryIdWithOneArg_insertWithOneArgAndReturnId()
155 assertEquals(-1, ContactsDatabaseHelper.queryIdWithOneArg(mDb, query, "value2")); in testQueryIdWithOneArg_insertWithOneArgAndReturnId()
159 final long id2 = ContactsDatabaseHelper.insertWithOneArgAndReturnId(mDb, insert, "value2"); in testQueryIdWithOneArg_insertWithOneArgAndReturnId()
162 assertEquals(id1, ContactsDatabaseHelper.queryIdWithOneArg(mDb, query, "value1")); in testQueryIdWithOneArg_insertWithOneArgAndReturnId()
163 assertEquals(id2, ContactsDatabaseHelper.queryIdWithOneArg(mDb, query, "value2")); in testQueryIdWithOneArg_insertWithOneArgAndReturnId()
[all …]
DPhotoStoreTest.java46 private SQLiteDatabase mDb; field in PhotoStoreTest
59 mDb = mProvider.getDatabaseHelper().getReadableDatabase(); in setUp()
142 Cursor c = mDb.query(Tables.PHOTO_FILES, in runStorageTestForResource()
163 Cursor c = mDb.query(Tables.PHOTO_FILES, in runStorageTestForResourceWithCrop()
187 Cursor c = mDb.query(Tables.PHOTO_FILES, new String[]{PhotoFiles._ID}, in testRemoveEntry()
233 Cursor c = mDb.query(Tables.PHOTO_FILES, new String[]{PhotoFiles._ID}, in testCleanup()
DContactsDatabaseHelperUpgradeTest.java94 mHelper.onConfigure(mDb); in setUp()
109 mHelper.onCreate(mDb); in testDatabaseCreate()
114 create1108(mDb); in testDatabaseUpgrade_UpgradeToCurrent()
126 create1108(mDb); in testDatabaseUpgrade_Incremental()
137 mHelper.onUpgrade(mDb, upgradeFrom, MY_VERSION); in upgradeTo1109()
138 TableStructure calls = new TableStructure(mDb, "calls"); in upgradeTo1109()
141 TableStructure voicemailStatus = new TableStructure(mDb, "voicemail_status"); in upgradeTo1109()
151 executeSqlFromAssetFile(getTestContext(), mDb, "upgradeTest/pre_upgrade1201.sql"); in upgradeTo1201() local
153 mHelper.onUpgrade(mDb, upgradeFrom, MY_VERSION); in upgradeTo1201()
155 try (Cursor c = mDb.rawQuery("select * from contacts order by _id", null)) { in upgradeTo1201()
[all …]
DBaseDatabaseHelperUpgradeTest.java38 protected SQLiteDatabase mDb; field in BaseDatabaseHelperUpgradeTest
173 mDb = SQLiteDatabase.create(null); in setUp()
176 mDb = SQLiteDatabase.openOrCreateDatabase(filename, null); in setUp()
182 mDb.close(); in tearDown()
195 TableStructure structure = new TableStructure(mDb, entry.name); in assertDatabaseStructureSameAsList()
/packages/providers/CalendarProvider/src/com/android/providers/calendar/
DSQLiteContentProvider.java46 protected SQLiteDatabase mDb; field in SQLiteContentProvider
96 mDb = mOpenHelper.getWritableDatabase(); in insert()
97 mDb.beginTransactionWithListener(this); in insert()
104 mDb.setTransactionSuccessful(); in insert()
107 mDb.endTransaction(); in insert()
124 mDb = mOpenHelper.getWritableDatabase(); in bulkInsert()
125 mDb.beginTransactionWithListener(this); in bulkInsert()
133 mDb.yieldIfContendedSafely(); in bulkInsert()
135 mDb.setTransactionSuccessful(); in bulkInsert()
138 mDb.endTransaction(); in bulkInsert()
[all …]
DCalendarProvider2.java505 mDb = null; in shutdown()
528 mDb = mDbHelper.getWritableDatabase(); in initialize()
673 mDb.beginTransaction(); in doProcessEventRawTimes()
679 mDb.setTransactionSuccessful(); in doProcessEventRawTimes()
681 mDb.endTransaction(); in doProcessEventRawTimes()
686 Cursor cursor = mDb.rawQuery(SQL_SELECT_EVENTSRAWTIMES, null /* selection args */); in updateEventsStartEndFromEventRawTimesLocked()
737 int result = mDb.update(Tables.EVENTS, values, SQL_WHERE_ID, in updateEventsStartEndLocked()
1245 mDb = mDbHelper.getWritableDatabase(); in handleInstanceQuery()
1274 return qb.query(mDb, projection, selection, selectionArgs, null /* groupBy */, in handleInstanceQuery()
1408 mDb = mDbHelper.getWritableDatabase(); in handleInstanceSearchQuery()
[all …]
/packages/apps/Launcher3/robolectric_tests/src/com/android/launcher3/model/
DGridBackupTableTest.java41 assertEquals(BACKUP_ITEM_COUNT, queryNumEntries(mDb, TABLE_NAME)); in setupGridData()
46 GridBackupTable backupTable = new GridBackupTable(mContext, mDb, 4, 4, 4); in backupTableCreated()
50 assertTrue(tableExists(mDb, BACKUP_TABLE_NAME)); in backupTableCreated()
53 assertEquals(BACKUP_ITEM_COUNT + 1, queryNumEntries(mDb, BACKUP_TABLE_NAME)); in backupTableCreated()
58 assertFalse(new GridBackupTable(mContext, mDb, 4, 4, 4).backupOrRestoreAsNeeded()); in backupTableRestored()
62 mDb.delete(TABLE_NAME, null, null); in backupTableRestored()
63 assertEquals(0, queryNumEntries(mDb, TABLE_NAME)); in backupTableRestored()
65 GridBackupTable backupTable = new GridBackupTable(mContext, mDb, 3, 3, 3); in backupTableRestored()
69 assertEquals(BACKUP_ITEM_COUNT, queryNumEntries(mDb, TABLE_NAME)); in backupTableRestored()
79 assertFalse(new GridBackupTable(mContext, mDb, 4, 4, 4).backupOrRestoreAsNeeded()); in backupTableRemovedOnAdd()
[all …]
DGridSizeMigrationTaskTest.java57 new GridSizeMigrationTask(mContext, mDb, mValidPackages, 5, 3) in testHotseatMigration_apps_dropped()
74 new GridSizeMigrationTask(mContext, mDb, mValidPackages, 5, 3) in testHotseatMigration_shortcuts_dropped()
119 new GridSizeMigrationTask(mContext, mDb, mValidPackages, in testWorkspace_empty_row_column_removed()
139 new GridSizeMigrationTask(mContext, mDb, mValidPackages, in testWorkspace_new_screen_created()
164 new GridSizeMigrationTask(mContext, mDb, mValidPackages, in testWorkspace_items_merged_in_next_screen()
196 new GridSizeMigrationTask(mContext, mDb, mValidPackages, in testWorkspace_items_not_merged_in_next_screen()
227 new GridSizeMigrationTask(mContext, mDb, mValidPackages, in testWorkspace_first_row_blocked()
254 new GridSizeMigrationTask(mContext, mDb, mValidPackages, in testWorkspace_items_moved_to_empty_first_row()
274 IntArray allScreens = getWorkspaceScreenIds(mDb); in verifyWorkspace()
DBaseGridChangesTestCase.java32 public SQLiteDatabase mDb; field in BaseGridChangesTestCase
41 mDb = mProvider.getDb(); in setUpBaseCase()
/packages/modules/NetworkStack/src/com/android/server/connectivity/ipmemorystore/
DIpMemoryStoreService.java77 final SQLiteDatabase mDb; field in IpMemoryStoreService
108 mDb = db; in IpMemoryStoreService()
134 if (mDb != null) mDb.close(); in shutdown()
222 if (null == mDb) return ERROR_DATABASE_CANNOT_BE_OPENED; in storeNetworkAttributesAndBlobSync()
224 final long oldExpiry = IpMemoryStoreDatabase.getExpiry(mDb, l2Key); in storeNetworkAttributesAndBlobSync()
228 IpMemoryStoreDatabase.storeNetworkAttributes(mDb, l2Key, newExpiry, attributes); in storeNetworkAttributesAndBlobSync()
232 return IpMemoryStoreDatabase.storeBlob(mDb, l2Key, clientId, name, data); in storeNetworkAttributesAndBlobSync()
269 if (null == mDb) { in findL2Key()
273 final String key = IpMemoryStoreDatabase.findClosestAttributes(mDb, in findL2Key()
301 if (null == mDb) { in isSameNetwork()
[all …]
/packages/apps/Launcher3/src/com/android/launcher3/model/
DGridBackupTable.java49 private final SQLiteDatabase mDb; field in GridBackupTable
62 mDb = db; in GridBackupTable()
71 if (!tableExists(mDb, BACKUP_TABLE_NAME)) { in backupOrRestoreAsNeeded()
99 dropTable(mDb, to); in copyTable()
100 Favorites.addTableToDb(mDb, userSerial, false, to); in copyTable()
101 mDb.execSQL("INSERT INTO " + to + " SELECT * FROM " + from + " where _id > " + ID_PROPERTY); in copyTable()
107 values.put(KEY_DB_VERSION, mDb.getVersion()); in encodeDBProperties()
111 mDb.insert(BACKUP_TABLE_NAME, null, values); in encodeDBProperties()
115 try (Cursor c = mDb.query(BACKUP_TABLE_NAME, new String[] { in loadDbProperties()
125 if (mDb.getVersion() != c.getInt(0)) { in loadDbProperties()
DGridSizeMigrationTask.java64 protected final SQLiteDatabase mDb; field in GridSizeMigrationTask
83 mDb = db; in GridSizeMigrationTask()
102 mDb = db;
123 mDb.update(Favorites.TABLE_NAME, mUpdateOperations.valueAt(i),
131 mDb.delete(Favorites.TABLE_NAME, Utilities.createDbSelectionQuery(
195 IntArray allScreens = getWorkspaceScreenIds(mDb);
789 return mDb.query(Favorites.TABLE_NAME, columns, where, null, null, null, null);
1011 private final SQLiteDatabase mDb;
1017 mDb = db;
1053 return new GridSizeMigrationTask(mContext, mDb,
/packages/providers/ContactsProvider/src/com/android/providers/contacts/
DDbModifierWithNotification.java67 private final SQLiteDatabase mDb; field in DbModifierWithNotification
90 mDb = db; in DbModifierWithNotification()
106 long rowId = mDb.insert(table, nullColumnHack, values); in insert()
199 int count = mDb.update(table, values, whereClause, whereArgs); in update()
253 mDb.update(table, values, in updateLastModified()
277 count = mDb.update(table, values, whereClause, whereArgs); in delete()
279 count = mDb.delete(table, whereClause, whereArgs); in delete()
294 mDb.beginTransaction(); in startBulkOperation()
299 mDb.yieldIfContendedSafely(); in yieldBulkOperation()
304 mDb.setTransactionSuccessful(); in finishBulkOperation()
[all …]
DPhotoStore.java63 private SQLiteDatabase mDb; field in PhotoStore
95 if (mDb == null) { in clear()
96 mDb = mDatabaseHelper.getWritableDatabase(); in clear()
98 mDb.delete(Tables.PHOTO_FILES, null, null); in clear()
135 mDb = mDatabaseHelper.getWritableDatabase(); in initialize()
209 long id = mDb.insert(Tables.PHOTO_FILES, null, values); in insert()
278 mDb.delete(ContactsDatabaseHelper.Tables.PHOTO_FILES, PhotoFilesColumns.CONCRETE_ID + "=?", in removeEntry()
/packages/apps/Launcher3/src/com/android/launcher3/provider/
DLauncherDbUtils.java123 private final SQLiteDatabase mDb; field in LauncherDbUtils.SQLiteTransaction
126 mDb = db; in SQLiteTransaction()
131 mDb.setTransactionSuccessful(); in commit()
136 mDb.endTransaction(); in close()
140 return mDb; in getDb()
DLossyScreenMigrationTask.java84 mDb.update(Favorites.TABLE_NAME, tempValues, "_id = ?", in migrateScreen0()
95 mDb.delete(Favorites.TABLE_NAME, in migrateScreen0()
/packages/apps/WallpaperPicker/src/com/android/wallpaperpicker/
DSavedWallpaperImages.java57 private final ImageDb mDb; field in SavedWallpaperImages
64 mDb = new ImageDb(context); in SavedWallpaperImages()
71 SQLiteDatabase db = mDb.getReadableDatabase(); in loadThumbnailsAndImageIdList()
99 SQLiteDatabase db = mDb.getWritableDatabase(); in deleteImage()
137 SQLiteDatabase db = mDb.getWritableDatabase(); in writeImage()
/packages/providers/ContactsProvider/src/com/android/providers/contacts/aggregation/util/
DCommonNicknameCache.java42 private final SQLiteDatabase mDb; field in CommonNicknameCache
45 mDb = db; in CommonNicknameCache()
72 Cursor cursor = mDb.query(NicknameLookupPreloadQuery.TABLE, in preloadNicknameBloomFilter()
138 Cursor cursor = mDb.query(NicknameLookupQuery.TABLE, NicknameLookupQuery.COLUMNS, in loadNicknameClusters()
/packages/apps/Launcher3/src/com/android/launcher3/
DWidgetPreviewLoader.java77 private final CacheDb mDb; field in WidgetPreviewLoader
86 mDb = new CacheDb(context); in WidgetPreviewLoader()
110 mDb.clear(); in refresh()
157 mDb.insertOrReplace(values); in writeToDb()
169 mDb.delete( in removePackage()
204 c = mDb.query( in removeObsoletePreviews()
260 cursor = mDb.query( in readFromDb()
DAutoInstallsLayout.java166 protected SQLiteDatabase mDb; field in AutoInstallsLayout
197 mDb = db; in loadLayout()
297 if (mCallback.insertAndCheck(mDb, mValues) < 0) { in addShortcut()
523 int insertedId = mCallback.insertAndCheck(mDb, mValues); in verifyAndInsert()
559 int folderId = mCallback.insertAndCheck(mDb, mValues); in parseAndAdd()
601 mDb.delete(args.table, args.where, args.args); in parseAndAdd()
614 mDb.update(Favorites.TABLE_NAME, childValues, in parseAndAdd()
DDefaultLayoutParser.java308 insertedId = mCallback.insertAndCheck(mDb, mValues); in verifyAndInsert()
/packages/apps/Settings/tests/robotests/src/com/android/settings/slices/
DSlicesDatabaseAccessorTest.java73 private SQLiteDatabase mDb; field in SlicesDatabaseAccessorTest
81 mDb = SlicesDatabaseHelper.getInstance(mContext).getWritableDatabase(); in setUp()
291 mDb.replaceOrThrow(SlicesDatabaseHelper.Tables.TABLE_SLICES_INDEX, null, values); in insertSpecialCase()
DSliceBroadcastReceiverTest.java68 private SQLiteDatabase mDb; field in SliceBroadcastReceiverTest
76 mDb = SlicesDatabaseHelper.getInstance(mContext).getWritableDatabase(); in setUp()
354 mDb.replaceOrThrow(SlicesDatabaseHelper.Tables.TABLE_SLICES_INDEX, null, values); in insertSpecialCase()
/packages/providers/CalendarProvider/tests/src/com/android/providers/calendar/
DCalendarProvider2Test.java99 private SQLiteDatabase mDb; field in CalendarProvider2Test
1059 mDb = helper.getWritableDatabase(); in setUp()
1060 wipeAndInitData(helper, mDb); in setUp()
1066 mDb.close(); in tearDown()
1067 mDb = null; in tearDown()
1280 mDb.execSQL("UPDATE Events SET _sync_id=" + mGlobalSyncId + " WHERE _id=" + id); in insertEvent()
1450 mDb.execSQL("DELETE FROM Events;"); in deleteAllEvents()
2090 checkEvents(0, mDb, calendarIdString); in testCalendarAlerts()
2092 checkEvents(1, mDb, calendarIdString); in testCalendarAlerts()
2211 checkEvents(0, mDb, calendarIdString); in testAttendees()
[all …]
/packages/modules/NetworkStack/tests/unit/src/com/android/server/connectivity/ipmemorystore/
DIpMemoryStoreServiceTest.java334 mService.mDb,
342 mService.mDb, "fakeKey" + i, TEST_CLIENT_ID, TEST_DATA_NAME,