Merge "Resolve new intent that allows setting the parent challenge"

This commit is contained in:
Benjamin Franz
2016-01-15 14:04:02 +00:00
committed by Android (Google) Code Review
2 changed files with 15 additions and 2 deletions

View File

@@ -162,8 +162,20 @@ public class ChooseLockGeneric extends SettingsActivity {
ENCRYPT_REQUESTED_DISABLED);
}
// Only take this argument into account if it belongs to the current profile.
mUserId = Utils.getSameOwnerUserId(getContext(), getArguments());
int targetUser = Utils.getSecureTargetUser(
getActivity().getActivityToken(),
UserManager.get(getActivity()),
null,
getActivity().getIntent().getExtras()).getIdentifier();
if (DevicePolicyManager.ACTION_SET_NEW_PARENT_PROFILE_PASSWORD.equals(
getActivity().getIntent().getAction()) ||
!mLockPatternUtils.isSeparateProfileChallengeAllowed(targetUser)) {
// Always use parent if explicitely requested or if profile challenge is not
// supported
mUserId = Utils.getSameOwnerUserId(getContext(), getArguments());
} else {
mUserId = targetUser;
}
if (mPasswordConfirmed) {
updatePreferencesOrFinish();