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
This commit is contained in:
Jim Miller
2014-10-15 11:46:26 -07:00
parent c7be69f1d6
commit 3836c9a4c1

View File

@@ -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 {