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

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

Merge "ZygoteInit: install AndroidKeyStoreProvider in the Zygote"

am: 393b67d6

* commit '393b67d6':
  ZygoteInit: install AndroidKeyStoreProvider in the Zygote

Change-Id: Idc8e1ca4ae2160285fe56995290c241c3a7288f2
parents f55c9f7a 393b67d6
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -98,7 +98,6 @@ import android.view.Window;
import android.view.WindowManager;
import android.view.WindowManagerGlobal;
import android.renderscript.RenderScriptCacheDir;
import android.security.keystore.AndroidKeyStoreProvider;
import android.system.Os;
import android.system.OsConstants;
import android.system.ErrnoException;
@@ -5461,8 +5460,6 @@ public final class ActivityThread {
        // Set the reporter for event logging in libcore
        EventLogger.setReporter(new EventLoggingReporter());

        AndroidKeyStoreProvider.install();

        // Make sure TrustedCertificateStore looks in the right place for CA certificates
        final File configDir = Environment.getUserConfigDirectory(UserHandle.myUserId());
        TrustedCertificateStore.setDefaultUserDirectory(configDir);
+14 −2
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.os.Process;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.Trace;
import android.security.keystore.AndroidKeyStoreProvider;
import android.system.ErrnoException;
import android.system.Os;
import android.system.OsConstants;
@@ -247,13 +248,24 @@ public class ZygoteInit {
    }

    /**
     * Warm up the providers that are already registered.
     * Register AndroidKeyStoreProvider and 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 installation of AndroidKeyStoreProvider");
        // AndroidKeyStoreProvider.install() manipulates the list of JCA providers to insert
        // preferred providers. Note this is not done via security.properties as the JCA providers
        // are not on the classpath in the case of, for example, raw dalvikvm runtimes.
        AndroidKeyStoreProvider.install();
        Log.i(TAG, "Installed AndroidKeyStoreProvider in "
                + (SystemClock.uptimeMillis() - startTime) + "ms.");
        Trace.traceEnd(Trace.TRACE_TAG_DALVIK);

        startTime = SystemClock.uptimeMillis();
        Trace.traceBegin(
                Trace.TRACE_TAG_DALVIK, "Starting warm up of JCA providers");
        for (Provider p : Security.getProviders()) {