diff --git a/src/com/android/settings/password/ChooseLockPassword.java b/src/com/android/settings/password/ChooseLockPassword.java index c4a3159e001..613388b21fe 100644 --- a/src/com/android/settings/password/ChooseLockPassword.java +++ b/src/com/android/settings/password/ChooseLockPassword.java @@ -1048,8 +1048,13 @@ public class ChooseLockPassword extends SettingsActivity { @Override protected Pair saveAndVerifyInBackground() { - final boolean success = mUtils.setLockCredential( - mChosenPassword, mCurrentCredential, mUserId); + boolean success; + try { + success = mUtils.setLockCredential(mChosenPassword, mCurrentCredential, mUserId); + } catch (RuntimeException e) { + Log.e(TAG, "Failed to set lockscreen credential", e); + success = false; + } if (success) { unifyProfileCredentialIfRequested(); } diff --git a/src/com/android/settings/password/ChooseLockPattern.java b/src/com/android/settings/password/ChooseLockPattern.java index c39ef661a0f..93465dfdcc0 100644 --- a/src/com/android/settings/password/ChooseLockPattern.java +++ b/src/com/android/settings/password/ChooseLockPattern.java @@ -909,8 +909,13 @@ public class ChooseLockPattern extends SettingsActivity { @Override protected Pair saveAndVerifyInBackground() { final int userId = mUserId; - final boolean success = mUtils.setLockCredential(mChosenPattern, mCurrentCredential, - userId); + boolean success; + try { + success = mUtils.setLockCredential(mChosenPattern, mCurrentCredential, userId); + } catch (RuntimeException e) { + Log.e(TAG, "Failed to set lockscreen credential", e); + success = false; + } if (success) { unifyProfileCredentialIfRequested(); }