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.
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5e72fc24724c9d906335d6722c6104dc53cbc0a4)
Merged-In: If4299bc7bba022b12c33343ecc2a45050c159210
Change-Id: If4299bc7bba022b12c33343ecc2a45050c159210
Loading
Please register or sign in to comment