Fix NPE when user goes from none to swipe for lockscreen
If the user currently doesn't have a password and transitions into another empty lockscreen (none -> swipe or swipe -> none), there is no need to call setLockCredential. Bug: 142701762 Test: Not yet :( Change-Id: I553c8b30c7414775185d632660d962a73607baca
This commit is contained in:
@@ -760,8 +760,12 @@ public class ChooseLockGeneric extends SettingsActivity {
|
|||||||
if (quality == DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED) {
|
if (quality == DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED) {
|
||||||
// Clearing of user biometrics when screen lock is cleared is done at
|
// Clearing of user biometrics when screen lock is cleared is done at
|
||||||
// LockSettingsService.removeBiometricsForUser().
|
// LockSettingsService.removeBiometricsForUser().
|
||||||
|
if (mUserPassword != null) {
|
||||||
|
// No need to call setLockCredential if the user currently doesn't
|
||||||
|
// have a password
|
||||||
mChooseLockSettingsHelper.utils().setLockCredential(
|
mChooseLockSettingsHelper.utils().setLockCredential(
|
||||||
LockscreenCredential.createNone(), mUserPassword, mUserId);
|
LockscreenCredential.createNone(), mUserPassword, mUserId);
|
||||||
|
}
|
||||||
mChooseLockSettingsHelper.utils().setLockScreenDisabled(disabled, mUserId);
|
mChooseLockSettingsHelper.utils().setLockScreenDisabled(disabled, mUserId);
|
||||||
getActivity().setResult(Activity.RESULT_OK);
|
getActivity().setResult(Activity.RESULT_OK);
|
||||||
finish();
|
finish();
|
||||||
|
Reference in New Issue
Block a user