Store scopeToCancel.

Without this the scope that gets cancelled can be the new one after re-attaching. This results in no flows working - hence blank thumbnails.

Fix: 369590189
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Test: Manual - visually verified
Change-Id: Ie930d890095c30c4be8e87c795a06383ac06ea9e
This commit is contained in:
Uwais Ashraf
2024-12-30 08:34:07 +00:00
parent 70e443cde8
commit 7b2c441d45
@@ -127,8 +127,9 @@ class TaskThumbnailView : FrameLayout, ViewPool.Reusable {
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
val scopeToCancel = viewAttachedScope
recentsCoroutineScope.launch(dispatcherProvider.background) {
viewAttachedScope.cancel("TaskThumbnailView detaching from window")
scopeToCancel.cancel("TaskThumbnailView detaching from window")
}
}