Settings: Forward port lock pattern grid size (2/2)
Co-authored-by: Alberto97 <albertop2197@gmail.com> Co-authored-by: d34d <clark@cyngn.com> Co-authored-by: Dhina17 <dhinalogu@gmail.com> Co-authored-by: LuK1337 <priv.luk@gmail.com> Co-authored-by: Roman Birg <roman@cyngn.com> Change-Id: I7078d703c218cd096d9b77c003a94b52fbce6322
This commit is contained in:
committed by
Michael Bestas
parent
7625635bb8
commit
34a8deb417
@@ -118,6 +118,7 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
|
||||
private DisappearAnimationUtils mDisappearAnimationUtils;
|
||||
|
||||
private boolean mIsManagedProfile;
|
||||
private byte mPatternSize;
|
||||
|
||||
// required constructor for fragments
|
||||
public ConfirmLockPatternFragment() {
|
||||
@@ -144,6 +145,7 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
|
||||
mSudContent.setPadding(mSudContent.getPaddingLeft(), 0, mSudContent.getPaddingRight(),
|
||||
0);
|
||||
mIsManagedProfile = UserManager.get(getActivity()).isManagedProfile(mEffectiveUserId);
|
||||
mPatternSize = mLockPatternUtils.getLockPatternSize(mEffectiveUserId);
|
||||
|
||||
// make it so unhandled touch events within the unlock screen go to the
|
||||
// lock pattern view.
|
||||
@@ -158,6 +160,7 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
|
||||
mDetailsText = intent.getCharSequenceExtra(
|
||||
ConfirmDeviceCredentialBaseFragment.DETAILS_TEXT);
|
||||
mCheckBoxLabel = intent.getCharSequenceExtra(KeyguardManager.EXTRA_CHECKBOX_LABEL);
|
||||
mPatternSize = intent.getByteExtra("pattern_size", mPatternSize);
|
||||
}
|
||||
if (TextUtils.isEmpty(mHeaderText) && mIsManagedProfile) {
|
||||
mHeaderText = mDevicePolicyManager.getOrganizationNameForUser(mUserId);
|
||||
@@ -165,6 +168,7 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
|
||||
|
||||
mLockPatternView.setInStealthMode(!mLockPatternUtils.isVisiblePatternEnabled(
|
||||
mEffectiveUserId));
|
||||
mLockPatternView.setLockPatternSize(mPatternSize);
|
||||
mLockPatternView.setOnPatternListener(mConfirmExistingLockPatternListener);
|
||||
mLockPatternView.setOnTouchListener((v, event) -> {
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
@@ -506,14 +510,15 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
|
||||
|
||||
}
|
||||
|
||||
public void onPatternDetected(List<LockPatternView.Cell> pattern) {
|
||||
public void onPatternDetected(List<LockPatternView.Cell> pattern, byte patternSize) {
|
||||
if (mPendingLockCheck != null || mDisappearing) {
|
||||
return;
|
||||
}
|
||||
|
||||
mLockPatternView.setEnabled(false);
|
||||
|
||||
final LockscreenCredential credential = LockscreenCredential.createPattern(pattern);
|
||||
final LockscreenCredential credential = LockscreenCredential.createPattern(pattern,
|
||||
patternSize);
|
||||
|
||||
if (mRemoteValidation) {
|
||||
validateGuess(credential);
|
||||
@@ -652,7 +657,8 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
|
||||
mLockPatternUtils,
|
||||
mRemoteLockscreenValidationFragment.getLockscreenCredential(),
|
||||
/* currentCredential= */ null,
|
||||
mEffectiveUserId);
|
||||
mEffectiveUserId,
|
||||
mLockPatternUtils.getLockPatternSize(mEffectiveUserId));
|
||||
} else {
|
||||
mCredentialCheckResultTracker.setResult(/* matched= */ true, new Intent(),
|
||||
/* timeoutMs= */ 0, mEffectiveUserId);
|
||||
|
||||
Reference in New Issue
Block a user