OSDN Git Service

Do not start jit profile in app zygote
authorBo Liu <boliu@google.com>
Fri, 5 Apr 2019 18:54:52 +0000 (14:54 -0400)
committerBo Liu <boliu@google.com>
Fri, 5 Apr 2019 18:58:03 +0000 (14:58 -0400)
Bug: 130031692
Test: Scenario in bug works.
Change-Id: Ia28e8fc60cdf4afd2215b9f2239ca215694fc76c

core/java/android/app/LoadedApk.java

index 25e3573..e16ce24 100644 (file)
@@ -937,7 +937,9 @@ public final class LoadedApk {
         //
         // It is NOT ok to call this function from the system_server (for any of the packages it
         // loads code from) so we explicitly disallow it there.
-        if (needToSetupJitProfiles && !ActivityThread.isSystem()) {
+        //
+        // It is not ok to call this in a zygote context where mActivityThread is null.
+        if (needToSetupJitProfiles && !ActivityThread.isSystem() && mActivityThread != null) {
             setupJitProfileSupport();
         }