KeyChain: Add grants for existing keys on upgrade

When the KeyChain database is created or upgraded, create entries in the
grants table for keys that already exist in KeyStore.

This fixes a bug where keys that were installed in KeyStore but never
used (in O) are accessible in newer releases.

Change-Id: Ic4935c80f37d77a3c83fea172f30fb42623b3ff6
Merged-In: Ic4935c80f37d77a3c83fea172f30fb42623b3ff6
Bug: 120039077
Test: m -j RunKeyChainRoboTests
Test: Manual, flashed a sailfish device with O, installed a key, upgraded to P, made sure it's user-selectable.
4 files changed
tree: 4511cc6a3cff7d17ded73551fc7a9ebaf626a676
  1. res/
  2. robotests/
  3. src/
  4. support/
  5. tests/
  6. Android.mk
  7. AndroidManifest.xml