Fix ConcurrentModificationExceptions during binding.

The same lists of extra items stored in BgModelData are also stored in
UI components. This is causing ConcurrentModificationExceptions. The
solution is to clone these lists or mark them as immutable before storing
them in their respective components.

Bug: 206918543
Test: Verified that crash no longer occurs after fix.
Change-Id: I571a2c451af58137aa7513b372b6a8ecf9bd3ff6
This commit is contained in:
Stefan Andonian
2022-11-17 18:56:09 +00:00
parent 698239e16a
commit a04de842d1
6 changed files with 17 additions and 28 deletions

View File

@@ -132,7 +132,8 @@ public class QuickstepModelDelegate extends ModelDelegate {
// Widgets prediction isn't used frequently. And thus, it is not persisted on disk.
mDataModel.extraItems.put(mWidgetsRecommendationState.containerId,
new FixedContainerItems(mWidgetsRecommendationState.containerId));
new FixedContainerItems(mWidgetsRecommendationState.containerId,
new ArrayList<>()));
mActive = true;
}