Skip to content
Commit 5e72fc24 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Refresh layout parameter for bounds change from relayout

The relayout method also assumes the client can get the latest
configuration. So if the client only relies on IWindow#resized
to compute its layout parameter, there may be a race that
resized gets config 1, and then even if relayout gets config 2,
the window still uses old layout parameter.

So this change simulates similar behavior as ViewRootImpl did:
check the config changes both from resized and relayout.

Also optimize a case if resized is called many times in a short
time from server side, or the ui thread is not able to consume
the events in time, then only the last event will be handled.
So several relayout invocations for outdated intermediate states
can be reduced.

Bug: 264829202
Test: Hardcoded to return a wrong bound from IWindow#resized
      to wallpaper, wallpaper can still show correct size.

Merged-In: I0b4a480c6e85133f2d0d30042603009cc94db9c0
Change-Id: If4299bc7bba022b12c33343ecc2a45050c159210
parent 97cef3f4
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