Do not set separate challenge flag before clearing lock
This step is redundant since clearLock() would set the flag internally anyway. In fact setting the flag before calling clearLock() is wrong since it will lead LockSettingsService.setLockCredential() to think that the target profile does not have a unified challenge, causing it to use an incorrect existing credential for password change, leading to untrusted credential change. Bug: 77892111 Test: Create profile; set separate empty work challenge; observe no crash Change-Id: I4d76b20706a796654f9389f31ae8c46d51d7adac
This commit is contained in:
@@ -654,7 +654,6 @@ public class ChooseLockGeneric extends SettingsActivity {
|
||||
}
|
||||
|
||||
if (quality == DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED) {
|
||||
mLockPatternUtils.setSeparateProfileChallengeEnabled(mUserId, true, mUserPassword);
|
||||
mChooseLockSettingsHelper.utils().clearLock(mUserPassword, mUserId);
|
||||
mChooseLockSettingsHelper.utils().setLockScreenDisabled(disabled, mUserId);
|
||||
getActivity().setResult(Activity.RESULT_OK);
|
||||
|
Reference in New Issue
Block a user