Keystore 2.0: Add database versioning.

This patch adds database versioning.

When a KeystoreDB connection is opened, the database file is queried for
its version. If the version is lower than current version expected by
keystore2, upgrade function are executed until the target version is
reached and the database version is updated.

Ignore-AOSP-First: No automerge path from AOSP.
Test: keystore2_test (Note the test is added in this CL but not included
      in keystore2_test yet. This will happen in the next CL.)
Bug: 187862706
Bug: 189470584
Change-Id: Ia75633942dbb8f168e781579e1c9a755c84671af
Merged-In: Ia75633942dbb8f168e781579e1c9a755c84671af
1 file changed