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

Skip to content
Commit 24c5a7c9 authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Enable unfold animation progress calculation in arbitrary thread

This cl changes some classes to make unfold animation progresses calculation happen on an arbitrary thread. Now there are 2 consumers of progresses calulated in the background:

1. Launcher process. Launcher receives animation progresses from SystemUI. if SystemUI janks (e.g. due to notification measuring), launcher would have janked as well. After this change, Launcher receives the progresses calculted in the background, so it is unaffected by systemui main thread being blocked.

 2. The dark scrim added after unfold (controlled by "UnfoldLightRevealOverlayAnimation") is now fully independent from the main thread: as it also uses the background progress, and the window is using a separate UI thread, it will not jank when the systemui main thread is stuck.

For now the only missing part is receiving the screenStatus in the bg thread. When we tried it caused regressions in the past. All other signals can now happen either on the unfold progress thread or main.

Most classes have been changed to be created with an arbitrary Handler. In the unfold lib there are 2 now: (1) UnfoldMain and (2) UnfoldBg.

There are now 2 injectable versions of FoldStateProvider. The default one that uses the main thread (and should not have any change in behaviour), and the new one annotated with @UnfoldBgProgress, that receives and executes all (except screen state) the calculations in the background.

PhysicsBasedUnfoldTransitionProgressProvider can now use any of those. Only when the handler provided is different than the main one, another scheduler (that works in the background) is provided to the DynamicAnimation.

+ UnfoldLightRevealOverlayAnimation moved to the new UnfoldBg thread.

Bug: 277879146
Bug: 310572965
Bug: 307511460
Bug: 292472402
Flag: ACONFIG unfold_animation_background_progress DISABLED
Test: DeviceFoldStateProviderTest, PhysicsBasedUnfoldTransitionProgressProviderTest + manual + perfetto trace
Change-Id: I767263b6a5f3c6fd3b6f52c946d724599013a47c
parent 73330b61
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment