Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e8705e62 authored by Rubin Xu's avatar Rubin Xu
Browse files

Metrics logging for DPM.isActivePasswordSufficientForDeviceRequirement

Bug: 169832516
Test: builds
Change-Id: I841dafe0106aebf1fa26bfae76bbdea3e55d99fb
parent 5eab037b
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -4267,7 +4267,9 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        final int parentUser = getProfileParentId(profileUserId);
        enforceUserUnlocked(parentUser);
        final boolean isSufficient;
        synchronized (getLockObject()) {
            int complexity = getAggregatedPasswordComplexityLocked(parentUser, true);
            PasswordMetrics minMetrics = getPasswordMinimumMetricsUnchecked(parentUser, true);
@@ -4275,8 +4277,13 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
            final List<PasswordValidationError> passwordValidationErrors =
                    PasswordMetrics.validatePasswordMetrics(
                            minMetrics, complexity, false, metrics);
            return passwordValidationErrors.isEmpty();
            isSufficient = passwordValidationErrors.isEmpty();
        }
        DevicePolicyEventLogger
                .createEvent(DevicePolicyEnums.IS_ACTIVE_PASSWORD_SUFFICIENT_FOR_DEVICE)
                .setStrings(mOwners.getProfileOwnerComponent(caller.getUserId()).getPackageName())
                .write();
        return isSufficient;
    }
    @Override