mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-10-01 01:35:54 -04:00
af360bc9ea
wgetc873988898
.patch -O telecomm-01.patch wget0fb5786dbf
.patch -O mediaprovider-01.patch wget1a4b9ef510
.patch -O wifi-01.patch wget364a1d9962
.patch -O bluetooth-01.patch wget87a06448b9
.patch -O settings-01.patch wgetaaba724a68
.patch -O settings-02.patch wget507304e1f5
.patch -O native-01.patch wget89489ff5dd
.patch -O base-01.patch wgetd1765c4715
.patch -O base-02.patch wgetcbb1a0ecd6
.patch -O base-03.patch wget4725772c0b
.patch -O base-04.patch wget19747f6923
.patch -O base-05.patch wgete7a1aa9ed0
.patch -O base-06.patch wget922a7860b1
.patch -O base-07.patch wgeted183ed912
.patch -O base-08.patch wgetc6fbe1330a
.patch -O base-09.patch wget9141cac175
.patch -O base-10.patch wget41235bcc67
.patch -O av-01.patch wgeta89f704701
.patch -O av-02.patch wget6d7cd80d77
.patch -O av-03.patch wget75fc175a08
.patch -O av-04.patch wgetb023ec300f
.patch -O av-05.patch wgetc8117d1539
.patch -O av-06.patch wgetf06d23d824
.patch -O av-07.patch wget9c7408ab07
.patch -O av-08.patch wgetcfbfcefb3c
.patch -O launcher-01.patch wget4a27a7f162
.patch -O libxml-01.patch Signed-off-by: Tad <tad@spotco.us>
66 lines
3.4 KiB
Diff
66 lines
3.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Eric Biggers <ebiggers@google.com>
|
|
Date: Thu, 27 Jul 2023 21:45:05 +0000
|
|
Subject: [PATCH] RESTRICT AUTOMERGE: Catch exceptions from setLockCredential()
|
|
|
|
When LockPatternUtils#setLockCredential() fails, it can either return
|
|
false or throw an exception. Catch the exception and treat it the same
|
|
way as a false return value, to prevent crashing com.android.settings.
|
|
|
|
Bug: 253043065
|
|
Test: Tried setting lockscreen credential while in secure FRP mode using
|
|
smartlock setup activity launched by intent via adb. Verified
|
|
that com.android.settings no longer crashes due to the exception
|
|
from LockPatternUtils#setLockCredential().
|
|
(cherry picked from commit 05f1eff1c9c3f82797f1a0f92ff7665b9f463488)
|
|
(moved change into ChooseLockPassword.java and ChooseLockPattern.java,
|
|
which are merged into SaveAndFinishWorker.java on udc-qpr-dev and main)
|
|
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:e0b5a793a19198370d479401101cea97c2f1d835)
|
|
Merged-In: I48b9119c19fb6378b1f88d36433ee4f4c8501d76
|
|
Change-Id: I48b9119c19fb6378b1f88d36433ee4f4c8501d76
|
|
---
|
|
.../android/settings/password/ChooseLockPassword.java | 9 +++++++--
|
|
src/com/android/settings/password/ChooseLockPattern.java | 9 +++++++--
|
|
2 files changed, 14 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/src/com/android/settings/password/ChooseLockPassword.java b/src/com/android/settings/password/ChooseLockPassword.java
|
|
index c4a3159e00..613388b21f 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<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();
|
|
}
|
|
diff --git a/src/com/android/settings/password/ChooseLockPattern.java b/src/com/android/settings/password/ChooseLockPattern.java
|
|
index e54568060a..964a268510 100644
|
|
--- a/src/com/android/settings/password/ChooseLockPattern.java
|
|
+++ b/src/com/android/settings/password/ChooseLockPattern.java
|
|
@@ -925,8 +925,13 @@ public class ChooseLockPattern extends SettingsActivity {
|
|
protected Pair<Boolean, Intent> saveAndVerifyInBackground() {
|
|
final int userId = mUserId;
|
|
mUtils.setLockPatternSize(mPatternSize, userId);
|
|
- 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();
|
|
}
|