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

Commit d91f7f4e authored by Sergio Giro's avatar Sergio Giro Committed by android-build-merger
Browse files

Merge "ZygoteInit: warm up JCA providers during preload" am: aa733e0b am:...

Merge "ZygoteInit: warm up JCA providers during preload" am: aa733e0b am: ef42102c am: 9d95ab47
am: 093adbb3

* commit '093adbb3':
  ZygoteInit: warm up JCA providers during preload

Change-Id: Ib039242b086ee995e9428db043cce47a13860cba
parents e354dbdb 093adbb3
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -240,6 +240,24 @@ public class ZygoteInit {
        Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
    }

    /**
     * Warm up the providers that are already registered.
     *
     * By doing it here we avoid that each app does it when requesting a service from the
     * provider for the first time.
     */
    private static void warmUpJcaProviders() {
        long startTime = SystemClock.uptimeMillis();
        Trace.traceBegin(
                Trace.TRACE_TAG_DALVIK, "Starting warm up of JCA providers");
        for (Provider p : Security.getProviders()) {
            p.warmUpServiceProvision();
        }
        Log.i(TAG, "Warmed up JCA providers in "
                + (SystemClock.uptimeMillis()-startTime) + "ms.");
        Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
    }

    /**
     * Performs Zygote process initialization. Loads and initializes
     * commonly used classes.