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 @Override
protected Pair<Boolean, Intent> saveAndVerifyInBackground() { protected Pair<Boolean, Intent> saveAndVerifyInBackground() {
final boolean success = mUtils.setLockCredential( boolean success;
mChosenPassword, mCurrentCredential, mUserId); try {
success = mUtils.setLockCredential(mChosenPassword, mCurrentCredential, mUserId);
} catch (RuntimeException e) {
Log.e(TAG, "Failed to set lockscreen credential", e);
success = false;
}
if (success) { if (success) {
unifyProfileCredentialIfRequested(); unifyProfileCredentialIfRequested();
} }

View File

@@ -909,8 +909,13 @@ public class ChooseLockPattern extends SettingsActivity {
@Override @Override
protected Pair<Boolean, Intent> saveAndVerifyInBackground() { protected Pair<Boolean, Intent> saveAndVerifyInBackground() {
final int userId = mUserId; final int userId = mUserId;
final boolean success = mUtils.setLockCredential(mChosenPattern, mCurrentCredential, boolean success;
userId); try {
success = mUtils.setLockCredential(mChosenPattern, mCurrentCredential, userId);
} catch (RuntimeException e) {
Log.e(TAG, "Failed to set lockscreen credential", e);
success = false;
}
if (success) { if (success) {
unifyProfileCredentialIfRequested(); unifyProfileCredentialIfRequested();
} }