Fix: SQLiteException caused by column 'duration_type'

This change introduces a check if a legacy column name 'duration_type'
in the legacy table 'calls' exists before migrating table rows to the
new table.

The 'calls' table in the contacts provider shipped in Android 5 included
the 'duration_type' column coming from a change from Codeaurora.  This
column has not been in use after Android 5.

The 'calls' table is moved to a different database in Android 7.  During
migration of rows from the legacy table, an SQLiteException may be
thrown if values for unknown column 'duration_type' are inserted into
the new table.  This change prevents this particular exception by
removing the values before insertion into the new table.

Dropping the column when upgrading the database is not an option because
the migration step happens earlier in the boot process.

Issue: FP2N-195
Change-Id: Ic7fed5cc2d7f966b73e76d24f32f8a4bfe3c7951
1 file changed