Don't launch a coroutine job if no jobs to cancel
Flag: com.android.launcher3.enable_coroutine_threading_improvements Bug: 417598777 Test: Presubmits Change-Id: I474e3e12faf2886b593571e9625a1d16df742c0d
This commit is contained in:
@@ -952,7 +952,9 @@ constructor(
|
||||
// onAttach or another moment in the lifecycle.
|
||||
val coroutineJobsToCancel = coroutineJobs.toList()
|
||||
coroutineJobs.clear()
|
||||
if (enableCoroutineThreadingImprovements() && coroutineJobsToCancel.isNotEmpty()) {
|
||||
if (coroutineJobsToCancel.isEmpty()) return
|
||||
|
||||
if (enableCoroutineThreadingImprovements()) {
|
||||
// TODO(b/391842220): This should ideally be handled in the completion block of the
|
||||
// jobs above to be cancelled.
|
||||
taskContainers.forEach {
|
||||
|
||||
Reference in New Issue
Block a user