Merge "Remove unused isProfileActivePasswordSufficientForParent()" into sc-dev
This commit is contained in:
@@ -4572,27 +4572,6 @@ public class DevicePolicyManager {
|
|||||||
return true;
|
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
|
* 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.
|
* requirement, once the user's profile has switched to unified challenge.
|
||||||
|
|||||||
@@ -88,7 +88,6 @@ interface IDevicePolicyManager {
|
|||||||
|
|
||||||
boolean isActivePasswordSufficient(int userHandle, boolean parent);
|
boolean isActivePasswordSufficient(int userHandle, boolean parent);
|
||||||
boolean isActivePasswordSufficientForDeviceRequirement();
|
boolean isActivePasswordSufficientForDeviceRequirement();
|
||||||
boolean isProfileActivePasswordSufficientForParent(int userHandle);
|
|
||||||
boolean isPasswordSufficientAfterProfileUnification(int userHandle, int profileUser);
|
boolean isPasswordSufficientAfterProfileUnification(int userHandle, int profileUser);
|
||||||
int getPasswordComplexity(boolean parent);
|
int getPasswordComplexity(boolean parent);
|
||||||
void setRequiredPasswordComplexity(int passwordComplexity, boolean parent);
|
void setRequiredPasswordComplexity(int passwordComplexity, boolean parent);
|
||||||
|
|||||||
@@ -854,16 +854,6 @@ public class LockPatternUtils {
|
|||||||
&& getDevicePolicyManager().isSeparateProfileChallengeAllowed(userHandle);
|
&& 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) {
|
private boolean hasSeparateChallenge(int userHandle) {
|
||||||
try {
|
try {
|
||||||
return getLockSettings().getSeparateProfileChallengeEnabled(userHandle);
|
return getLockSettings().getSeparateProfileChallengeEnabled(userHandle);
|
||||||
|
|||||||
@@ -4546,30 +4546,6 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
|
|||||||
return !isSeparateProfileChallengeEnabled(caller.getUserId());
|
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
|
@Override
|
||||||
public boolean isPasswordSufficientAfterProfileUnification(int userHandle, int profileUser) {
|
public boolean isPasswordSufficientAfterProfileUnification(int userHandle, int profileUser) {
|
||||||
if (!mHasFeature) {
|
if (!mHasFeature) {
|
||||||
|
|||||||
Reference in New Issue
Block a user