Merge "Fix for TestDirectBootEmulated testcase" into android11-tests-dev
This commit is contained in:
@@ -3294,6 +3294,12 @@ class StorageManagerService extends IStorageManager.Stub
|
|||||||
enforcePermission(android.Manifest.permission.STORAGE_INTERNAL);
|
enforcePermission(android.Manifest.permission.STORAGE_INTERNAL);
|
||||||
|
|
||||||
if (isFsEncrypted) {
|
if (isFsEncrypted) {
|
||||||
|
// When a user has secure lock screen, require secret to actually unlock.
|
||||||
|
// This check is mostly in place for emulation mode.
|
||||||
|
if (StorageManager.isFileEncryptedEmulatedOnly() &&
|
||||||
|
mLockPatternUtils.isSecure(userId) && ArrayUtils.isEmpty(secret)) {
|
||||||
|
throw new IllegalStateException("Secret required to unlock secure user " + userId);
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
mVold.unlockUserKey(userId, serialNumber, encodeBytes(token),
|
mVold.unlockUserKey(userId, serialNumber, encodeBytes(token),
|
||||||
encodeBytes(secret));
|
encodeBytes(secret));
|
||||||
|
|||||||
Reference in New Issue
Block a user