Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e62999e3 authored by Michal Brzezinski's avatar Michal Brzezinski
Browse files

Fix ConcurrentModificationException in FoldableDisplaySwitchTrackingInteractorTest

We're modifying callback list in UnfoldTransitionRepository while FakeUnfoldTransitionProvider is still iterating over them.
This exception is only thrown when running Robolectric tests as Robolectric's ArrayList implementation differs from Android's one.
While Android implementation will just stop iterating, Robolectric will continue and throw exception when trying to get `next()` element.

Solution is to either not modify the list from within callback method or modify it safely and I went for the later with CopyOnWriteArrayList.

Fixes: 412727194
Test: FoldableDisplaySwitchTrackingInteractorTest -  on device and deviceless
Flag: NONE just fixing test
Change-Id: I59558cd6a74a3afbdfaa7b8549bbc7083ae9c87d
parent 64824e20
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment