Fix race in ScopedUnfoldTransitionProgressProvider

Callbacks were being added from the main thread, but the listener list was being read from the background thread used to generate unfold progress, causing a ConcurrentModificationException.

Now the scoped provider creates an handler backed by the same looper as the received progress, and uses it to forward progresses. This makes it possible for the class to work even without explicitly injecting the handler to use to propagate progresses.

+ Adding many tests for ScopedUnfoldTransitionProgressProvider

Flag: ACONFIG unfold_animation_background_progress DISABLED
Bug: 316554882
Test: ScopedUnfoldTransitionProgressProviderTest
Change-Id: I4d8ef19f0116e52b84e6689bddd096fa8fa468e4
7 files changed