Merge "Remove unused isProfileActivePasswordSufficientForParent()" into sc-dev am: c4ac63a881
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14467997 Change-Id: I76d2bceea23b8d56381e062ffeda142eea6817d9
This commit is contained in:
@@ -4572,27 +4572,6 @@ public class DevicePolicyManager {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the current profile password the user has set is sufficient
|
||||
* to meet the policy requirements (e.g. quality, minimum length) that have been
|
||||
* requested by the admins of the parent user and its profiles.
|
||||
*
|
||||
* @param userHandle the userId of the profile to check the password for.
|
||||
* @return Returns true if the password would meet the current requirements, else false.
|
||||
* @throws SecurityException if {@code userHandle} is not a managed profile.
|
||||
* @hide
|
||||
*/
|
||||
public boolean isProfileActivePasswordSufficientForParent(int userHandle) {
|
||||
if (mService != null) {
|
||||
try {
|
||||
return mService.isProfileActivePasswordSufficientForParent(userHandle);
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the given user's credential will be sufficient for all password policy
|
||||
* requirement, once the user's profile has switched to unified challenge.
|
||||
|
||||
@@ -88,7 +88,6 @@ interface IDevicePolicyManager {
|
||||
|
||||
boolean isActivePasswordSufficient(int userHandle, boolean parent);
|
||||
boolean isActivePasswordSufficientForDeviceRequirement();
|
||||
boolean isProfileActivePasswordSufficientForParent(int userHandle);
|
||||
boolean isPasswordSufficientAfterProfileUnification(int userHandle, int profileUser);
|
||||
int getPasswordComplexity(boolean parent);
|
||||
void setRequiredPasswordComplexity(int passwordComplexity, boolean parent);
|
||||
|
||||
@@ -854,16 +854,6 @@ public class LockPatternUtils {
|
||||
&& getDevicePolicyManager().isSeparateProfileChallengeAllowed(userHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves whether the current profile and device locks can be unified.
|
||||
* @param userHandle profile user handle.
|
||||
*/
|
||||
public boolean isSeparateProfileChallengeAllowedToUnify(int userHandle) {
|
||||
return getDevicePolicyManager().isProfileActivePasswordSufficientForParent(userHandle)
|
||||
&& !getUserManager().hasUserRestriction(
|
||||
UserManager.DISALLOW_UNIFIED_PASSWORD, UserHandle.of(userHandle));
|
||||
}
|
||||
|
||||
private boolean hasSeparateChallenge(int userHandle) {
|
||||
try {
|
||||
return getLockSettings().getSeparateProfileChallengeEnabled(userHandle);
|
||||
|
||||
@@ -4546,30 +4546,6 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
|
||||
return !isSeparateProfileChallengeEnabled(caller.getUserId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isProfileActivePasswordSufficientForParent(int userHandle) {
|
||||
if (!mHasFeature) {
|
||||
return true;
|
||||
}
|
||||
Preconditions.checkArgumentNonnegative(userHandle, "Invalid userId");
|
||||
|
||||
final CallerIdentity caller = getCallerIdentity();
|
||||
Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle));
|
||||
Preconditions.checkCallAuthorization(isManagedProfile(userHandle),
|
||||
"can not call APIs refering to the parent profile outside a managed profile, "
|
||||
+ "userId = %d", userHandle);
|
||||
|
||||
synchronized (getLockObject()) {
|
||||
final int targetUser = getProfileParentId(userHandle);
|
||||
enforceUserUnlocked(targetUser, false);
|
||||
int credentialOwner = getCredentialOwner(userHandle, false);
|
||||
DevicePolicyData policy = getUserDataUnchecked(credentialOwner);
|
||||
PasswordMetrics metrics = mLockSettingsInternal.getUserPasswordMetrics(credentialOwner);
|
||||
return isActivePasswordSufficientForUserLocked(
|
||||
policy.mPasswordValidAtLastCheckpoint, metrics, targetUser);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPasswordSufficientAfterProfileUnification(int userHandle, int profileUser) {
|
||||
if (!mHasFeature) {
|
||||
|
||||
Reference in New Issue
Block a user