[kairos] guard against coroutine cancelation race
A rare edge case can occur where an observer is added to a BuildScope that is mid-cancelation, something which is completely valid. The bug: when adding a completion handler to the build scope's internal coroutine scope, if this scope is mid-cancellation, then the completion handler is invoked immediately. This caused an uninitialized variable `cancelHandle` to be accessed, resulting in a crash. The solution: remove `lateinit`, make `cancelHandle` nullable, perform explicit null checking. Flag: com.android.systemui.status_bar_mobile_icon_kairos Bug: 383172066 Change-Id: Ie6bb938bef13bb7685b50a19241136bcc575512d
Loading
Please register or sign in to comment