Merge "RESTRICT AUTOMERGE: Catch exceptions from setLockCredential()" into tm-qpr-dev

This commit is contained in:
Eric Biggers
2023-08-08 00:51:38 +00:00
committed by Android (Google) Code Review
2 changed files with 14 additions and 4 deletions

View File

@@ -1048,8 +1048,13 @@ public class ChooseLockPassword extends SettingsActivity {
@Override
protected Pair<Boolean, Intent> 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();
}

View File

@@ -909,8 +909,13 @@ public class ChooseLockPattern extends SettingsActivity {
@Override
protected Pair<Boolean, Intent> 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();
}