mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 23:36:47 +00:00
Merge "If COLD startup occurs while launcher is backgrounded, do not wait until user goes to home to end startup session." into main
This commit is contained in:
@@ -2595,26 +2595,24 @@ public class Launcher extends StatefulActivity<LauncherState>
|
||||
Trace.endAsyncSection(DISPLAY_WORKSPACE_TRACE_METHOD_NAME,
|
||||
DISPLAY_WORKSPACE_TRACE_COOKIE);
|
||||
}
|
||||
mStartupLatencyLogger
|
||||
.logCardinality(workspaceItemCount)
|
||||
.logEnd(isBindSync
|
||||
? LAUNCHER_LATENCY_STARTUP_WORKSPACE_LOADER_SYNC
|
||||
: LAUNCHER_LATENCY_STARTUP_WORKSPACE_LOADER_ASYNC);
|
||||
// In the first rootview's onDraw after onInitialBindComplete(), log end of startup latency.
|
||||
MAIN_EXECUTOR.getHandler().postAtFrontOfQueue(() -> {
|
||||
mStartupLatencyLogger
|
||||
.logCardinality(workspaceItemCount)
|
||||
.logEnd(isBindSync
|
||||
? LAUNCHER_LATENCY_STARTUP_WORKSPACE_LOADER_SYNC
|
||||
: LAUNCHER_LATENCY_STARTUP_WORKSPACE_LOADER_ASYNC)
|
||||
.logEnd(LAUNCHER_LATENCY_STARTUP_TOTAL_DURATION)
|
||||
.log()
|
||||
.reset();
|
||||
if (mIsColdStartupAfterReboot) {
|
||||
Trace.endAsyncSection(COLD_STARTUP_TRACE_METHOD_NAME,
|
||||
COLD_STARTUP_TRACE_COOKIE);
|
||||
}
|
||||
});
|
||||
getRootView().getViewTreeObserver().addOnDrawListener(
|
||||
new ViewTreeObserver.OnDrawListener() {
|
||||
|
||||
@Override
|
||||
public void onDraw() {
|
||||
mStartupLatencyLogger
|
||||
.logEnd(LAUNCHER_LATENCY_STARTUP_TOTAL_DURATION)
|
||||
.log()
|
||||
.reset();
|
||||
if (mIsColdStartupAfterReboot) {
|
||||
Trace.endAsyncSection(COLD_STARTUP_TRACE_METHOD_NAME,
|
||||
COLD_STARTUP_TRACE_COOKIE);
|
||||
}
|
||||
|
||||
MAIN_EXECUTOR.getHandler().postAtFrontOfQueue(
|
||||
() -> getRootView().getViewTreeObserver()
|
||||
.removeOnDrawListener(this));
|
||||
|
||||
Reference in New Issue
Block a user