Search in sources :

Example 86 with LockPatternUtils

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;
}
Also used : LockPatternUtils(com.android.internal.widget.LockPatternUtils)

Example 87 with LockPatternUtils

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);
}
Also used : LockPatternUtils(com.android.internal.widget.LockPatternUtils)

Example 88 with LockPatternUtils

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;
}
Also used : CmLockPatternUtils(org.cyanogenmod.internal.util.CmLockPatternUtils) LockPatternUtils(com.android.internal.widget.LockPatternUtils)

Example 89 with LockPatternUtils

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);
    }
}
Also used : CmLockPatternUtils(org.cyanogenmod.internal.util.CmLockPatternUtils) LockPatternUtils(com.android.internal.widget.LockPatternUtils)

Example 90 with LockPatternUtils

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()));
}
Also used : LockPatternUtils(com.android.internal.widget.LockPatternUtils)

Aggregations

LockPatternUtils (com.android.internal.widget.LockPatternUtils)96 ComponentName (android.content.ComponentName)24 UserInfo (android.content.pm.UserInfo)24 DevicePolicyManager (android.app.admin.DevicePolicyManager)19 UserManager (android.os.UserManager)16 IOException (java.io.IOException)11 IntentFilter (android.content.IntentFilter)10 Intent (android.content.Intent)9 View (android.view.View)9 Cursor (android.database.Cursor)6 RemoteException (android.os.RemoteException)6 ArrayList (java.util.ArrayList)6 ContentResolver (android.content.ContentResolver)5 Configuration (android.content.res.Configuration)5 Rect (android.graphics.Rect)5 SoundPool (android.media.SoundPool)5 IBinder (android.os.IBinder)5 IVrManager (android.service.vr.IVrManager)5 StatusBarIcon (com.android.internal.statusbar.StatusBarIcon)5 KeyguardDisplayManager (com.android.keyguard.KeyguardDisplayManager)5