use of com.android.internal.widget.LockPatternUtils in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ConfirmDeviceCredentialBaseFragment method onCreate.
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mAllowFpAuthentication = getActivity().getIntent().getBooleanExtra(ALLOW_FP_AUTHENTICATION, false);
mReturnCredentials = getActivity().getIntent().getBooleanExtra(ChooseLockSettingsHelper.EXTRA_KEY_RETURN_CREDENTIALS, false);
// Only take this argument into account if it belongs to the current profile.
Intent intent = getActivity().getIntent();
mUserId = Utils.getUserIdFromBundle(getActivity(), intent.getExtras());
final UserManager userManager = UserManager.get(getActivity());
mEffectiveUserId = userManager.getCredentialOwnerProfile(mUserId);
mLockPatternUtils = new LockPatternUtils(getActivity());
mIsStrongAuthRequired = isFingerprintDisallowedByStrongAuth();
mAllowFpAuthentication = mAllowFpAuthentication && !isFingerprintDisabledByAdmin() && !mReturnCredentials && !mIsStrongAuthRequired;
}
use of com.android.internal.widget.LockPatternUtils in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ConfirmDeviceCredentialActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
String title = intent.getStringExtra(KeyguardManager.EXTRA_TITLE);
String details = intent.getStringExtra(KeyguardManager.EXTRA_DESCRIPTION);
int userId = Utils.getCredentialOwnerUserId(this);
if (isInternalActivity()) {
try {
userId = Utils.getUserIdFromBundle(this, intent.getExtras());
} catch (SecurityException se) {
Log.e(TAG, "Invalid intent extra", se);
}
}
final boolean isManagedProfile = Utils.isManagedProfile(UserManager.get(this), userId);
// check whether there is a policy setting the organization name and use that as title
if ((title == null) && isManagedProfile) {
title = getTitleFromOrganizationName(userId);
}
ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(this);
final LockPatternUtils lockPatternUtils = new LockPatternUtils(this);
boolean launched;
// challenge is unlocked.
if (isManagedProfile && isInternalActivity() && !lockPatternUtils.isSeparateProfileChallengeEnabled(userId)) {
// We set the challenge as 0L, so it will force to unlock managed profile when it
// unlocks primary profile screen lock, by calling verifyTiedProfileChallenge()
launched = helper.launchConfirmationActivityWithExternalAndChallenge(0, /* request code */
null, /* title */
title, details, true, /* isExternal */
0L, /* challenge */
userId);
} else {
launched = helper.launchConfirmationActivity(0, /* request code */
null, /* title */
title, details, false, /* returnCredentials */
true, /* isExternal */
userId);
}
if (!launched) {
Log.d(TAG, "No pattern, password or PIN set.");
setResult(Activity.RESULT_OK);
}
finish();
}
use of com.android.internal.widget.LockPatternUtils in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class AppNotificationSettings method updateDependents.
@Override
protected void updateDependents(int importance) {
LockPatternUtils utils = new LockPatternUtils(getActivity());
boolean lockscreenSecure = utils.isSecure(UserHandle.myUserId());
UserInfo parentUser = mUm.getProfileParent(UserHandle.myUserId());
if (parentUser != null) {
lockscreenSecure |= utils.isSecure(parentUser.id);
}
if (getPreferenceScreen().findPreference(mBlock.getKey()) != null) {
setVisible(mSilent, checkCanBeVisible(Ranking.IMPORTANCE_MIN, importance));
mSilent.setChecked(importance == Ranking.IMPORTANCE_LOW || importance == Ranking.IMPORTANCE_VERY_LOW);
}
setVisible(mPriority, checkCanBeVisible(Ranking.IMPORTANCE_DEFAULT, importance) || (checkCanBeVisible(Ranking.IMPORTANCE_LOW, importance) && mDndVisualEffectsSuppressed));
setVisible(mVisibilityOverride, checkCanBeVisible(Ranking.IMPORTANCE_MIN, importance));
}
use of com.android.internal.widget.LockPatternUtils in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ConfigureNotificationSettings method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mContext = getActivity();
mProfileChallengeUserId = Utils.getManagedProfileId(UserManager.get(mContext), UserHandle.myUserId());
final LockPatternUtils utils = new LockPatternUtils(getActivity());
final boolean isUnified = !utils.isSeparateProfileChallengeEnabled(mProfileChallengeUserId);
mSecure = utils.isSecure(UserHandle.myUserId());
mSecureProfile = (mProfileChallengeUserId != UserHandle.USER_NULL) && (utils.isSecure(mProfileChallengeUserId) || (isUnified && mSecure));
addPreferencesFromResource(R.xml.configure_notification_settings);
initPulse();
initLockscreenNotifications();
if (mProfileChallengeUserId != UserHandle.USER_NULL) {
addPreferencesFromResource(R.xml.configure_notification_settings_profile);
initLockscreenNotificationsForProfile();
}
}
use of com.android.internal.widget.LockPatternUtils in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class OwnerInfoSettings method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mUserId = UserHandle.myUserId();
mLockPatternUtils = new LockPatternUtils(getActivity());
}
Aggregations