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

Commit 76869970 authored by Fengjiang Li's avatar Fengjiang Li
Browse files

[Launcher Jank] Schedule LauncherApps#getAppUsageLimit on single bg thread

b/336326937 shows that getAppUsageLimit is being called a lot and it's scheduled on a thread pool, which is causing quite a lot of contention and should be scheduled on a single thread

Fix: 336326937
Flag: NONE
Test: presubmit
Change-Id: Ie041e72f2bff9f5d2dbfa4ce3c63a4bb2e5b08d4
parent 77d3524b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ package com.android.quickstep.views;
import static android.provider.Settings.ACTION_APP_USAGE_SETTINGS;

import static com.android.launcher3.Utilities.prefixTextWithIcon;
import static com.android.launcher3.util.Executors.THREAD_POOL_EXECUTOR;
import static com.android.launcher3.util.Executors.ORDERED_BG_EXECUTOR;

import android.app.ActivityOptions;
import android.content.ActivityNotFoundException;
@@ -140,7 +140,7 @@ public final class DigitalWellBeingToast {
    public void initialize(Task task) {
        mAppUsageLimitTimeMs = mAppRemainingTimeMs = -1;
        mTask = task;
        THREAD_POOL_EXECUTOR.execute(() -> {
        ORDERED_BG_EXECUTOR.execute(() -> {
                    AppUsageLimit usageLimit = null;
                    try {
                        usageLimit = mLauncherApps.getAppUsageLimit(