Always ask vold to unlock user

In case of runtime restarts or userspace reboot, CE might be preserved
and user can be automatically unlocked.

Test: adb reboot userspace
Test: adb shell dumpsys activity
Test: check that user 0 in in state RUNNING_UNLOCKED
Test: adb shell 'kill -9 $(pidof system_server)'
Test: check that user 0 in in state RUNNING_UNLOCKED
Bug: 135984674
Change-Id: Ide280c67d6e9cc3141e3c3aae5ae8fa70252db4b
This commit is contained in:
Nikita Ioffe
2019-11-14 01:32:06 +00:00
parent 25ea00d059
commit d7083da341

View File

@@ -2803,12 +2803,6 @@ class StorageManagerService extends IStorageManager.Stub
enforcePermission(android.Manifest.permission.STORAGE_INTERNAL);
if (StorageManager.isFileEncryptedNativeOrEmulated()) {
// When a user has secure lock screen, require secret to actually unlock.
// This check is mostly in place for emulation mode.
if (mLockPatternUtils.isSecure(userId) && ArrayUtils.isEmpty(secret)) {
throw new IllegalStateException("Secret required to unlock secure user " + userId);
}
try {
mVold.unlockUserKey(userId, serialNumber, encodeBytes(token),
encodeBytes(secret));