Re-add Room 2.0.0 DatabaseConfiguration constructor.
During Room 2.1.0 alphas we have been updating the constructor without
keeping the old one which can cause compatibility issues with stable
versions, therefore this CL adds back the constructor as it ws in
Room 2.0.0 with an @Deprecated mark to keep compatibility.
Test: ./gradlew bOS
Change-Id: If46bb0610da298a22638e0da5218bbd68caf7281
diff --git a/room/runtime/api/restricted_2.1.0-alpha07.txt b/room/runtime/api/restricted_2.1.0-alpha07.txt
index a792dc1..8eb8691 100644
--- a/room/runtime/api/restricted_2.1.0-alpha07.txt
+++ b/room/runtime/api/restricted_2.1.0-alpha07.txt
@@ -2,6 +2,7 @@
package androidx.room {
public class DatabaseConfiguration {
+ ctor @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public DatabaseConfiguration(android.content.Context, String?, androidx.sqlite.db.SupportSQLiteOpenHelper.Factory, androidx.room.RoomDatabase.MigrationContainer, java.util.List<androidx.room.RoomDatabase.Callback>?, boolean, androidx.room.RoomDatabase.JournalMode!, java.util.concurrent.Executor, boolean, java.util.Set<java.lang.Integer>?);
ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public DatabaseConfiguration(android.content.Context, String?, androidx.sqlite.db.SupportSQLiteOpenHelper.Factory, androidx.room.RoomDatabase.MigrationContainer, java.util.List<androidx.room.RoomDatabase.Callback>?, boolean, androidx.room.RoomDatabase.JournalMode!, java.util.concurrent.Executor, java.util.concurrent.Executor, boolean, boolean, boolean, java.util.Set<java.lang.Integer>?);
}
diff --git a/room/runtime/api/restricted_current.txt b/room/runtime/api/restricted_current.txt
index a792dc1..8eb8691 100644
--- a/room/runtime/api/restricted_current.txt
+++ b/room/runtime/api/restricted_current.txt
@@ -2,6 +2,7 @@
package androidx.room {
public class DatabaseConfiguration {
+ ctor @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public DatabaseConfiguration(android.content.Context, String?, androidx.sqlite.db.SupportSQLiteOpenHelper.Factory, androidx.room.RoomDatabase.MigrationContainer, java.util.List<androidx.room.RoomDatabase.Callback>?, boolean, androidx.room.RoomDatabase.JournalMode!, java.util.concurrent.Executor, boolean, java.util.Set<java.lang.Integer>?);
ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public DatabaseConfiguration(android.content.Context, String?, androidx.sqlite.db.SupportSQLiteOpenHelper.Factory, androidx.room.RoomDatabase.MigrationContainer, java.util.List<androidx.room.RoomDatabase.Callback>?, boolean, androidx.room.RoomDatabase.JournalMode!, java.util.concurrent.Executor, java.util.concurrent.Executor, boolean, boolean, boolean, java.util.Set<java.lang.Integer>?);
}
diff --git a/room/runtime/src/main/java/androidx/room/DatabaseConfiguration.java b/room/runtime/src/main/java/androidx/room/DatabaseConfiguration.java
index dae3a09..c49f3d3 100644
--- a/room/runtime/src/main/java/androidx/room/DatabaseConfiguration.java
+++ b/room/runtime/src/main/java/androidx/room/DatabaseConfiguration.java
@@ -105,6 +105,10 @@
/**
* Creates a database configuration with the given values.
*
+ * @deprecated Use {@link #DatabaseConfiguration(Context, String,
+ * SupportSQLiteOpenHelper.Factory, RoomDatabase.MigrationContainer, List, boolean,
+ * RoomDatabase.JournalMode, Executor, Executor, boolean, boolean, boolean, Set)}
+ *
* @param context The application context.
* @param name Name of the database, can be null if it is in memory.
* @param sqliteOpenHelperFactory The open helper factory to use.
@@ -115,6 +119,41 @@
* @param queryExecutor The Executor used to execute asynchronous queries.
* @param requireMigration True if Room should require a valid migration if version changes,
* instead of recreating the tables.
+ * @param migrationNotRequiredFrom The collection of schema versions from which migrations
+ * aren't required.
+ *
+ * @hide
+ */
+ @Deprecated
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ public DatabaseConfiguration(@NonNull Context context, @Nullable String name,
+ @NonNull SupportSQLiteOpenHelper.Factory sqliteOpenHelperFactory,
+ @NonNull RoomDatabase.MigrationContainer migrationContainer,
+ @Nullable List<androidx.room.RoomDatabase.Callback> callbacks,
+ boolean allowMainThreadQueries,
+ RoomDatabase.JournalMode journalMode,
+ @NonNull Executor queryExecutor,
+ boolean requireMigration,
+ @Nullable Set<Integer> migrationNotRequiredFrom) {
+ this(context, name, sqliteOpenHelperFactory, migrationContainer, callbacks,
+ allowMainThreadQueries, journalMode, queryExecutor, queryExecutor, false,
+ requireMigration, false, migrationNotRequiredFrom);
+ }
+
+ /**
+ * Creates a database configuration with the given values.
+ *
+ * @param context The application context.
+ * @param name Name of the database, can be null if it is in memory.
+ * @param sqliteOpenHelperFactory The open helper factory to use.
+ * @param migrationContainer The migration container for migrations.
+ * @param callbacks The list of callbacks for database events.
+ * @param allowMainThreadQueries Whether to allow main thread reads/writes or not.
+ * @param journalMode The journal mode. This has to be either TRUNCATE or WRITE_AHEAD_LOGGING.
+ * @param queryExecutor The Executor used to execute asynchronous queries.
+ * @param transactionExecutor The Executor used to execute asynchronous transactions.
+ * @param multiInstanceInvalidation True if Room should perform multi-instance invalidation.
+ * @param requireMigration True if Room should require a valid migration if version changes,
* @param allowDestructiveMigrationOnDowngrade True if Room should recreate tables if no
* migration is supplied during a downgrade.
* @param migrationNotRequiredFrom The collection of schema versions from which migrations