Merge "Fix for TestDirectBootEmulated testcase" am: 0bd1e20da8 am: e69cdcc689
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1559104 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Iac803ff44f99afdca3481bd0d17f62c815dca3aa
This commit is contained in:
@@ -3297,6 +3297,12 @@ class StorageManagerService extends IStorageManager.Stub
|
||||
enforcePermission(android.Manifest.permission.STORAGE_INTERNAL);
|
||||
|
||||
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 {
|
||||
mVold.unlockUserKey(userId, serialNumber, encodeBytes(token),
|
||||
encodeBytes(secret));
|
||||
|
||||
Reference in New Issue
Block a user