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

Skip to content
Commit 0f439a1c authored by Menghan Li's avatar Menghan Li
Browse files

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
parent 12f4df91
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment