Home
last modified time | relevance | path

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

12

/packages/apps/Launcher3/robolectric_tests/src/com/android/launcher3/model/
DGridBackupTableTest.java43 private SQLiteDatabase mDb; field in GridBackupTableTest
49 mDb = mModelHelper.provider.getDb(); in setUp()
61 assertEquals(BACKUP_ITEM_COUNT, queryNumEntries(mDb, TABLE_NAME)); in setupGridData()
66 GridBackupTable backupTable = new GridBackupTable(mContext, mDb, 4, 4, 4); in backupTableCreated()
70 assertTrue(tableExists(mDb, BACKUP_TABLE_NAME)); in backupTableCreated()
73 assertEquals(BACKUP_ITEM_COUNT + 1, queryNumEntries(mDb, BACKUP_TABLE_NAME)); in backupTableCreated()
78 assertFalse(new GridBackupTable(mContext, mDb, 4, 4, 4).backupOrRestoreAsNeeded()); in backupTableRestored()
82 mDb.delete(TABLE_NAME, null, null); in backupTableRestored()
83 assertEquals(0, queryNumEntries(mDb, TABLE_NAME)); in backupTableRestored()
85 GridBackupTable backupTable = new GridBackupTable(mContext, mDb, 3, 3, 3); in backupTableRestored()
[all …]
DBackupRestoreTest.java71 private SQLiteDatabase mDb; field in BackupRestoreTest
80 mDb = mModelHelper.provider.getDb(); in setUp()
101 assertTrue(tableExists(mDb, BACKUP_TABLE_NAME)); in testOnCreateDbIfNotExists_CreatesBackup()
130 new GridBackupTable(RuntimeEnvironment.application, mDb, mIdp.numDatabaseHotseatIcons, in setupBackup()
138 assertEquals(0, getCount(mDb, "SELECT * FROM " + tableName)); in verifyTableIsEmpty()
142 assertEquals(sanitized ? 12 : 13, getCount(mDb, in verifyTableIsFilled()
145 assertEquals(10, getCount(mDb, "SELECT * FROM " + tableName + " WHERE profileId = " in verifyTableIsFilled()
151 dropTable(mDb, TABLE_NAME); in createTableUsingOldProfileId()
152 addTableToDb(mDb, MY_OLD_PROFILE_ID, false); in createTableUsingOldProfileId()
DGridSizeMigrationTaskTest.java41 private SQLiteDatabase mDb; field in GridSizeMigrationTaskTest
50 mDb = mModelHelper.provider.getDb(); in setUp()
68 new GridSizeMigrationTask(mContext, mDb, mValidPackages, false, 5, 3) in testHotseatMigration_apps_dropped()
85 new GridSizeMigrationTask(mContext, mDb, mValidPackages, false, 5, 3) in testHotseatMigration_shortcuts_dropped()
130 new GridSizeMigrationTask(mContext, mDb, mValidPackages, false, in testWorkspace_empty_row_column_removed()
150 new GridSizeMigrationTask(mContext, mDb, mValidPackages, false, in testWorkspace_new_screen_created()
175 new GridSizeMigrationTask(mContext, mDb, mValidPackages, false, in testWorkspace_items_merged_in_next_screen()
207 new GridSizeMigrationTask(mContext, mDb, mValidPackages, false, in testWorkspace_items_not_merged_in_next_screen()
238 new GridSizeMigrationTask(mContext, mDb, mValidPackages, false, in testWorkspace_first_row_blocked()
265 new GridSizeMigrationTask(mContext, mDb, mValidPackages, false, in testWorkspace_items_moved_to_empty_first_row()
[all …]
DGridSizeMigrationTaskV2Test.java57 private SQLiteDatabase mDb; field in GridSizeMigrationTaskV2Test
77 mDb = mModelHelper.provider.getDb(); in setUp()
96 dropTable(mDb, LauncherSettings.Favorites.TMP_TABLE); in setUp()
97 LauncherSettings.Favorites.addTableToDb(mDb, userSerial, false, in setUp()
126 GridSizeMigrationTaskV2.DbReader srcReader = new GridSizeMigrationTaskV2.DbReader(mDb, in testMigration()
129 GridSizeMigrationTaskV2.DbReader destReader = new GridSizeMigrationTaskV2.DbReader(mDb, in testMigration()
132 GridSizeMigrationTaskV2 task = new GridSizeMigrationTaskV2(mContext, mDb, srcReader, in testMigration()
206 GridSizeMigrationTaskV2.DbReader srcReader = new GridSizeMigrationTaskV2.DbReader(mDb, in migrateToLargerHotseat()
209 GridSizeMigrationTaskV2.DbReader destReader = new GridSizeMigrationTaskV2.DbReader(mDb, in migrateToLargerHotseat()
212 GridSizeMigrationTaskV2 task = new GridSizeMigrationTaskV2(mContext, mDb, srcReader, in migrateToLargerHotseat()
[all …]
/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.java517 mDb = null; in shutdown()
540 mDb = mDbHelper.getWritableDatabase(); in initialize()
686 mDb.beginTransaction(); in doProcessEventRawTimes()
692 mDb.setTransactionSuccessful(); in doProcessEventRawTimes()
694 mDb.endTransaction(); in doProcessEventRawTimes()
699 Cursor cursor = mDb.rawQuery(SQL_SELECT_EVENTSRAWTIMES, null /* selection args */); in updateEventsStartEndFromEventRawTimesLocked()
750 int result = mDb.update(Tables.EVENTS, values, SQL_WHERE_ID, in updateEventsStartEndLocked()
1265 mDb = mDbHelper.getWritableDatabase(); in handleInstanceQuery()
1294 return qb.query(mDb, projection, selection, selectionArgs, null /* groupBy */, in handleInstanceQuery()
1428 mDb = mDbHelper.getWritableDatabase(); in handleInstanceSearchQuery()
[all …]
/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.java89 mHelper.onConfigure(mDb); in setUp()
104 mHelper.onCreate(mDb); in testDatabaseCreate()
109 create1108(mDb); in testDatabaseUpgrade_UpgradeToCurrent()
121 create1108(mDb); in testDatabaseUpgrade_Incremental()
132 mHelper.onUpgrade(mDb, upgradeFrom, MY_VERSION); in upgradeTo1109()
133 TableStructure calls = new TableStructure(mDb, "calls"); in upgradeTo1109()
136 TableStructure voicemailStatus = new TableStructure(mDb, "voicemail_status"); in upgradeTo1109()
146 executeSqlFromAssetFile(getTestContext(), mDb, "upgradeTest/pre_upgrade1201.sql"); in upgradeTo1201() local
148 mHelper.onUpgrade(mDb, upgradeFrom, MY_VERSION); in upgradeTo1201()
150 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/modules/NetworkStack/src/com/android/server/connectivity/ipmemorystore/
DIpMemoryStoreService.java79 final SQLiteDatabase mDb; field in IpMemoryStoreService
110 mDb = db; in IpMemoryStoreService()
140 if (mDb != null) mDb.close(); in shutdown()
228 if (null == mDb) return ERROR_DATABASE_CANNOT_BE_OPENED; in storeNetworkAttributesAndBlobSync()
230 final long oldExpiry = IpMemoryStoreDatabase.getExpiry(mDb, l2Key); in storeNetworkAttributesAndBlobSync()
234 IpMemoryStoreDatabase.storeNetworkAttributes(mDb, l2Key, newExpiry, attributes); in storeNetworkAttributesAndBlobSync()
238 return IpMemoryStoreDatabase.storeBlob(mDb, l2Key, clientId, name, data); in storeNetworkAttributesAndBlobSync()
275 if (null == mDb) { in findL2Key()
279 final String key = IpMemoryStoreDatabase.findClosestAttributes(mDb, in findL2Key()
307 if (null == mDb) { in isSameNetwork()
[all …]
/packages/apps/Launcher3/src/com/android/launcher3/model/
DGridBackupTable.java64 private final SQLiteDatabase mDb; field in GridBackupTable
80 mDb = db; in GridBackupTable()
93 if (!tableExists(mDb, BACKUP_TABLE_NAME)) { in backupOrRestoreAsNeeded()
107 if (!tableExists(mDb, BACKUP_TABLE_NAME)) { in restoreToPreviewIfBackupExists()
120 copyTable(mDb, BACKUP_TABLE_NAME, toTableName, userSerial); in restoreIfBackupExists()
136 copyTable(mDb, Favorites.TABLE_NAME, tableName, profileId); in createCustomBackupTable()
146 if (!tableExists(mDb, tableName)) { in restoreFromCustomBackupTable()
151 copyTable(mDb, tableName, Favorites.TABLE_NAME, userSerial); in restoreFromCustomBackupTable()
153 dropTable(mDb, tableName); in restoreFromCustomBackupTable()
168 values.put(KEY_DB_VERSION, mDb.getVersion()); in encodeDBProperties()
[all …]
DGridSizeMigrationTaskV2.java73 private final SQLiteDatabase mDb; field in GridSizeMigrationTaskV2
90 mDb = db; in GridSizeMigrationTaskV2()
219 HotseatPlacementSolution hotseatSolution = new HotseatPlacementSolution(mDb, mSrcReader, in migrate()
231 GridPlacementSolution workspaceSolution = new GridPlacementSolution(mDb, mSrcReader, in migrate()
241 GridPlacementSolution workspaceSolution = new GridPlacementSolution(mDb, mSrcReader, in migrate()
354 private final SQLiteDatabase mDb; field in GridSizeMigrationTaskV2.GridPlacementSolution
369 mDb = db; in GridPlacementSolution()
397 insertEntryInDb(mDb, mContext, entry, mSrcReader.mTableName, in find()
437 private final SQLiteDatabase mDb; field in GridSizeMigrationTaskV2.HotseatPlacementSolution
447 mDb = db; in HotseatPlacementSolution()
[all …]
DGridSizeMigrationTask.java66 protected final SQLiteDatabase mDb; field in GridSizeMigrationTask
87 mDb = db; in GridSizeMigrationTask()
108 mDb = db;
130 mDb.update(mTableName, mUpdateOperations.valueAt(i),
138 mDb.delete(mTableName, Utilities.createDbSelectionQuery(Favorites._ID, mEntryToRemove),
202 IntArray allScreens = getWorkspaceScreenIds(mDb, mTableName);
797 return mDb.query(mTableName, columns, where, null, null, null, null);
1050 private final SQLiteDatabase mDb;
1057 mDb = db;
1094 return new GridSizeMigrationTask(mContext, mDb, mValidPackages, mUsePreviewTable,
/packages/providers/ContactsProvider/src/com/android/providers/contacts/
DDbModifierWithNotification.java68 private final SQLiteDatabase mDb; field in DbModifierWithNotification
97 mDb = db; in DbModifierWithNotification()
114 long rowId = mDb.insert(table, nullColumnHack, values); in insert()
215 int count = qb.update(mDb, values, whereClause, whereArgs); in update()
270 mDb.update(table, values, in updateLastModified()
303 count = qb.update(mDb, values, whereClause, whereArgs); in delete()
305 count = qb.delete(mDb, whereClause, whereArgs); in delete()
320 mDb.beginTransaction(); in startBulkOperation()
325 mDb.yieldIfContendedSafely(); in yieldBulkOperation()
330 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.java142 private final SQLiteDatabase mDb; field in LauncherDbUtils.SQLiteTransaction
145 mDb = db; in SQLiteTransaction()
150 mDb.setTransactionSuccessful(); in commit()
155 mDb.endTransaction(); in close()
159 return mDb; in getDb()
DLossyScreenMigrationTask.java83 mDb.update(Favorites.TABLE_NAME, tempValues, "_id = ?", in migrateScreen0()
94 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/widget/
DDatabaseWidgetPreviewLoader.java100 private final CacheDb mDb; field in DatabaseWidgetPreviewLoader
107 mDb = new CacheDb(context); in DatabaseWidgetPreviewLoader()
143 mDb.clear(); in refresh()
206 mDb.insertOrReplace(values); in writeToDb()
220 mDb.delete( in removePackage()
255 c = mDb.query( in removeObsoletePreviews()
311 cursor = mDb.query( in readFromDb()
/packages/apps/Launcher3/src/com/android/launcher3/
DAutoInstallsLayout.java177 protected SQLiteDatabase mDb; field in AutoInstallsLayout
208 mDb = db; in loadLayout()
308 if (mCallback.insertAndCheck(mDb, mValues) < 0) { in addShortcut()
544 int insertedId = mCallback.insertAndCheck(mDb, mValues); in verifyAndInsert()
598 int folderId = mCallback.insertAndCheck(mDb, mValues); in parseAndAdd()
640 mDb.delete(args.table, args.where, args.args); in parseAndAdd()
653 mDb.update(Favorites.TABLE_NAME, childValues, in parseAndAdd()
/packages/apps/Settings/tests/robotests/src/com/android/settings/slices/
DSliceBroadcastReceiverTest.java60 private SQLiteDatabase mDb; field in SliceBroadcastReceiverTest
68 mDb = SlicesDatabaseHelper.getInstance(mContext).getWritableDatabase(); in setUp()
325 mDb.replaceOrThrow(SlicesDatabaseHelper.Tables.TABLE_SLICES_INDEX, null, values); in insertSpecialCase()
/packages/providers/CalendarProvider/tests/src/com/android/providers/calendar/
DCalendarProvider2Test.java100 private SQLiteDatabase mDb; field in CalendarProvider2Test
1078 mDb = helper.getWritableDatabase(); in setUp()
1079 wipeAndInitData(helper, mDb); in setUp()
1085 mDb.close(); in tearDown()
1086 mDb = null; in tearDown()
1299 mDb.execSQL("UPDATE Events SET _sync_id=" + mGlobalSyncId + " WHERE _id=" + id); in insertEvent()
1469 mDb.execSQL("DELETE FROM Events;"); in deleteAllEvents()
2109 checkEvents(0, mDb, calendarIdString); in testCalendarAlerts()
2111 checkEvents(1, mDb, calendarIdString); in testCalendarAlerts()
2230 checkEvents(0, mDb, calendarIdString); in testAttendees()
[all …]
/packages/modules/NetworkStack/tests/unit/src/com/android/server/connectivity/ipmemorystore/
DIpMemoryStoreServiceTest.java425 mService.mDb,
433 mService.mDb, "fakeKey" + i, TEST_CLIENT_ID, TEST_DATA_NAME,

12