diff options
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/LockIconViewController.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/LockIconViewController.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java index b367bdf08886..7127444befb7 100644 --- a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java @@ -145,7 +145,13 @@ public class LockIconViewController extends ViewController<LockIconView> impleme final boolean hasUdfps = mAuthController.getUdfpsSensorLocation() != null; mHasUdfpsOrFaceAuthFeatures = hasFaceAuth || hasUdfps; if (!mHasUdfpsOrFaceAuthFeatures) { - ((ViewGroup) mView.getParent()).removeView(mView); + // Posting since removing a view in the middle of onAttach can lead to a crash in the + // iteration loop when the view isn't last + mView.setVisibility(View.GONE); + mView.post(() -> { + mView.setVisibility(View.VISIBLE); + ((ViewGroup) mView.getParent()).removeView(mView); + }); return; } |