Keystore 2.0 legacy Keystore: Cleanup when app/user removed.

Without this patch apps may leave the legacy keystore in an undefined
state when uninstalled and when the UID is reused the new app would find
stale entries in the legacy keystore.

There is no public API to use legacy keystore, but malicious apps could
use this to leave identifying information across installs.

Ignore-AOSP-First: No mergepath from AOSP.
Bug: 192575371
Test: legacykeystore_test
Change-Id: I06e8a4927af66092140ec84e7f5d83621cbb0b62
6 files changed