OSDN Git Service

Up the version of the database
authorRobert Berry <robertberry@google.com>
Thu, 1 Feb 2018 12:49:31 +0000 (12:49 +0000)
committerRobert Berry <robertberry@google.com>
Thu, 1 Feb 2018 12:49:31 +0000 (12:49 +0000)
We should have done this every time the schema changed, and written
appropriate upgrade SQL. Unfortunately there are now devices in the
wild that initially created the database using older SQL. As such
they are missing columns. This causes them to crash when queries are
run against the DB expecting those columns to exist. As we didn't
up the version number, flashing a new build didn't cause the CREATE
SQL to run again.

Test: manual
Change-Id: I1daa263d9baa69af4abb4bebfe45586b1f9dfd0e

services/core/java/com/android/server/locksettings/recoverablekeystore/storage/RecoverableKeyStoreDbHelper.java

index d96671c..79fd496 100644 (file)
@@ -28,7 +28,7 @@ import com.android.server.locksettings.recoverablekeystore.storage.RecoverableKe
  * Helper for creating the recoverable key database.
  */
 class RecoverableKeyStoreDbHelper extends SQLiteOpenHelper {
-    private static final int DATABASE_VERSION = 1;
+    private static final int DATABASE_VERSION = 2;
     private static final String DATABASE_NAME = "recoverablekeystore.db";
 
     private static final String SQL_CREATE_KEYS_ENTRY =