From 14a8b1f326087e2ea4156dbb7c7823c95409ee74 Mon Sep 17 00:00:00 2001 From: yusukes Date: Mon, 23 Jul 2018 17:34:42 -0700 Subject: [PATCH] Do not call into vold when the device is not block encrypted Previously the function checked if the device used FBE and returned early when it did. This CL changes the function to check if the devices uses block encryption and return early when it does not. This is just to make the check more straightforward, and shouldn't change existing devices' behavior. Bug: 111653208 Test: manual Change-Id: If61cb48ab2650d8d4c53d02622d550e190b5eb15 (cherry picked from commit 909d4c3510a9073bc332c0ce225c4b14a7fd2b38) --- .../java/com/android/server/StorageManagerService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java index 2a806447d6051..9f8eeb3a067c8 100644 --- a/services/core/java/com/android/server/StorageManagerService.java +++ b/services/core/java/com/android/server/StorageManagerService.java @@ -2624,8 +2624,8 @@ class StorageManagerService extends IStorageManager.Stub mContext.enforceCallingOrSelfPermission(Manifest.permission.CRYPT_KEEPER, "no permission to access the crypt keeper"); - if (StorageManager.isFileEncryptedNativeOnly()) { - // Not supported on FBE devices + if (!StorageManager.isBlockEncrypted()) { + // Only supported on FDE devices return; } @@ -2648,8 +2648,8 @@ class StorageManagerService extends IStorageManager.Stub mContext.enforceCallingOrSelfPermission(Manifest.permission.CRYPT_KEEPER, "no permission to access the crypt keeper"); - if (StorageManager.isFileEncryptedNativeOnly()) { - // Not supported on FBE devices + if (!StorageManager.isBlockEncrypted()) { + // Only supported on FDE devices return null; }