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

Commit 5fad1b4f authored by Shai Barack's avatar Shai Barack
Browse files

Sleep in ZygoteProcess.start() if ablation study enabled

Bug: 423047108
Flag: android.os.zygote_app_launch_latency_ablation
Change-Id: I3ad679c68ce34ac3397629cdd82d5bf66bccbe89
parent 60957d09
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -360,6 +360,17 @@ public class ZygoteProcess {
                                                  boolean bindMountAppStorageDirs,
                                                  boolean bindOverrideSysprops,
                                                  @Nullable String[] zygoteArgs) {
        if (Flags.zygoteAppLaunchLatencyAblation()) {
            final long sleepUntilMs = System.currentTimeMillis() + 5;
            long nextSleepMs = 5;
            while (nextSleepMs > 0) {
                try {
                    Thread.sleep(nextSleepMs);
                } catch (InterruptedException ignored) {}
                nextSleepMs = sleepUntilMs - System.currentTimeMillis();
            }
        }

        // TODO (chriswailes): Is there a better place to check this value?
        if (fetchUsapPoolEnabledPropWithMinInterval()) {
            informZygotesOfUsapPoolStatus();