keystore: Add multi-user support

Split the directories out per-user. Each Android user ID gets its own
directory and master key. This gives each user its own locked/unlocked
state.

Add migration code that converts existing keystores to this scheme. This
even migrates keys that used the non-public API, but only for the
primary user. The secondary users may have a different lock screen
pattern that would no longer work to unlock the master key.

(cherry picked from commit 655b958eb2180c7c06889f83f606d23421bf038c)

Bug: 7249554
Change-Id: Icfc117d9bc68bd88997ab03673fb77b581acf3f7
1 file changed
tree: f95012121d65f0d277c281a973ec18563c621063
  1. keystore/
  2. keystore-engine/
  3. softkeymaster/