Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3bf2e707 authored by Rubin Xu's avatar Rubin Xu
Browse files

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
parent dc677781
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -760,8 +760,12 @@ public class ChooseLockGeneric extends SettingsActivity {
            if (quality == DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED) {
                // Clearing of user biometrics when screen lock is cleared is done at
                // LockSettingsService.removeBiometricsForUser().
                if (mUserPassword != null) {
                    // No need to call setLockCredential if the user currently doesn't
                    // have a password
                    mChooseLockSettingsHelper.utils().setLockCredential(
                            LockscreenCredential.createNone(), mUserPassword, mUserId);
                }
                mChooseLockSettingsHelper.utils().setLockScreenDisabled(disabled, mUserId);
                getActivity().setResult(Activity.RESULT_OK);
                finish();