[kairos] optimize StateScope.takeUntil
Previously, takeUntil (and nextOnly) would die once the stop signal emitted. If the signal being truncated ends *before* the stop signal emits, then takeUntil would remain alive; Kairos has no way of knowing that the stop signal wouldn't switch-in a different, live Events. This change optimizes takeUntil so that it dies once the stop signal emits, *or* if the truncated events dies, whichever occurs first. This is accomplished by leveraging the internal lifetime management of state scopes, which is implemented specifically for efficiently tracking stop signals. Flag: com.android.systemui.status_bar_mobile_icon_kairos Bug: 383172066 Test: atest Change-Id: I3d379efb377c2bdb6e6ae333aca4534a4a6cce4f
Loading
Please register or sign in to comment