Keymaster init for work profile
am: 4bbf065
* commit '4bbf0653c0197aca3baa587df80e76ba1159a4fb':
Keymaster init for work profile
Change-Id: I4c61e2762128fa11fbe693d3ae40937a3b9fb29d
This commit is contained in:
@@ -206,7 +206,11 @@ public class ChooseLockGeneric extends SettingsActivity {
|
|||||||
} else if (!mWaitingForConfirmation) {
|
} else if (!mWaitingForConfirmation) {
|
||||||
ChooseLockSettingsHelper helper =
|
ChooseLockSettingsHelper helper =
|
||||||
new ChooseLockSettingsHelper(this.getActivity(), this);
|
new ChooseLockSettingsHelper(this.getActivity(), this);
|
||||||
if (!helper.launchConfirmationActivity(CONFIRM_EXISTING_REQUEST,
|
boolean managedProfileWithUnifiedLock = Utils
|
||||||
|
.isManagedProfile(UserManager.get(getActivity()), mUserId)
|
||||||
|
&& !mLockPatternUtils.isSeparateProfileChallengeEnabled(mUserId);
|
||||||
|
if (managedProfileWithUnifiedLock
|
||||||
|
|| !helper.launchConfirmationActivity(CONFIRM_EXISTING_REQUEST,
|
||||||
getString(R.string.unlock_set_unlock_launch_picker_title), true, mUserId)) {
|
getString(R.string.unlock_set_unlock_launch_picker_title), true, mUserId)) {
|
||||||
mPasswordConfirmed = true; // no password set, so no need to confirm
|
mPasswordConfirmed = true; // no password set, so no need to confirm
|
||||||
updatePreferencesOrFinish();
|
updatePreferencesOrFinish();
|
||||||
@@ -592,7 +596,7 @@ public class ChooseLockGeneric extends SettingsActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (quality == DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED) {
|
if (quality == DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED) {
|
||||||
mLockPatternUtils.setSeparateProfileChallengeEnabled(mUserId, true);
|
mLockPatternUtils.setSeparateProfileChallengeEnabled(mUserId, true, mUserPassword);
|
||||||
mChooseLockSettingsHelper.utils().clearLock(mUserId);
|
mChooseLockSettingsHelper.utils().clearLock(mUserId);
|
||||||
mChooseLockSettingsHelper.utils().setLockScreenDisabled(disabled, mUserId);
|
mChooseLockSettingsHelper.utils().setLockScreenDisabled(disabled, mUserId);
|
||||||
removeAllFingerprintTemplatesAndFinish();
|
removeAllFingerprintTemplatesAndFinish();
|
||||||
|
@@ -68,7 +68,6 @@ abstract class SaveChosenLockWorkerBase extends Fragment {
|
|||||||
mHasChallenge = hasChallenge;
|
mHasChallenge = hasChallenge;
|
||||||
mChallenge = challenge;
|
mChallenge = challenge;
|
||||||
// This will be a no-op for non managed profiles.
|
// This will be a no-op for non managed profiles.
|
||||||
mUtils.setSeparateProfileChallengeEnabled(mUserId, true);
|
|
||||||
mWasSecureBefore = mUtils.isSecure(mUserId);
|
mWasSecureBefore = mUtils.isSecure(mUserId);
|
||||||
|
|
||||||
Context context = getContext();
|
Context context = getContext();
|
||||||
|
@@ -697,8 +697,8 @@ public class SecuritySettings extends SettingsPreferenceFragment
|
|||||||
private void unifyLocks() {
|
private void unifyLocks() {
|
||||||
int profileQuality =
|
int profileQuality =
|
||||||
mLockPatternUtils.getKeyguardStoredPasswordQuality(mProfileChallengeUserId);
|
mLockPatternUtils.getKeyguardStoredPasswordQuality(mProfileChallengeUserId);
|
||||||
mLockPatternUtils.clearLock(mProfileChallengeUserId);
|
mLockPatternUtils.setSeparateProfileChallengeEnabled(mProfileChallengeUserId, false,
|
||||||
mLockPatternUtils.setSeparateProfileChallengeEnabled(mProfileChallengeUserId, false);
|
mCurrentProfilePassword);
|
||||||
if (profileQuality == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING) {
|
if (profileQuality == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING) {
|
||||||
mLockPatternUtils.saveLockPattern(
|
mLockPatternUtils.saveLockPattern(
|
||||||
LockPatternUtils.stringToPattern(mCurrentProfilePassword),
|
LockPatternUtils.stringToPattern(mCurrentProfilePassword),
|
||||||
@@ -716,14 +716,13 @@ public class SecuritySettings extends SettingsPreferenceFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void unifyUncompliantLocks() {
|
private void unifyUncompliantLocks() {
|
||||||
mLockPatternUtils.clearLock(mProfileChallengeUserId);
|
mLockPatternUtils.setSeparateProfileChallengeEnabled(mProfileChallengeUserId, false,
|
||||||
mLockPatternUtils.setSeparateProfileChallengeEnabled(mProfileChallengeUserId, false);
|
mCurrentProfilePassword);
|
||||||
startFragment(this, "com.android.settings.ChooseLockGeneric$ChooseLockGenericFragment",
|
startFragment(this, "com.android.settings.ChooseLockGeneric$ChooseLockGenericFragment",
|
||||||
R.string.lock_settings_picker_title, SET_OR_CHANGE_LOCK_METHOD_REQUEST, null);
|
R.string.lock_settings_picker_title, SET_OR_CHANGE_LOCK_METHOD_REQUEST, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ununifyLocks() {
|
private void ununifyLocks() {
|
||||||
mLockPatternUtils.setSeparateProfileChallengeEnabled(mProfileChallengeUserId, true);
|
|
||||||
Bundle extras = new Bundle();
|
Bundle extras = new Bundle();
|
||||||
extras.putInt(Intent.EXTRA_USER_ID, mProfileChallengeUserId);
|
extras.putInt(Intent.EXTRA_USER_ID, mProfileChallengeUserId);
|
||||||
startFragment(this,
|
startFragment(this,
|
||||||
|
Reference in New Issue
Block a user