Add tracing to help in launcher load time profiling.

Bug: 195674813
Test: None
Change-Id: I895a64bbba515ce7b7df8d093d40e0a5b6056d2e
This commit is contained in:
Schneider Victor-tulias
2021-08-26 11:56:47 -07:00
parent ca549695aa
commit 927d6dcc6c
2 changed files with 38 additions and 2 deletions

View File

@@ -43,6 +43,7 @@ import android.content.pm.ShortcutInfo;
import android.graphics.Point;
import android.net.Uri;
import android.os.Bundle;
import android.os.Trace;
import android.os.UserHandle;
import android.os.UserManager;
import android.text.TextUtils;
@@ -197,7 +198,12 @@ public class LoaderTask implements Runnable {
TimingLogger logger = new TimingLogger(TAG, "run");
try (LauncherModel.LoaderTransaction transaction = mApp.getModel().beginLoader(this)) {
List<ShortcutInfo> allShortcuts = new ArrayList<>();
loadWorkspace(allShortcuts);
Trace.beginSection("LoadWorkspace");
try {
loadWorkspace(allShortcuts);
} finally {
Trace.endSection();
}
logASplit(logger, "loadWorkspace");
// Sanitize data re-syncs widgets/shortcuts based on the workspace loaded from db.
@@ -225,7 +231,13 @@ public class LoaderTask implements Runnable {
verifyNotStopped();
// second step
List<LauncherActivityInfo> allActivityList = loadAllApps();
Trace.beginSection("LoadAllApps");
List<LauncherActivityInfo> allActivityList;
try {
allActivityList = loadAllApps();
} finally {
Trace.endSection();
}
logASplit(logger, "loadAllApps");
verifyNotStopped();