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