use of com.android.settings.password.ChooseLockSettingsHelper in project android_packages_apps_Settings by DirtyUnicorns.
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 android_packages_apps_Settings by DirtyUnicorns.
the class AddAccountSettings method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState != null) {
mAddAccountCalled = savedInstanceState.getBoolean(KEY_ADD_CALLED);
if (Log.isLoggable(TAG, Log.VERBOSE))
Log.v(TAG, "restored");
}
final UserManager um = (UserManager) getSystemService(Context.USER_SERVICE);
mUserHandle = Utils.getSecureTargetUser(getActivityToken(), um, null, /* arguments */
getIntent().getExtras());
if (um.hasUserRestriction(UserManager.DISALLOW_MODIFY_ACCOUNTS, mUserHandle)) {
// We aren't allowed to add an account.
Toast.makeText(this, R.string.user_cannot_add_accounts_message, Toast.LENGTH_LONG).show();
finish();
return;
}
if (mAddAccountCalled) {
// We already called add account - maybe the callback was lost.
finish();
return;
}
if (Utils.startQuietModeDialogIfNecessary(this, um, mUserHandle.getIdentifier())) {
finish();
return;
}
if (um.isUserUnlocked(mUserHandle)) {
requestChooseAccount();
} else {
// If the user is locked by fbe: we couldn't start the authenticator. So we must ask the
// user to unlock it first.
ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(this);
if (!helper.launchConfirmationActivity(UNLOCK_WORK_PROFILE_REQUEST, getString(R.string.unlock_set_unlock_launch_picker_title), false, mUserHandle.getIdentifier())) {
requestChooseAccount();
}
}
}
use of com.android.settings.password.ChooseLockSettingsHelper in project android_packages_apps_Settings by crdroidandroid.
the class AddAccountSettings method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState != null) {
mAddAccountCalled = savedInstanceState.getBoolean(KEY_ADD_CALLED);
if (Log.isLoggable(TAG, Log.VERBOSE))
Log.v(TAG, "restored");
}
final UserManager um = (UserManager) getSystemService(Context.USER_SERVICE);
mUserHandle = Utils.getSecureTargetUser(getActivityToken(), um, null, /* arguments */
getIntent().getExtras());
if (um.hasUserRestriction(UserManager.DISALLOW_MODIFY_ACCOUNTS, mUserHandle)) {
// We aren't allowed to add an account.
Toast.makeText(this, R.string.user_cannot_add_accounts_message, Toast.LENGTH_LONG).show();
finish();
return;
}
if (mAddAccountCalled) {
// We already called add account - maybe the callback was lost.
finish();
return;
}
if (Utils.startQuietModeDialogIfNecessary(this, um, mUserHandle.getIdentifier())) {
finish();
return;
}
if (um.isUserUnlocked(mUserHandle)) {
requestChooseAccount();
} else {
// If the user is locked by fbe: we couldn't start the authenticator. So we must ask the
// user to unlock it first.
ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(this);
if (!helper.launchConfirmationActivity(UNLOCK_WORK_PROFILE_REQUEST, getString(R.string.unlock_set_unlock_launch_picker_title), false, mUserHandle.getIdentifier())) {
requestChooseAccount();
}
}
}
use of com.android.settings.password.ChooseLockSettingsHelper in project android_packages_apps_Settings by crdroidandroid.
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 crdroidandroid.
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);
}
Aggregations