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

Commit 6674924c authored by Ale Nijamkin's avatar Ale Nijamkin
Browse files

[flexiglass] rememberViewModel uses lifecycle

Defaults to STARTED, which is more than CREATED and less than RESUMED.

Without passing anything in, this means that content that's always
composed (which stays in CREATED while invisible and switches to RESUMED
when visible), will only activate view-models once visible, by default.

The caller of rememberViewModel can override with CREATED (so
even invisible content activates the view-model), as needed.

Note the quasi-telescoping approach where we now have several flavours
of rememberViewModel, each one taking a combination of minActiveState
and key. This makes sure that this change is forward compatible (as only
some callers currently pass a key but most don't) while also freeing new
callers to pass only minActiveState or both - all without confusing the
compiler to mistake minActiveState for the key.

Fix: 432549544
Test: manually verified that restarting the phone or crashing and
restarting System UI no longer snaps to QS, even if it's always composed
Test: manually verified that QS scene and overlay are both interactive
(respond to touch) when alwaysCompose=true for them (see followup CL)
Flag: com.android.systemui.scene_container

Change-Id: I8c5e524e3bb110cb477f255601268c40d997e9ce
parent f6a7b72c
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