Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android ICS Device Encryption

i'm trying to trigger the encryption of my ICS device programmatically by launching an intent (Intent --> DevicePolicyManager.ACTION_START_ENCRYPTION). This works quite well. I would like to know whether there is sent an broadcast or sth like that to recognize if the user clicked on "encrypt device" or declined the request. I need to notice the users decision.

My second question concerns the method setStorageEncryption(admin, boolean), which is implemented within the DevicePolicyManager. Does a call of setStorageEncryption(admin, false) has any impacts on the device encryption, if I afterwards launch the Encryption intent which is mentioned above?

Kind regards

like image 706
user1168876 Avatar asked Nov 04 '22 18:11

user1168876


1 Answers

The intent DevicePolicyManager.ACTION_START_ENCRYPTION sends the user to Settings -> Security -> Encrypt Phone dialogue, where the user must confirm the action twice. Also the device need to have at least 80% battery and be connected to a charging cable.

If the user declines this action or he is prohibited if e.g. charging cable is not inserted, no broadcast is sent.

As CommonsWare correctly mentions, your application can regularly check the encryption status using DevicePolicyManager.getStorageEncryptionStatus().

Calling DevicePolicyManager.setStorageEncryption(admin, false) sets the minimum policy for that admin to not encrypted. Other admins can however have stronger policies.

Setting a not encrypted policy doesn't decrypt the device if it is already encrypted. Also it does not prevent the user to manually encrypt the device using Settings -> Security -> Encrypt Phone. The intent DevicePolicyManager.ACTION_START_ENCRYPTION is also not blocked in this case.

like image 193
Marek Pola Avatar answered Nov 11 '22 11:11

Marek Pola