use of com.android.settings.password.ChooseLockSettingsHelper in project platform_packages_apps_Settings by BlissRoms.
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();
}
}
use of com.android.settings.password.ChooseLockSettingsHelper in project platform_packages_apps_Settings by BlissRoms.
the class SecuritySettings method onPreferenceChange.
@Override
public boolean onPreferenceChange(Preference preference, Object value) {
boolean result = true;
final String key = preference.getKey();
final LockPatternUtils lockPatternUtils = mChooseLockSettingsHelper.utils();
if (KEY_VISIBLE_PATTERN_PROFILE.equals(key)) {
if (Utils.startQuietModeDialogIfNecessary(this.getActivity(), mUm, mProfileChallengeUserId)) {
return false;
}
lockPatternUtils.setVisiblePatternEnabled((Boolean) value, mProfileChallengeUserId);
} else if (KEY_UNIFICATION.equals(key)) {
if (Utils.startQuietModeDialogIfNecessary(this.getActivity(), mUm, mProfileChallengeUserId)) {
return false;
}
if ((Boolean) value) {
final boolean compliantForDevice = (mLockPatternUtils.getKeyguardStoredPasswordQuality(mProfileChallengeUserId) >= DevicePolicyManager.PASSWORD_QUALITY_SOMETHING && mLockPatternUtils.isSeparateProfileChallengeAllowedToUnify(mProfileChallengeUserId));
UnificationConfirmationDialog dialog = UnificationConfirmationDialog.newIntance(compliantForDevice);
dialog.show(getChildFragmentManager(), TAG_UNIFICATION_DIALOG);
} else {
final String title = getActivity().getString(R.string.unlock_set_unlock_launch_picker_title);
final ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(getActivity(), this);
if (!helper.launchConfirmationActivity(UNUNIFY_LOCK_CONFIRM_DEVICE_REQUEST, title, true, MY_USER_ID)) {
ununifyLocks();
}
}
} else if (KEY_SHOW_PASSWORD.equals(key)) {
Settings.System.putInt(getContentResolver(), Settings.System.TEXT_SHOW_PASSWORD, ((Boolean) value) ? 1 : 0);
lockPatternUtils.setVisiblePasswordEnabled((Boolean) value, MY_USER_ID);
}
return result;
}
use of com.android.settings.password.ChooseLockSettingsHelper in project platform_packages_apps_Settings by BlissRoms.
the class SecuritySettings method onPreferenceTreeClick.
@Override
public boolean onPreferenceTreeClick(Preference preference) {
final String key = preference.getKey();
if (KEY_UNLOCK_SET_OR_CHANGE.equals(key)) {
// able to complete the operation due to the lack of (old) encryption key.
if (mProfileChallengeUserId != UserHandle.USER_NULL && !mLockPatternUtils.isSeparateProfileChallengeEnabled(mProfileChallengeUserId) && StorageManager.isFileEncryptedNativeOnly()) {
if (Utils.startQuietModeDialogIfNecessary(this.getActivity(), mUm, mProfileChallengeUserId)) {
return false;
}
}
startFragment(this, ChooseLockGenericFragment.class.getName(), R.string.lock_settings_picker_title, SET_OR_CHANGE_LOCK_METHOD_REQUEST, null);
} else if (KEY_UNLOCK_SET_OR_CHANGE_PROFILE.equals(key)) {
if (Utils.startQuietModeDialogIfNecessary(this.getActivity(), mUm, mProfileChallengeUserId)) {
return false;
}
Bundle extras = new Bundle();
extras.putInt(Intent.EXTRA_USER_ID, mProfileChallengeUserId);
startFragment(this, ChooseLockGenericFragment.class.getName(), R.string.lock_settings_picker_title_profile, SET_OR_CHANGE_LOCK_METHOD_REQUEST_PROFILE, extras);
} else if (KEY_TRUST_AGENT.equals(key)) {
ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(this.getActivity(), this);
mTrustAgentClickIntent = preference.getIntent();
boolean confirmationLaunched = helper.launchConfirmationActivity(CHANGE_TRUST_AGENT_SETTINGS, preference.getTitle());
if (!confirmationLaunched && mTrustAgentClickIntent != null) {
// If this returns false, it means no password confirmation is required.
startActivity(mTrustAgentClickIntent);
mTrustAgentClickIntent = null;
}
} else {
// If we didn't handle it, let preferences handle it.
return super.onPreferenceTreeClick(preference);
}
return true;
}
use of com.android.settings.password.ChooseLockSettingsHelper in project platform_packages_apps_Settings by BlissRoms.
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();
}
}
use of com.android.settings.password.ChooseLockSettingsHelper in project platform_packages_apps_Settings by BlissRoms.
the class CredentialStorage method confirmKeyGuard.
/**
* Confirm existing key guard, returning password via onActivityResult.
*/
private boolean confirmKeyGuard(int requestCode) {
Resources res = getResources();
boolean launched = new ChooseLockSettingsHelper(this).launchConfirmationActivity(requestCode, res.getText(R.string.credentials_title), true);
return launched;
}
Aggregations