From 39133c38bcd9d57d48367aceed14381d23d5936c Mon Sep 17 00:00:00 2001 From: Fengjiang Li Date: Wed, 27 Sep 2023 13:23:22 -0700 Subject: [PATCH] Lower thread priority to pre-inflate BubbleTextView for all apps During sys health review it was called out that we could lower the thread priority to pre-inflate BubbleTextView so that ui thread and loader task thread has better chance to run on big core. Bug: 297352492 Test: Grabbed perfetto trace and observed preinflation is run on "preinflate-allapps-icons" thread Change-Id: I9330d4fbe5a98cdb793e8bfa970dfd84ae1f6c39 --- src/com/android/launcher3/util/Executors.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/util/Executors.java b/src/com/android/launcher3/util/Executors.java index dec4b5ca8d..07000ed054 100644 --- a/src/com/android/launcher3/util/Executors.java +++ b/src/com/android/launcher3/util/Executors.java @@ -15,6 +15,8 @@ */ package com.android.launcher3.util; +import static android.os.Process.THREAD_PRIORITY_BACKGROUND; + import android.os.HandlerThread; import android.os.Looper; import android.os.Process; @@ -62,7 +64,9 @@ public class Executors { /** A background executor to preinflate views. */ public static final ExecutorService VIEW_PREINFLATION_EXECUTOR = - java.util.concurrent.Executors.newSingleThreadExecutor(); + java.util.concurrent.Executors.newSingleThreadExecutor( + new SimpleThreadFactory( + "preinflate-allapps-icons", THREAD_PRIORITY_BACKGROUND)); /** * Utility method to get a started handler thread statically