Detect software if Android device can perform data encryption

I am developing an Android application that starts the process of encrypting data on a device.

I discovered the encryption status with this code:

int encrypted = 0; device_policy_manager = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { encrypted = device_policy_manager.getStorageEncryptionStatus(); Log.d("TAG", "encryption status : " + encrypted); } 

On some devices, the encryption process starts and fails. Typically, these devices do not have the "Encryption" option available in the "Settings"> "Security" menu (Android 3.x and Android 4.x).

Is there a way to detect programmatically if the device is capable of encrypting storage?

Thanks in adavance.

+5
source share
1 answer

Devices that do not support encryption should return ENCRYPTION_STATUS_UNSUPPORTED when calling getStorageEncryptionStatus () .

Hope this helps.

0
source

All Articles