diff options
Diffstat (limited to 'src/com/android/providers/contacts/CallLogDatabaseHelper.java')
-rw-r--r-- | src/com/android/providers/contacts/CallLogDatabaseHelper.java | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/com/android/providers/contacts/CallLogDatabaseHelper.java b/src/com/android/providers/contacts/CallLogDatabaseHelper.java index 67c548a6..c88b742d 100644 --- a/src/com/android/providers/contacts/CallLogDatabaseHelper.java +++ b/src/com/android/providers/contacts/CallLogDatabaseHelper.java @@ -37,7 +37,7 @@ import com.android.providers.contacts.util.PropertyUtils; public class CallLogDatabaseHelper { private static final String TAG = "CallLogDatabaseHelper"; - private static final int DATABASE_VERSION = 3; + private static final int DATABASE_VERSION = 4; private static final boolean DEBUG = false; // DON'T SUBMIT WITH TRUE @@ -151,7 +151,11 @@ public class CallLogDatabaseHelper { Voicemails.TRANSCRIPTION + " TEXT," + Voicemails.STATE + " INTEGER," + Voicemails.DIRTY + " INTEGER NOT NULL DEFAULT 0," + - Voicemails.DELETED + " INTEGER NOT NULL DEFAULT 0" + + Voicemails.DELETED + " INTEGER NOT NULL DEFAULT 0," + + Voicemails.BACKED_UP + " INTEGER NOT NULL DEFAULT 0," + + Voicemails.RESTORED + " INTEGER NOT NULL DEFAULT 0," + + Voicemails.ARCHIVED + " INTEGER NOT NULL DEFAULT 0," + + Voicemails.IS_OMTP_VOICEMAIL + " INTEGER NOT NULL DEFAULT 0" + ");"); db.execSQL("CREATE TABLE " + Tables.VOICEMAIL_STATUS + " (" + @@ -185,6 +189,10 @@ public class CallLogDatabaseHelper { if (oldVersion < 3) { upgradeToVersion3(db); } + + if (oldVersion < 4) { + upgradeToVersion4(db); + } } } @@ -243,6 +251,17 @@ public class CallLogDatabaseHelper { } /** + * Add {@link Voicemails.BACKED_UP} {@link Voicemails.ARCHIVE} {@link + * Voicemails.IS_OMTP_VOICEMAIL} column to the CallLog database. + */ + private void upgradeToVersion4(SQLiteDatabase db) { + db.execSQL("ALTER TABLE calls ADD backed_up INTEGER NOT NULL DEFAULT 0"); + db.execSQL("ALTER TABLE calls ADD restored INTEGER NOT NULL DEFAULT 0"); + db.execSQL("ALTER TABLE calls ADD archived INTEGER NOT NULL DEFAULT 0"); + db.execSQL("ALTER TABLE calls ADD is_omtp_voicemail INTEGER NOT NULL DEFAULT 0"); + } + + /** * Perform the migration from the contacts2.db (of the latest version) to the current calllog/ * voicemail status tables. */ |