use of com.android.internal.widget.LockPatternUtils in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ChooseLockSettingsHelperTest method getChooseLockSettingsHelper.
private ChooseLockSettingsHelper getChooseLockSettingsHelper(Activity mockActivity) {
LockPatternUtils mockLockPatternUtils = mock(LockPatternUtils.class);
when(mockLockPatternUtils.getKeyguardStoredPasswordQuality(anyInt())).thenReturn(DevicePolicyManager.PASSWORD_QUALITY_SOMETHING);
ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(mockActivity);
helper.mLockPatternUtils = mockLockPatternUtils;
return helper;
}
use of com.android.internal.widget.LockPatternUtils in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class CredentialStorage method checkKeyGuardQuality.
/**
* Returns true if the currently set key guard matches our minimum quality requirements.
*/
private boolean checkKeyGuardQuality() {
int credentialOwner = UserManager.get(this).getCredentialOwnerProfile(UserHandle.myUserId());
int quality = new LockPatternUtils(this).getActivePasswordQuality(credentialOwner);
return (quality >= MIN_PASSWORD_QUALITY);
}
use of com.android.internal.widget.LockPatternUtils in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SecuritySettings method unifyLocks.
private void unifyLocks() {
int profileQuality = mLockPatternUtils.getKeyguardStoredPasswordQuality(mProfileChallengeUserId);
final LockPatternUtils lockPatternUtils = mChooseLockSettingsHelper.utils();
if (profileQuality == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING) {
mLockPatternUtils.saveLockPattern(LockPatternUtils.stringToPattern(mCurrentProfilePassword, lockPatternUtils.getLockPatternSize(MY_USER_ID)), mCurrentDevicePassword, MY_USER_ID);
} else {
mLockPatternUtils.saveLockPassword(mCurrentProfilePassword, mCurrentDevicePassword, profileQuality, MY_USER_ID);
}
mLockPatternUtils.setSeparateProfileChallengeEnabled(mProfileChallengeUserId, false, mCurrentProfilePassword);
final boolean profilePatternVisibility = mLockPatternUtils.isVisiblePatternEnabled(mProfileChallengeUserId);
mLockPatternUtils.setVisiblePatternEnabled(profilePatternVisibility, MY_USER_ID);
mCurrentDevicePassword = null;
mCurrentProfilePassword = null;
}
use of com.android.internal.widget.LockPatternUtils in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SecuritySettings method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mSubscriptionManager = SubscriptionManager.from(getActivity());
mLockPatternUtils = new LockPatternUtils(getActivity());
mManagedPasswordProvider = ManagedLockPasswordProvider.get(getActivity(), MY_USER_ID);
mDPM = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE);
mUm = UserManager.get(getActivity());
mChooseLockSettingsHelper = new ChooseLockSettingsHelper(getActivity());
if (savedInstanceState != null && savedInstanceState.containsKey(TRUST_AGENT_CLICK_INTENT)) {
mTrustAgentClickIntent = savedInstanceState.getParcelable(TRUST_AGENT_CLICK_INTENT);
}
}
use of com.android.internal.widget.LockPatternUtils in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ScreenPinningSettings method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
final SettingsActivity activity = (SettingsActivity) getActivity();
mLockPatternUtils = new LockPatternUtils(activity);
mSwitchBar = activity.getSwitchBar();
mSwitchBar.addOnSwitchChangeListener(this);
mSwitchBar.show();
mSwitchBar.setChecked(isLockToAppEnabled(getActivity()));
}
Aggregations