Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 712509ed authored by Michael Bestas's avatar Michael Bestas
Browse files

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
parent 0679b110
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ public class DialerDatabaseHelper extends SQLiteOpenHelper {
   *   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 @@ public class DialerDatabaseHelper extends SQLiteOpenHelper {
      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 @@ public class DialerDatabaseHelper extends SQLiteOpenHelper {
      return;
    }

    if (oldVersion == 11) {
      oldVersion = 10;
    }

    if (oldVersion == 70011) {
      oldVersion = 10;
    }