Skip to content
Commit eb07884f authored by Charles Chen's avatar Charles Chen
Browse files

Send DA's config directly when attaching to DA

WindowContext relies on WindowTokenClient#onConfigurationChanged after
calling WMS#attachWindowContextToDisplayArea.
However, it took some time to wait for onConfigurationChanged callback
from the server side so that we may get a stale value right after
creating WindowContext.
This confuses developers especially when the foreground activity is in
size compat mode or freeform because the process config is overridden
by activity's config.
This CL makes #attachWindowContextToDisplayArea return DA's configuration
and applies to WindowContext direcly.
It also benefits WindowProviderService because it can obtain DA's
 configuration before onCreate() based on [1] and this CL.

Bug: 190019118
Bug: 190745506
Test: manual - 1. launch an Activity in size compat mode
               2. create a WindowContext and verify if WindowMetrics
                  matches DA bounds.
Test: atest WindowContextTest WindowContextTests
Test: atest WindowContextControllerTest ContextGetDisplayTest
[1]: dd4a748a

Change-Id: I8dd3987b731662502bc01e9d2ed67e718ada5f46
parent e085ae55
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