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

Commit 1c0bc075 authored by Yisroel Forta's avatar Yisroel Forta
Browse files

Add zygote fork timestamp to AppStartInfo

This works out to be slightly before forCommon (~3ms in local testing) which is accuarate enough.

Test: trigger start, confirm timestamp added
Bug: 287153617
Flag: android.app.app_start_info_timestamps
Change-Id: If21ee2da9bf5a55cacac357029625a45d3e733c1
parent f35573ce
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ import android.app.AppProtoEnums;
import android.app.ApplicationExitInfo;
import android.app.ApplicationExitInfo.Reason;
import android.app.ApplicationExitInfo.SubReason;
import android.app.ApplicationStartInfo;
import android.app.IApplicationThread;
import android.app.IProcessObserver;
import android.app.UidObserver;
@@ -2479,6 +2480,7 @@ public final class ProcessList {
            boolean regularZygote = false;
            app.mProcessGroupCreated = false;
            app.mSkipProcessGroupCreation = false;
            long forkTimeNs = SystemClock.uptimeNanos();
            if (hostingRecord.usesWebviewZygote()) {
                startResult = startWebView(entryPoint,
                        app.processName, uid, uid, gids, runtimeFlags, mountExternal,
@@ -2512,6 +2514,11 @@ public final class ProcessList {
                app.mProcessGroupCreated = true;
            }

            if (android.app.Flags.appStartInfoTimestamps()) {
                mAppStartInfoTracker.addTimestampToStart(app, forkTimeNs,
                        ApplicationStartInfo.START_TIMESTAMP_FORK);
            }

            if (!regularZygote) {
                // webview and app zygote don't have the permission to create the nodes
                synchronized (app) {