| WHAT We should expose a function that allows the end developer to check if the devices file system is encrypted HOW We can use the Android DevicePolicyManager class to check if the devices file system is encrypted
public void detectDeviceEncryptionStatus() { |
if (Build.VERSION.SDK_INT >= 11) { |
totalTests++; |
final DevicePolicyManager policyManager = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE); |
if (policyManager != null) { |
int isEncrypted = policyManager.getStorageEncryptionStatus(); |
if (isEncrypted != DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE) { |
setDetected(deviceEncrypted, R.string.device_encrypted_negative); |
} |
} |
} |
}
|
|