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

Commit f644021a authored by Steve Elliott's avatar Steve Elliott
Browse files

[kairos] Fix casting error in ActivatedKairosSpec

The `uninit` value is used as a sentinel to determine if the kairos spec
is currently active. If the state is not the same instance as `uninit`,
then we know that it is the value returned from the spec activation, and
so we can safely cast it.

The bug: `uninit` is a different instance when recomponsing, and so the
instance equality check fails, even though the value is *not* an
instance of `T`. This causes the cast to fail, which crashes the
process.

The solution: make `uninit` a private singleton that lives outside of
the composition. There will only ever be a single instance, and so the
instance equality check will now suffice.

Flag: com.android.systemui.status_bar_mobile_icon_kairos
Bug: 383172066
Change-Id: I57d06aba0e6d5b11ee13990eb78f7065314a5500
parent 62fbd662
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