diff options
| author | 2025-02-04 07:21:41 +0000 | |
|---|---|---|
| committer | 2025-02-06 12:41:43 -0800 | |
| commit | 0f439a1ce073b887990ee1e54862208d566acfdb (patch) | |
| tree | b6a901970afb11b83ff518c88dbe38a8218c78ca /libs/androidfw/Png.cpp | |
| parent | 12f4df911338c2e8c3873ce5e09a19792902a33a (diff) | |
fix(EDT) Correct caching of ForceInvertState
Root cause: The getForceInvertStateLocked function failed to update
the cache because the underlying "get" function returned 0 when a key
was not found. This 0 value conflicted with valid FORCE_INVERT_TYPE_OFF
state, preventing the cache from recognizing a new value and updating.
This also blocked the indexOfKey initialization, leading to repeated
calls to getForceInvertStateLocked.
Solution: The "get" function's default return value for unfound keys
was changed to a non-zero value. This allows the cache to correctly
distinguish between a "not found" condition and FORCE_INVERT_TYPE_OFF
state, enabling proper cache updates, completing initialization, and
preventing redundant calls to getForceInvertStateLocked.
Bug: 393829725
Bug: 393843555
Flag: android.view.accessibility.force_invert_color
Test: Tested the forced dark theme by enabling both system and
app-level dark mode, verifying that the view correctly cached and
displayed the forced dark theme. And then disabled dark mode and
repeated the test.
Change-Id: I8535cad0157b0e95ca1dbe79de415d6c22f511de
Diffstat (limited to 'libs/androidfw/Png.cpp')
0 files changed, 0 insertions, 0 deletions