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

Commit e53f69bb authored by “Ayush's avatar “Ayush
Browse files

Restrict getPasswordMinimumMetrics to system callers

Bug: 173502924
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Change-Id: Ifbe991c29d88054f4fed2f0e0b156a909eac8241
parent c277ec25
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -4567,7 +4567,9 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
    public PasswordMetrics getPasswordMinimumMetrics(@UserIdInt int userHandle,
    public PasswordMetrics getPasswordMinimumMetrics(@UserIdInt int userHandle,
            boolean deviceWideOnly) {
            boolean deviceWideOnly) {
        final CallerIdentity caller = getCallerIdentity();
        final CallerIdentity caller = getCallerIdentity();
        Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle));
        Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle)
                && (isSystemUid(caller) || hasCallingOrSelfPermission(
                permission.SET_INITIAL_LOCK)));
        return getPasswordMinimumMetricsUnchecked(userHandle, deviceWideOnly);
        return getPasswordMinimumMetricsUnchecked(userHandle, deviceWideOnly);
    }
    }