Merge "Deleting lock screen clears all CA approvals" into nyc-dev
am: c0440e5f4d
* commit 'c0440e5f4dfa695d2347c68bbec787d3e16847eb':
Deleting lock screen clears all CA approvals
Change-Id: I692e07ace66056c2469a9c217fedfe96b4290b7d
This commit is contained in:
@@ -4218,6 +4218,23 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
||||
}
|
||||
}
|
||||
|
||||
private void removeCaApprovalsIfNeeded(int userId) {
|
||||
for (UserInfo userInfo : mUserManager.getProfiles(userId)) {
|
||||
boolean isSecure = mLockPatternUtils.isSecure(userInfo.id);
|
||||
if (userInfo.isManagedProfile()){
|
||||
isSecure |= mLockPatternUtils.isSecure(getProfileParentId(userInfo.id));
|
||||
}
|
||||
if (!isSecure) {
|
||||
synchronized (this) {
|
||||
getUserData(userInfo.id).mAcceptedCaCertificates.clear();
|
||||
saveSettingsLocked(userInfo.id);
|
||||
}
|
||||
|
||||
new MonitoringCertNotificationTask().execute(userInfo.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean installCaCert(ComponentName admin, byte[] certBuffer) throws RemoteException {
|
||||
enforceCanManageCaCerts(admin);
|
||||
@@ -4644,6 +4661,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
||||
DeviceAdminReceiver.ACTION_PASSWORD_CHANGED,
|
||||
DeviceAdminInfo.USES_POLICY_LIMIT_PASSWORD, userHandle);
|
||||
}
|
||||
removeCaApprovalsIfNeeded(userHandle);
|
||||
} finally {
|
||||
mInjector.binderRestoreCallingIdentity(ident);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user