Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39133c38 authored by Fengjiang Li's avatar Fengjiang Li
Browse files

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
parent 4fc16ab2
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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