From f4f345dbeee8d81479a2c74b51d28a3649ecf26c Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 26 Jan 2022 05:04:06 +0000 Subject: Stub out some FDE methods in StorageManager Now that FDE is no longer supported, stub out some methods in StorageManager that return FDE state. This allows StorageManager.getPasswordType() to be removed, and it prepares for removing these methods later. Bug: 208476087 Change-Id: Ib5bcfb6a0279150fec33f2c3edd0431b450c90f4 (cherry picked from commit 401bf8a176492297a695596c0df6aa3fb2a82d5e) Merged-In: Ib5bcfb6a0279150fec33f2c3edd0431b450c90f4 --- core/java/android/os/storage/StorageManager.java | 25 ++++-------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/core/java/android/os/storage/StorageManager.java b/core/java/android/os/storage/StorageManager.java index b501730f1eeb..312abf877f53 100644 --- a/core/java/android/os/storage/StorageManager.java +++ b/core/java/android/os/storage/StorageManager.java @@ -83,7 +83,6 @@ import android.os.UserHandle; import android.provider.DeviceConfig; import android.provider.MediaStore; import android.provider.Settings; -import android.sysprop.VoldProperties; import android.system.ErrnoException; import android.system.Os; import android.system.OsConstants; @@ -1739,10 +1738,7 @@ public class StorageManager { * false not encrypted or file encrypted */ public static boolean isBlockEncrypted() { - if (!isEncrypted()) { - return false; - } - return RoSystemProperties.CRYPTO_BLOCK_ENCRYPTED; + return false; } /** {@hide} @@ -1752,18 +1748,7 @@ public class StorageManager { * false not encrypted, file encrypted or default block encrypted */ public static boolean isNonDefaultBlockEncrypted() { - if (!isBlockEncrypted()) { - return false; - } - - try { - IStorageManager storageManager = IStorageManager.Stub.asInterface( - ServiceManager.getService("mount")); - return storageManager.getPasswordType() != CRYPT_TYPE_DEFAULT; - } catch (RemoteException e) { - Log.e(TAG, "Error getting encryption type"); - return false; - } + return false; } /** {@hide} @@ -1777,8 +1762,7 @@ public class StorageManager { * framework, so no service needs to check for changes during their lifespan */ public static boolean isBlockEncrypting() { - final String state = VoldProperties.encrypt_progress().orElse(""); - return !"".equalsIgnoreCase(state); + return false; } /** {@hide} @@ -1793,8 +1777,7 @@ public class StorageManager { * framework, so no service needs to check for changes during their lifespan */ public static boolean inCryptKeeperBounce() { - final String status = VoldProperties.decrypt().orElse(""); - return "trigger_restart_min_framework".equals(status); + return false; } /** {@hide} */ -- cgit v1.2.3-59-g8ed1b