Enforce that STLState is mutated on the right thread
SceneTransitionLayoutState currently does not do any synchronization
to support mutation from different threads. Usually this is not an issue
because most state changes naturally happen on the main thread, but I
noticed that it was causing some flakiness issues in tests given that
those run in a thread different than the main thread.
This CL enforces that all mutations of a STLState are done in the same
thread in which the state was created. If that STLState is used by a
SceneTransitionLayout, we also check that the thread is the same (which
is usually the main thread).
Bug: 290930950
Test: atest PlatformComposeSceneTransitionLayoutTests
Flag: com.android.systemui.scene_container
Change-Id: Ia928cc43305f4c226358dabd74fafee9d340fcc5
4 files changed