DO NOT MERGE Refactor passwords/pins/patterns to byte[]

Relating to packages/apps/Settings

Bug: 120484642
Test: manual - test setting and unlocking passwords/pins/patterns.
      automated - atest packages/apps/Settings/tests/robotests/src/com/android/settings/password/

Change-Id: Idec8338d141c185bef67ade12035fdb2fa9d17ea
(cherry picked from commit b27c4308a2)
This commit is contained in:
Rich Cannings
2019-02-19 13:15:30 -08:00
parent 1b29c28aef
commit 34042bbf1d
11 changed files with 113 additions and 78 deletions

View File

@@ -56,9 +56,8 @@ public class LockUnificationPreferenceController extends AbstractPreferenceContr
private RestrictedSwitchPreference mUnifyProfile;
private String mCurrentDevicePassword;
private String mCurrentProfilePassword;
private byte[] mCurrentDevicePassword;
private byte[] mCurrentProfilePassword;
@Override
public void displayPreference(PreferenceScreen screen) {
@@ -139,13 +138,13 @@ public class LockUnificationPreferenceController extends AbstractPreferenceContr
} else if (requestCode == UNIFY_LOCK_CONFIRM_DEVICE_REQUEST
&& resultCode == Activity.RESULT_OK) {
mCurrentDevicePassword =
data.getStringExtra(ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD);
data.getByteArrayExtra(ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD);
launchConfirmProfileLockForUnification();
return true;
} else if (requestCode == UNIFY_LOCK_CONFIRM_PROFILE_REQUEST
&& resultCode == Activity.RESULT_OK) {
mCurrentProfilePassword =
data.getStringExtra(ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD);
data.getByteArrayExtra(ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD);
unifyLocks();
return true;
}
@@ -192,7 +191,7 @@ public class LockUnificationPreferenceController extends AbstractPreferenceContr
mLockPatternUtils.getKeyguardStoredPasswordQuality(mProfileChallengeUserId);
if (profileQuality == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING) {
mLockPatternUtils.saveLockPattern(
LockPatternUtils.stringToPattern(mCurrentProfilePassword),
LockPatternUtils.byteArrayToPattern(mCurrentProfilePassword),
mCurrentDevicePassword, MY_USER_ID);
} else {
mLockPatternUtils.saveLockPassword(