Updates to follow DPM api changes
* Use getStorageEncryptionStatus() to check device status * Also, check granted policy on USES_ENCRYPTED_STORAGE Bug: 3346641 Change-Id: I9e9a45a6d1d3cf4714e27b69cdb5952c841c640d
This commit is contained in:
parent
c50b6f685b
commit
c2e638351c
|
@ -224,7 +224,7 @@ public class SecurityPolicy {
|
|||
// encryption (which requires low-level systems support). Other policies are fully
|
||||
// supported by the framework and do not need to be checked.
|
||||
if (policies.mRequireEncryption) {
|
||||
int encryptionStatus = getDPM().getStorageEncryption(null);
|
||||
int encryptionStatus = getDPM().getStorageEncryptionStatus();
|
||||
if (encryptionStatus == DevicePolicyManager.ENCRYPTION_STATUS_UNSUPPORTED) {
|
||||
return false;
|
||||
}
|
||||
|
@ -342,7 +342,7 @@ public class SecurityPolicy {
|
|||
}
|
||||
}
|
||||
if (policies.mRequireEncryption) {
|
||||
int encryptionStatus = getDPM().getStorageEncryption(null);
|
||||
int encryptionStatus = getDPM().getStorageEncryptionStatus();
|
||||
if (encryptionStatus != DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE) {
|
||||
reasons |= INACTIVE_NEED_ENCRYPTION;
|
||||
}
|
||||
|
@ -796,8 +796,9 @@ public class SecurityPolicy {
|
|||
*/
|
||||
public boolean isActiveAdmin() {
|
||||
DevicePolicyManager dpm = getDPM();
|
||||
return dpm.isAdminActive(mAdminName) &&
|
||||
dpm.hasGrantedPolicy(mAdminName, DeviceAdminInfo.USES_POLICY_EXPIRE_PASSWORD);
|
||||
return dpm.isAdminActive(mAdminName)
|
||||
&& dpm.hasGrantedPolicy(mAdminName, DeviceAdminInfo.USES_POLICY_EXPIRE_PASSWORD)
|
||||
&& dpm.hasGrantedPolicy(mAdminName, DeviceAdminInfo.USES_ENCRYPTED_STORAGE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue