summaryrefslogtreecommitdiff
path: root/core/java/android/os/ZygoteProcess.java
diff options
context:
space:
mode:
authorChris Wailes <chriswailes@google.com>2019-04-17 17:55:48 -0700
committerChristian Wailes <chriswailes@google.com>2019-04-24 17:43:15 +0000
commit35fdbc570b4e905bcaa7892b70bd074894384cc5 (patch)
tree73ff96ad5858abd2ab8765888ae5cb12fc17f3c7 /core/java/android/os/ZygoteProcess.java
parentdc7de2711341126b11529c46b2bab56aae994f91 (diff)
Load the default graphics driver in USAPs.
This patch causes unspecialized app processes to load the OpenGL driver after they are forked. The ZygoteProcess code will then take an application's driver preference into account when selecting how to launch it. Test: m & boot & launch & inspect traces for driver loading Bug: 130029351 Change-Id: If6fa02f9c387596162e75a685b04208b45a5c86b Merged-In: If6fa02f9c387596162e75a685b04208b45a5c86b (cherry picked from commit 301a1c46da930bb927bd86227c6e1d44c70c349d)
Diffstat (limited to 'core/java/android/os/ZygoteProcess.java')
-rw-r--r--core/java/android/os/ZygoteProcess.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/core/java/android/os/ZygoteProcess.java b/core/java/android/os/ZygoteProcess.java
index b7789c0c2857..db7c22937ceb 100644
--- a/core/java/android/os/ZygoteProcess.java
+++ b/core/java/android/os/ZygoteProcess.java
@@ -327,8 +327,8 @@ public class ZygoteProcess {
@Nullable String[] packagesForUid,
@Nullable String sandboxId,
boolean useUsapPool,
- @Nullable String[] zygoteArgs,
- boolean useSystemGraphicsDriver) {
+ boolean useSystemGraphicsDriver,
+ @Nullable String[] zygoteArgs) {
// TODO (chriswailes): Is there a better place to check this value?
if (fetchUsapPoolEnabledPropWithMinInterval()) {
informZygotesOfUsapPoolStatus();
@@ -339,7 +339,7 @@ public class ZygoteProcess {
runtimeFlags, mountExternal, targetSdkVersion, seInfo,
abi, instructionSet, appDataDir, invokeWith, /*startChildZygote=*/ false,
packageName, packagesForUid, sandboxId,
- useUsapPool, zygoteArgs);
+ useUsapPool, useSystemGraphicsDriver, zygoteArgs);
} catch (ZygoteStartFailedEx ex) {
Log.e(LOG_TAG,
"Starting VM process through Zygote failed");
@@ -548,7 +548,8 @@ public class ZygoteProcess {
@Nullable String packageName,
@Nullable String[] packagesForUid,
@Nullable String sandboxId,
- boolean useUnspecializedAppProcessPool,
+ boolean useUsapPool,
+ boolean useSystemGraphicsDriver,
@Nullable String[] extraArgs)
throws ZygoteStartFailedEx {
ArrayList<String> argsForZygote = new ArrayList<>();
@@ -635,8 +636,10 @@ public class ZygoteProcess {
}
synchronized(mLock) {
+ // The USAP pool can not be used if the application will not use the systems graphics
+ // driver. If that driver is requested use the Zygote application start path.
return zygoteSendArgsAndGetResult(openZygoteSocketIfNeeded(abi),
- useUnspecializedAppProcessPool,
+ useUsapPool && useSystemGraphicsDriver,
argsForZygote);
}
}
@@ -1141,7 +1144,8 @@ public class ZygoteProcess {
abi, instructionSet, null /* appDataDir */, null /* invokeWith */,
true /* startChildZygote */, null /* packageName */,
null /* packagesForUid */, null /* sandboxId */,
- false /* useUsapPool */, extraArgs);
+ false /* useUsapPool */, false /*useSystemGraphicsDriver*/,
+ extraArgs);
} catch (ZygoteStartFailedEx ex) {
throw new RuntimeException("Starting child-zygote through Zygote failed", ex);
}