Dialer: Make the database compatible with AOSP dialer again.
dialer.db has been at version 10 since cm-14.1/Android N.
Change-Id Ib9369476fa660c44d946b0e41b0d23a34ff14e7c bumped the database
version, making it impossible to restore it on AOSP or any other 3rd
party OS using the AOSP dialer, even though they are still 100%
compatible. Since the bump was only done to delete an unused table,
let's remove that change and roll back the db version to restore
compatibility.
Change-Id: If0f5a1911d43aaa151811f07540bb560814ccb56
diff --git a/java/com/android/dialer/database/DialerDatabaseHelper.java b/java/com/android/dialer/database/DialerDatabaseHelper.java
index e0d92c8..0365ab9 100644
--- a/java/com/android/dialer/database/DialerDatabaseHelper.java
+++ b/java/com/android/dialer/database/DialerDatabaseHelper.java
@@ -67,7 +67,7 @@
* 0-98 KitKat
* </pre>
*/
- public static final int DATABASE_VERSION = 11;
+ public static final int DATABASE_VERSION = 10;
public static final String DATABASE_NAME = "dialer.db";
@@ -206,11 +206,6 @@
oldVersion = 10;
}
- if (oldVersion < 11) {
- db.execSQL("DROP TABLE IF EXISTS filtered_numbers_table");
- oldVersion = 11;
- }
-
if (oldVersion != DATABASE_VERSION) {
throw new IllegalStateException(
"error upgrading the database to version " + DATABASE_VERSION);
@@ -239,6 +234,10 @@
return;
}
+ if (oldVersion == 11) {
+ oldVersion = 10;
+ }
+
if (oldVersion == 70011) {
oldVersion = 10;
}