Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3836c9a4 authored by Jim Miller's avatar Jim Miller
Browse files

Fix getStorageEncryptionStatus() in DevicePolicyManager

This fixes a bug introduced by a change where the function
ignores systems with default encryption where it's disabled.

The fix also checks to see if vold thinks the device is secure.

Fixes bug 17881324

Change-Id: I2c40f76cf990d90d1a825955aa3b080b21684426
parent c7be69f1
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3390,7 +3390,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
    private int getEncryptionStatus() {
        String status = SystemProperties.get("ro.crypto.state", "unsupported");
        if ("encrypted".equalsIgnoreCase(status)) {
            return DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE;
            return LockPatternUtils.isDeviceEncrypted()
                    ? DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE
                    : DevicePolicyManager.ENCRYPTION_STATUS_INACTIVE;
        } else if ("unencrypted".equalsIgnoreCase(status)) {
            return DevicePolicyManager.ENCRYPTION_STATUS_INACTIVE;
        } else {