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 401bf8a176)
Merged-In: Ib5bcfb6a0279150fec33f2c3edd0431b450c90f4
This commit is contained in:
@@ -83,7 +83,6 @@ import android.os.UserHandle;
|
|||||||
import android.provider.DeviceConfig;
|
import android.provider.DeviceConfig;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.sysprop.VoldProperties;
|
|
||||||
import android.system.ErrnoException;
|
import android.system.ErrnoException;
|
||||||
import android.system.Os;
|
import android.system.Os;
|
||||||
import android.system.OsConstants;
|
import android.system.OsConstants;
|
||||||
@@ -1739,11 +1738,8 @@ public class StorageManager {
|
|||||||
* false not encrypted or file encrypted
|
* false not encrypted or file encrypted
|
||||||
*/
|
*/
|
||||||
public static boolean isBlockEncrypted() {
|
public static boolean isBlockEncrypted() {
|
||||||
if (!isEncrypted()) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return RoSystemProperties.CRYPTO_BLOCK_ENCRYPTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@hide}
|
/** {@hide}
|
||||||
* Is this device block encrypted with credentials?
|
* Is this device block encrypted with credentials?
|
||||||
@@ -1752,20 +1748,9 @@ public class StorageManager {
|
|||||||
* false not encrypted, file encrypted or default block encrypted
|
* false not encrypted, file encrypted or default block encrypted
|
||||||
*/
|
*/
|
||||||
public static boolean isNonDefaultBlockEncrypted() {
|
public static boolean isNonDefaultBlockEncrypted() {
|
||||||
if (!isBlockEncrypted()) {
|
|
||||||
return false;
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@hide}
|
/** {@hide}
|
||||||
* Is this device in the process of being block encrypted?
|
* Is this device in the process of being block encrypted?
|
||||||
* @return true for encrypting.
|
* @return true for encrypting.
|
||||||
@@ -1777,8 +1762,7 @@ public class StorageManager {
|
|||||||
* framework, so no service needs to check for changes during their lifespan
|
* framework, so no service needs to check for changes during their lifespan
|
||||||
*/
|
*/
|
||||||
public static boolean isBlockEncrypting() {
|
public static boolean isBlockEncrypting() {
|
||||||
final String state = VoldProperties.encrypt_progress().orElse("");
|
return false;
|
||||||
return !"".equalsIgnoreCase(state);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@hide}
|
/** {@hide}
|
||||||
@@ -1793,8 +1777,7 @@ public class StorageManager {
|
|||||||
* framework, so no service needs to check for changes during their lifespan
|
* framework, so no service needs to check for changes during their lifespan
|
||||||
*/
|
*/
|
||||||
public static boolean inCryptKeeperBounce() {
|
public static boolean inCryptKeeperBounce() {
|
||||||
final String status = VoldProperties.decrypt().orElse("");
|
return false;
|
||||||
return "trigger_restart_min_framework".equals(status);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@hide} */
|
/** {@hide} */
|
||||||
|
|||||||
Reference in New Issue
Block a user