summaryrefslogtreecommitdiff
path: root/libs/androidfw/FileStream.cpp
diff options
context:
space:
mode:
author Jorge Gil <jorgegil@google.com> 2023-09-20 05:40:40 +0000
committer Jorge Gil <jorgegil@google.com> 2023-09-20 05:40:40 +0000
commitbbe3d7d21245d846585f5a24fa06f24fec8fcf62 (patch)
tree8972ca1faf9ba23d8e0151da28716a9954190715 /libs/androidfw/FileStream.cpp
parent8f9a09b318ececa093b70f453246acc6b25c9f0d (diff)
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
Diffstat (limited to 'libs/androidfw/FileStream.cpp')
0 files changed, 0 insertions, 0 deletions