Mark profile password key as critical.

Currently it is erased when keystore for user 0 is cleared, e.g.
when the user clears data for Settings app.

Bug: 35929605
Bug: 64467610
Test: Manually cleared Settings data.
Test: Manually cleared credentials from Settings.
Change-Id: I7e8753a1bf53f5d68d4738a4eb84faa890f026cc
Merged-In: I7e8753a1bf53f5d68d4738a4eb84faa890f026cc
This commit is contained in:
Pavel Grafov
2017-08-08 16:53:32 +01:00
parent de0c539dd4
commit e195b94be6

View File

@@ -1235,6 +1235,7 @@ public class LockSettingsService extends ILockSettings.Stub {
.setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE)
.setUserAuthenticationRequired(true)
.setUserAuthenticationValidityDurationSeconds(30)
.setCriticalToDeviceEncryption(true)
.build());
// Key imported, obtain a reference to it.
SecretKey keyStoreEncryptionKey = (SecretKey) keyStore.getKey(