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
Loading
Please register or sign in to comment