Searched refs:oldDb (Results 1 – 5 of 5) sorted by relevance
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/data/shared/ |
D | SharedDbHelper.java | 106 SQLiteDatabase oldDb = mDbHelper.safeGetWritableDatabase(); in onCreate() local 109 if (hasAllTables(oldDb, EnrollmentTables.ENROLLMENT_TABLES)) { in onCreate() 113 migrateEnrollmentTables(db, oldDb); in onCreate() 122 private void migrateEnrollmentTables(SQLiteDatabase db, SQLiteDatabase oldDb) { in migrateEnrollmentTables() argument 128 migrateOldDataToNewDatabase(oldDb, db, EnrollmentTables.ENROLLMENT_TABLES); in migrateEnrollmentTables() 226 SQLiteDatabase oldDb, SQLiteDatabase db, String[] tables) { in migrateOldDataToNewDatabase() argument 229 Arrays.stream(tables).forEachOrdered((table) -> copyOrMigrateTable(oldDb, db, table)); in migrateOldDataToNewDatabase() 232 private void copyOrMigrateTable(SQLiteDatabase oldDb, SQLiteDatabase newDb, String table) { in copyOrMigrateTable() argument 238 migrateEnrollmentTable(oldDb, newDb, table); in copyOrMigrateTable() 241 copyTable(oldDb, newDb, table); in copyOrMigrateTable() [all …]
|
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/data/shared/ |
D | SharedDbHelperTest.java | 139 SQLiteDatabase oldDb = dbHelper.safeGetWritableDatabase(); in testEnrollmentTableMigrationFromOldDatabase() local 141 assertEquals(ENROLLMENT_OLD_DB_FINAL_VERSION, oldDb.getVersion()); in testEnrollmentTableMigrationFromOldDatabase() 152 DbHelperTest.assertEnrollmentTableDoesNotExist(oldDb); in testEnrollmentTableMigrationFromOldDatabase() 164 SQLiteDatabase oldDb = dbHelper.safeGetWritableDatabase(); in testMigrationDataIntegrityToV1FromOldDatabase() local 166 assertEquals(ENROLLMENT_OLD_DB_FINAL_VERSION, oldDb.getVersion()); in testMigrationDataIntegrityToV1FromOldDatabase() 170 populateDb(oldDb, fakeData); in testMigrationDataIntegrityToV1FromOldDatabase() 175 DbHelperTest.assertEnrollmentTableDoesNotExist(oldDb); in testMigrationDataIntegrityToV1FromOldDatabase() 183 emptyTables(oldDb, EnrollmentTables.ENROLLMENT_TABLES); in testMigrationDataIntegrityToV1FromOldDatabase() 195 SQLiteDatabase oldDb = dbHelper.safeGetWritableDatabase(); in testMigrationExcludesDuplicatesSites() local 197 assertEquals(ENROLLMENT_OLD_DB_FINAL_VERSION, oldDb.getVersion()); in testMigrationExcludesDuplicatesSites() [all …]
|
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/data/measurement/ |
D | MeasurementDbHelper.java | 118 SQLiteDatabase oldDb = mDbHelper.safeGetWritableDatabase(); in onCreate() local 121 if (hasAllV6MeasurementTables(oldDb)) { in onCreate() 130 migrateOldDataToNewDatabase(oldDb, db); in onCreate() 131 deleteV6TablesFromDatabase(oldDb); in onCreate() 241 private void migrateOldDataToNewDatabase(SQLiteDatabase oldDb, SQLiteDatabase db) { in migrateOldDataToNewDatabase() argument 245 .forEachOrdered((table) -> copyTable(oldDb, db, table)); in migrateOldDataToNewDatabase() 248 private void copyTable(SQLiteDatabase oldDb, SQLiteDatabase newDb, String table) { in copyTable() argument 249 try (Cursor cursor = oldDb.query(table, null, null, null, null, null, null, null)) { in copyTable()
|
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/data/measurement/ |
D | MeasurementDbHelperTest.java | 90 SQLiteDatabase oldDb = dbHelper.safeGetWritableDatabase(); in testMigrationFromOldDatabase() local 92 assertEquals(MeasurementDbHelper.OLD_DATABASE_FINAL_VERSION, oldDb.getVersion()); in testMigrationFromOldDatabase() 108 DbTestUtil.assertMeasurementTablesDoNotExist(oldDb); in testMigrationFromOldDatabase() 121 SQLiteDatabase oldDb = dbHelper.safeGetWritableDatabase(); in testMigrationDataIntegrityToV6FromOldDatabase() local 123 assertEquals(MeasurementDbHelper.OLD_DATABASE_FINAL_VERSION, oldDb.getVersion()); in testMigrationDataIntegrityToV6FromOldDatabase() 128 populateDb(oldDb, fakeData); in testMigrationDataIntegrityToV6FromOldDatabase() 136 DbTestUtil.assertMeasurementTablesDoNotExist(oldDb); in testMigrationDataIntegrityToV6FromOldDatabase()
|
/packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/ |
D | CellBroadcastDatabaseHelper.java | 182 File oldDb = mContext.getDatabasePath(OLD_DATABASE_NAME); in tryToMigrateV13() local 184 if (!oldDb.exists()) { in tryToMigrateV13() 191 if (!newDb.exists() || oldDb.lastModified() > newDb.lastModified()) { in tryToMigrateV13() 196 copy(oldDb.toPath(), newDb.toPath()); in tryToMigrateV13()
|