summaryrefslogtreecommitdiff
path: root/libs/androidfw/Util.cpp
diff options
context:
space:
mode:
author Alejandro Nijamkin <nijamkin@google.com> 2024-01-26 14:06:09 -0800
committer Alejandro Nijamkin <nijamkin@google.com> 2024-01-26 14:12:03 -0800
commitfe75d5cdff80cd5bb277c38b571003488c24382f (patch)
treefa6c601ff40020eed76d1c3d6df2fb1d34f76b89 /libs/androidfw/Util.cpp
parent417fc153215ee1361f365cc9e515b9212e8a376a (diff)
[flexiglass] Overrides some SysUiState flags.
SysUiState is a central holder of state flags for a lot of System UI, it models state as a collection of "flags" where each flag has a unique integer ID and either a true or false value. The internal modeling uses bitwise operations to keep that state, likely for legacy performance reasons that have since become more Cargo Cult than reality. While it's true that Flexiglass' SceneContainerStartable already actively hydrated SysUiState flags related to current scene and scene switching (for example: shade visible, bouncher showing, etc.), there are other non-Flexiglass classes who also write values for the same flags and, since those classes don't read their own state from Flexiglass, they often provide incorrect state to SysUiState, leading to the current bug related to back navigation from the bouncer. While the full long-term approach is to eliminate SysUiState and convert its state to a collection of repositories and interactors, such a change would be large and risky. This is captured in b/322510930. Instead, a shorter-term approach is used by this CL. We introduce a "plugin" class that knows about Flexiglass and provides "overrides" for flag values. When any other class in the codebase attempts to write values for certain flags in SysUiState, the plugin is consulted to check if Flexiglass has a different value and, if so, the different value is maintained. Test: manually verified, together with the followup CL on this chain, that the bouncer scene's back gesture and button (in 3-button nav mode) actually works as intended - before this CL, there was no back affordance at all. Test: unit tests updated. Bug: 322518343 Bug: 303131743 Flag: ACONFIG com.android.systemui.scene_container DEVELOPMENT Change-Id: I3bf55f10f98fe61dfac689959b6655fecc3c3c62
Diffstat (limited to 'libs/androidfw/Util.cpp')
0 files changed, 0 insertions, 0 deletions