diff options
author | Simão Gomes Viana <devel@superboring.dev> | 2021-03-01 20:28:22 +0100 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2021-09-27 21:17:05 +0800 |
commit | 91979844fefd134ca24ced2b4f8a318cd4a9b445 (patch) | |
tree | f87079f1f86cacfe6133ae56aec1289f48b9ae35 | |
parent | 74772e1d2686756137bcaaf0e572e79f1b46728f (diff) |
[ArrowOS][11.0] AuthContainerView: Fix rare SystemUI crash
This can happen if the fingerprint is validated twice in a row before
the view has time to disappear. Make the method synchronized to avoid
race conditions of any kind and add an additional try-catch as a
safeguard.
Change-Id: Ic2b76be1cc0f5217351e39ec24159ca23043ab4f
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java b/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java index c1233fe6b9da..363fd7d9b16d 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java @@ -593,7 +593,7 @@ public class AuthContainerView extends LinearLayout } } - private void removeWindowIfAttached(boolean sendReason) { + private synchronized void removeWindowIfAttached(boolean sendReason) { if (sendReason) { sendPendingCallbackIfNotNull(); } @@ -604,7 +604,12 @@ public class AuthContainerView extends LinearLayout } Log.d(TAG, "Removing container, mSysUiSessionId: " + mConfig.mSysUiSessionId); mContainerState = STATE_GONE; - mWindowManager.removeView(this); + try { + mWindowManager.removeView(this); + } catch (IllegalArgumentException e) { + // Looks like the view is already gone?? + // Whatever, just ignore it then. + } } @VisibleForTesting |