RESTRICT AUTOMERGE: Catch exceptions from setLockCredential() am: e0b5a793a1

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24301337

Change-Id: I8607f271c5daf117b25502b572598e48dc2de30f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Eric Biggers
2023-08-08 01:35:06 +00:00
committed by Automerger Merge Worker
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();
}