Search in sources :

Example 1 with ChooseLockSettingsHelper

use of com.android.settings.password.ChooseLockSettingsHelper in project android_packages_apps_Settings by LineageOS.

the class CryptKeeperSettings method runKeyguardConfirmation.

/**
 * Keyguard validation is run using the standard {@link ConfirmLockPattern}
 * component as a subactivity
 * @param request the request code to be returned once confirmation finishes
 * @return true if confirmation launched
 */
private boolean runKeyguardConfirmation(int request) {
    Resources res = getActivity().getResources();
    ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(getActivity(), this);
    if (helper.utils().getKeyguardStoredPasswordQuality(UserHandle.myUserId()) == DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED) {
        showFinalConfirmation(StorageManager.CRYPT_TYPE_DEFAULT, "");
        return true;
    }
    return helper.launchConfirmationActivity(request, res.getText(R.string.crypt_keeper_encrypt_title), true);
}
Also used : ChooseLockSettingsHelper(com.android.settings.password.ChooseLockSettingsHelper) Resources(android.content.res.Resources)

Example 2 with ChooseLockSettingsHelper

use of com.android.settings.password.ChooseLockSettingsHelper in project android_packages_apps_Settings by LineageOS.

the class SecuritySettings method launchConfirmDeviceLockForUnification.

private void launchConfirmDeviceLockForUnification() {
    final String title = getActivity().getString(R.string.unlock_set_unlock_launch_picker_title);
    final ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(getActivity(), this);
    if (!helper.launchConfirmationActivity(UNIFY_LOCK_CONFIRM_DEVICE_REQUEST, title, true, MY_USER_ID)) {
        launchConfirmProfileLockForUnification();
    }
}
Also used : ChooseLockSettingsHelper(com.android.settings.password.ChooseLockSettingsHelper)

Example 3 with ChooseLockSettingsHelper

use of com.android.settings.password.ChooseLockSettingsHelper in project android_packages_apps_Settings by LineageOS.

the class SecuritySettings method launchConfirmProfileLockForUnification.

private void launchConfirmProfileLockForUnification() {
    final String title = getActivity().getString(R.string.unlock_set_unlock_launch_picker_title_profile);
    final ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(getActivity(), this);
    if (!helper.launchConfirmationActivity(UNIFY_LOCK_CONFIRM_PROFILE_REQUEST, title, true, mProfileChallengeUserId)) {
        unifyLocks();
        createPreferenceHierarchy();
    }
}
Also used : ChooseLockSettingsHelper(com.android.settings.password.ChooseLockSettingsHelper)

Example 4 with ChooseLockSettingsHelper

use of com.android.settings.password.ChooseLockSettingsHelper in project android_packages_apps_Settings by omnirom.

the class CryptKeeperSettings method runKeyguardConfirmation.

/**
 * Keyguard validation is run using the standard {@link ConfirmLockPattern}
 * component as a subactivity
 * @param request the request code to be returned once confirmation finishes
 * @return true if confirmation launched
 */
private boolean runKeyguardConfirmation(int request) {
    Resources res = getActivity().getResources();
    ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(getActivity(), this);
    if (helper.utils().getKeyguardStoredPasswordQuality(UserHandle.myUserId()) == DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED) {
        showFinalConfirmation(StorageManager.CRYPT_TYPE_DEFAULT, "");
        return true;
    }
    return helper.launchConfirmationActivity(request, res.getText(R.string.crypt_keeper_encrypt_title), true);
}
Also used : ChooseLockSettingsHelper(com.android.settings.password.ChooseLockSettingsHelper) Resources(android.content.res.Resources)

Example 5 with ChooseLockSettingsHelper

use of com.android.settings.password.ChooseLockSettingsHelper in project android_packages_apps_Settings by omnirom.

the class SecuritySettings method launchConfirmProfileLockForUnification.

private void launchConfirmProfileLockForUnification() {
    final String title = getActivity().getString(R.string.unlock_set_unlock_launch_picker_title_profile);
    final ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(getActivity(), this);
    if (!helper.launchConfirmationActivity(UNIFY_LOCK_CONFIRM_PROFILE_REQUEST, title, true, mProfileChallengeUserId)) {
        unifyLocks();
        createPreferenceHierarchy();
    }
}
Also used : ChooseLockSettingsHelper(com.android.settings.password.ChooseLockSettingsHelper)

Aggregations

ChooseLockSettingsHelper (com.android.settings.password.ChooseLockSettingsHelper)68 Resources (android.content.res.Resources)13 LockPatternUtils (com.android.internal.widget.LockPatternUtils)11 UserManager (android.os.UserManager)8 Bundle (android.os.Bundle)6 PersistableBundle (android.os.PersistableBundle)6 ChooseLockGenericFragment (com.android.settings.password.ChooseLockGeneric.ChooseLockGenericFragment)6 Activity (android.app.Activity)5 EnterprisePrivacyPreferenceController (com.android.settings.enterprise.EnterprisePrivacyPreferenceController)5 ManageDeviceAdminPreferenceController (com.android.settings.enterprise.ManageDeviceAdminPreferenceController)5 LockScreenNotificationPreferenceController (com.android.settings.notification.LockScreenNotificationPreferenceController)5 LineageLockPatternUtils (org.lineageos.internal.util.LineageLockPatternUtils)5 Intent (android.content.Intent)3 UserInfo (android.content.pm.UserInfo)2 ComponentName (android.content.ComponentName)1 ResolveInfo (android.content.pm.ResolveInfo)1 StorageManager (android.os.storage.StorageManager)1 Random (java.util.Random)1