use of com.android.settings.password.ChooseLockSettingsHelper in project android_packages_apps_Settings by SudaMod.
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);
}
use of com.android.settings.password.ChooseLockSettingsHelper in project android_packages_apps_Settings by SudaMod.
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;
}
use of com.android.settings.password.ChooseLockSettingsHelper in project android_packages_apps_Settings by DirtyUnicorns.
the class FingerprintEnrollFindSensor method launchConfirmLock.
private void launchConfirmLock() {
long challenge = Utils.getFingerprintManagerOrNull(this).preEnroll();
ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(this);
boolean launchedConfirmationActivity = false;
if (mUserId == UserHandle.USER_NULL) {
launchedConfirmationActivity = helper.launchConfirmationActivity(CONFIRM_REQUEST, getString(R.string.security_settings_fingerprint_preference_title), null, null, challenge);
} else {
launchedConfirmationActivity = helper.launchConfirmationActivity(CONFIRM_REQUEST, getString(R.string.security_settings_fingerprint_preference_title), null, null, challenge, mUserId);
}
if (!launchedConfirmationActivity) {
// This shouldn't happen, as we should only end up at this step if a lock thingy is
// already set.
finish();
} else {
mLaunchedConfirmLock = true;
}
}
use of com.android.settings.password.ChooseLockSettingsHelper in project android_packages_apps_Settings by DirtyUnicorns.
the class BuildNumberPreferenceController method handlePreferenceTreeClick.
@Override
public boolean handlePreferenceTreeClick(Preference preference) {
if (!TextUtils.equals(preference.getKey(), KEY_BUILD_NUMBER)) {
return false;
}
if (Utils.isMonkeyRunning()) {
return false;
}
// Don't enable developer options for secondary users.
if (!mUm.isAdminUser()) {
mMetricsFeatureProvider.action(mContext, MetricsEvent.ACTION_SETTINGS_BUILD_NUMBER_PREF);
return false;
}
// Don't enable developer options until device has been provisioned
if (!Utils.isDeviceProvisioned(mContext)) {
mMetricsFeatureProvider.action(mContext, MetricsEvent.ACTION_SETTINGS_BUILD_NUMBER_PREF);
return false;
}
if (mUm.hasUserRestriction(UserManager.DISALLOW_DEBUGGING_FEATURES)) {
if (mDebuggingFeaturesDisallowedAdmin != null && !mDebuggingFeaturesDisallowedBySystem) {
RestrictedLockUtils.sendShowAdminSupportDetailsIntent(mContext, mDebuggingFeaturesDisallowedAdmin);
}
mMetricsFeatureProvider.action(mContext, MetricsEvent.ACTION_SETTINGS_BUILD_NUMBER_PREF);
return false;
}
if (mDevHitCountdown > 0) {
mDevHitCountdown--;
if (mDevHitCountdown == 0 && !mProcessingLastDevHit) {
// Add 1 count back, then start password confirmation flow.
mDevHitCountdown++;
final ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(mActivity, mFragment);
mProcessingLastDevHit = helper.launchConfirmationActivity(REQUEST_CONFIRM_PASSWORD_FOR_DEV_PREF, mContext.getString(R.string.unlock_set_unlock_launch_picker_title));
if (!mProcessingLastDevHit) {
enableDevelopmentSettings();
}
mMetricsFeatureProvider.action(mContext, MetricsEvent.ACTION_SETTINGS_BUILD_NUMBER_PREF, Pair.create(MetricsEvent.FIELD_SETTINGS_BUILD_NUMBER_DEVELOPER_MODE_ENABLED, mProcessingLastDevHit ? 0 : 1));
} else if (mDevHitCountdown > 0 && mDevHitCountdown < (TAPS_TO_BE_A_DEVELOPER - 2)) {
if (mDevHitToast != null) {
mDevHitToast.cancel();
}
mDevHitToast = Toast.makeText(mContext, mContext.getResources().getQuantityString(R.plurals.show_dev_countdown_custom, mDevHitCountdown, mDevHitCountdown), Toast.LENGTH_SHORT);
mDevHitToast.show();
}
mMetricsFeatureProvider.action(mContext, MetricsEvent.ACTION_SETTINGS_BUILD_NUMBER_PREF, Pair.create(MetricsEvent.FIELD_SETTINGS_BUILD_NUMBER_DEVELOPER_MODE_ENABLED, 0));
} else if (mDevHitCountdown < 0) {
if (mDevHitToast != null) {
mDevHitToast.cancel();
}
Random randomInsult = new Random();
final int toasts = randomInsult.nextInt(mInsults.length);
mDevHitToast = Toast.makeText(mContext, mInsults[toasts], Toast.LENGTH_LONG);
mDevHitToast.show();
mMetricsFeatureProvider.action(mContext, MetricsEvent.ACTION_SETTINGS_BUILD_NUMBER_PREF, Pair.create(MetricsEvent.FIELD_SETTINGS_BUILD_NUMBER_DEVELOPER_MODE_ENABLED, 1));
}
return true;
}
use of com.android.settings.password.ChooseLockSettingsHelper in project android_packages_apps_Settings by DirtyUnicorns.
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