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

Skip to content
Commit 7b27cbe7 authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Fix config change race in (legacy) shade window

When ShadeWindowGoesAround flag is on, the shade window uses a separate context (windowContext), that is always associated with the display the shade is at.

When the configuration changes as result of fold/unfold, first the global configuration (associated with the default display) changes, and only afterwards resources used by the shade context changes as well.

So here there was a race between:
- SystemUiApplication: it was receving the config change for the default display, and propagating it to CentralSurfaceImpl that was propagating it to mQSPanelController and mShadeSurface. Those classes were getting the "split shade" boolean at this point using shade window resources, but those were not updated yet with the new configuration!
- WindowContext: The window context resources were updated soon after the global config, but later than SystemUiApplication was receiving the callback for the global config.

-> this resulted in mQSPanelController and mShadeSurface always having the opposite "splitShade" value after unfolding (as they were both reading it from the WindowContext resources, that were updated later)

After this change, mQSPanelController and mShadeSurface receive the config change only from the @ShadeDisplayAware ConfigurationController. From there, it's guaranteed resources have been updated before receiving the onConfigChanged call.

Note that this issue doesn't happen with flexiglass on, and the flag is supposed to ship only with flexiglass.

Bug: 362719719
Bug: 391929792
Test: CentralSurfacesImpl + fold/unfold comet with flexiglass off + QSPanelControllerBaseTest
Flag: com.android.systemui.shade_window_goes_around
Change-Id: Id25536661ac876863c33e2b149b1ee82aa3b929a
parent d635960c
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