From 3836c9a4c145cd683151bd627a22958303a418c2 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Wed, 15 Oct 2014 11:46:26 -0700 Subject: 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 --- .../com/android/server/devicepolicy/DevicePolicyManagerService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index af4ae44..fc5c053 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -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 { -- cgit v1.1