Skip to content

Commit dae7278

Browse files
xdevs23neobuddy89
authored andcommitted
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 Signed-off-by: Pranav Vashi <[email protected]>
1 parent bc0c906 commit dae7278

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ private void sendPendingCallbackIfNotNull() {
596596
}
597597
}
598598

599-
private void removeWindowIfAttached(boolean sendReason) {
599+
private synchronized void removeWindowIfAttached(boolean sendReason) {
600600
if (sendReason) {
601601
sendPendingCallbackIfNotNull();
602602
}
@@ -607,7 +607,12 @@ private void removeWindowIfAttached(boolean sendReason) {
607607
}
608608
Log.d(TAG, "Removing container, mSysUiSessionId: " + mConfig.mSysUiSessionId);
609609
mContainerState = STATE_GONE;
610-
mWindowManager.removeView(this);
610+
try {
611+
mWindowManager.removeView(this);
612+
} catch (IllegalArgumentException e) {
613+
// Looks like the view is already gone??
614+
// Whatever, just ignore it then.
615+
}
611616
}
612617

613618
@VisibleForTesting

0 commit comments

Comments
 (0)