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

Skip to content
Commit bbe3d7d2 authored by Jorge Gil's avatar Jorge Gil
Browse files

Use immutable window decor Configuration in RelayoutParams

Previously, the Context's Configuration was passed in as the
mWindowDecorConfig in relayout params to perfom diff checks against the
previous relayout's Configuration (e.g. to check for densityDpi changes).
However, the Configuration was passed in as a reference which meant that
when the context's config changed (e.g. density value), the reference
held by the window decoration set from the params was mutating immediately
and when diff checks were made both the old and the new Configurations
were actually the same object with the density being current on both.
This resulted in false-negatives as oldDensity==newDensity comparisons
always evaluated to true even if the density had just changed.
To actually compare the old vs new Configuration, a copy needs to be
passed in to relayout params that won't be mutated when the context
configuration changes.

Bug: 301119301
Test: `adb shell wm density 300`, then 400 - verify oldDensityDpi and
newDensityDpi reflect 300 and 400 respectively, causing the views to be
released and reinflated.

Change-Id: Id29feb5567cc7f865aa4c158a200d5079f674b31
parent 8f9a09b3
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