From d7083da341a43e7ef4c3c56807616639d2ae9815 Mon Sep 17 00:00:00 2001 From: Nikita Ioffe Date: Thu, 14 Nov 2019 01:32:06 +0000 Subject: [PATCH] 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 --- .../core/java/com/android/server/StorageManagerService.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java index 96935851ba8a1..d1bc6af883472 100644 --- a/services/core/java/com/android/server/StorageManagerService.java +++ b/services/core/java/com/android/server/StorageManagerService.java @@ -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));