From 2834af0cdb8eb4b6b86cba96c5aaadbca01ec72a Mon Sep 17 00:00:00 2001 From: Uwais Ashraf Date: Fri, 30 May 2025 11:40:36 -0700 Subject: [PATCH] Change bg Coroutine dispatchers to use single thread. If in future we need to increase this then it will be explicit rather than a surprise with with the first 16 CPU device we encounter. Flag: com.android.launcher3.enable_refactor_task_thumbnail Test: Presubmits Change-Id: I44b71f1c3dde4ca349525630e5d758962dfb8ed9 --- .../android/launcher3/util/coroutines/DispatcherProvider.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/util/coroutines/DispatcherProvider.kt b/src/com/android/launcher3/util/coroutines/DispatcherProvider.kt index b044abc484..a53033d1d3 100644 --- a/src/com/android/launcher3/util/coroutines/DispatcherProvider.kt +++ b/src/com/android/launcher3/util/coroutines/DispatcherProvider.kt @@ -72,12 +72,12 @@ object ProductionDispatchers : DispatcherProvider { override val ioBackground = if (enableCoroutineThreadingImprovements()) - bgDispatcher(nThreads = max(1, availableProcessors / 8), threadName = "LauncherBgIO") + bgDispatcher(nThreads = 1, threadName = "LauncherBgIO") else singleBgThreadPool override val lightweightBackground = if (enableCoroutineThreadingImprovements()) - bgDispatcher(nThreads = max(1, availableProcessors / 8), threadName = "LauncherBgLight") + bgDispatcher(nThreads = 1, threadName = "LauncherBgLight") else singleBgThreadPool override val unconfined = Dispatchers.Unconfined