From 55b17eb3fb5e638386e557bef0d1869a75307f15 Mon Sep 17 00:00:00 2001 From: Jason Chiu Date: Tue, 13 Dec 2022 10:35:40 +0800 Subject: [PATCH] Fix IllegalArgumentException from RecyclerView in PanelFragment The crash happens while RecyclerView is doing animation stuff. However, The panel doesn't use any animation in the list, so the simplest solution is to disable the ItemAnimator completely. Fix: 260923012 Test: build Change-Id: I9c5159366aca448a1075bee32ce940fbf902a450 --- src/com/android/settings/panel/PanelFragment.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/android/settings/panel/PanelFragment.java b/src/com/android/settings/panel/PanelFragment.java index 1ce4492ba16..5bc0cc8d636 100644 --- a/src/com/android/settings/panel/PanelFragment.java +++ b/src/com/android/settings/panel/PanelFragment.java @@ -214,6 +214,8 @@ public class PanelFragment extends Fragment { // Make the panel layout gone here, to avoid janky animation when updating from old panel. // We will make it visible once the panel is ready to load. mPanelSlices.setVisibility(View.GONE); + // Remove the animator to avoid a RecyclerView crash. + mPanelSlices.setItemAnimator(null); final Bundle arguments = getArguments(); final String callingPackageName =