Merge "Removes unused code from the SystemServer/Zygote classes." into qt-dev

This commit is contained in:
Christian Wailes
2019-06-12 19:45:41 +00:00
committed by Android (Google) Code Review
4 changed files with 6 additions and 33 deletions

View File

@@ -511,7 +511,6 @@ public class Process {
* @param appDataDir null-ok the data directory of the app. * @param appDataDir null-ok the data directory of the app.
* @param invokeWith null-ok the command to invoke with. * @param invokeWith null-ok the command to invoke with.
* @param packageName null-ok the name of the package this process belongs to. * @param packageName null-ok the name of the package this process belongs to.
* @param useSystemGraphicsDriver whether the process uses system graphics driver.
* *
* @param zygoteArgs Additional arguments to supply to the zygote process. * @param zygoteArgs Additional arguments to supply to the zygote process.
* @return An object that describes the result of the attempt to start the process. * @return An object that describes the result of the attempt to start the process.
@@ -531,13 +530,11 @@ public class Process {
@Nullable String appDataDir, @Nullable String appDataDir,
@Nullable String invokeWith, @Nullable String invokeWith,
@Nullable String packageName, @Nullable String packageName,
boolean useSystemGraphicsDriver,
@Nullable String[] zygoteArgs) { @Nullable String[] zygoteArgs) {
return ZYGOTE_PROCESS.start(processClass, niceName, uid, gid, gids, return ZYGOTE_PROCESS.start(processClass, niceName, uid, gid, gids,
runtimeFlags, mountExternal, targetSdkVersion, seInfo, runtimeFlags, mountExternal, targetSdkVersion, seInfo,
abi, instructionSet, appDataDir, invokeWith, packageName, abi, instructionSet, appDataDir, invokeWith, packageName,
/*useUsapPool=*/ true, /*useUsapPool=*/ true, zygoteArgs);
useSystemGraphicsDriver, zygoteArgs);
} }
/** @hide */ /** @hide */
@@ -553,13 +550,11 @@ public class Process {
@Nullable String appDataDir, @Nullable String appDataDir,
@Nullable String invokeWith, @Nullable String invokeWith,
@Nullable String packageName, @Nullable String packageName,
boolean useSystemGraphicsDriver,
@Nullable String[] zygoteArgs) { @Nullable String[] zygoteArgs) {
return WebViewZygote.getProcess().start(processClass, niceName, uid, gid, gids, return WebViewZygote.getProcess().start(processClass, niceName, uid, gid, gids,
runtimeFlags, mountExternal, targetSdkVersion, seInfo, runtimeFlags, mountExternal, targetSdkVersion, seInfo,
abi, instructionSet, appDataDir, invokeWith, packageName, abi, instructionSet, appDataDir, invokeWith, packageName,
/*useUsapPool=*/ false, /*useUsapPool=*/ false, zygoteArgs);
useSystemGraphicsDriver, zygoteArgs);
} }
/** /**

View File

@@ -307,7 +307,6 @@ public class ZygoteProcess {
* @param invokeWith null-ok the command to invoke with. * @param invokeWith null-ok the command to invoke with.
* @param packageName null-ok the name of the package this process belongs to. * @param packageName null-ok the name of the package this process belongs to.
* @param zygoteArgs Additional arguments to supply to the zygote process. * @param zygoteArgs Additional arguments to supply to the zygote process.
* @param useSystemGraphicsDriver whether the process uses system graphics driver.
* *
* @return An object that describes the result of the attempt to start the process. * @return An object that describes the result of the attempt to start the process.
* @throws RuntimeException on fatal start failure * @throws RuntimeException on fatal start failure
@@ -324,7 +323,6 @@ public class ZygoteProcess {
@Nullable String invokeWith, @Nullable String invokeWith,
@Nullable String packageName, @Nullable String packageName,
boolean useUsapPool, boolean useUsapPool,
boolean useSystemGraphicsDriver,
@Nullable String[] zygoteArgs) { @Nullable String[] zygoteArgs) {
// TODO (chriswailes): Is there a better place to check this value? // TODO (chriswailes): Is there a better place to check this value?
if (fetchUsapPoolEnabledPropWithMinInterval()) { if (fetchUsapPoolEnabledPropWithMinInterval()) {
@@ -335,7 +333,7 @@ public class ZygoteProcess {
return startViaZygote(processClass, niceName, uid, gid, gids, return startViaZygote(processClass, niceName, uid, gid, gids,
runtimeFlags, mountExternal, targetSdkVersion, seInfo, runtimeFlags, mountExternal, targetSdkVersion, seInfo,
abi, instructionSet, appDataDir, invokeWith, /*startChildZygote=*/ false, abi, instructionSet, appDataDir, invokeWith, /*startChildZygote=*/ false,
packageName, useUsapPool, useSystemGraphicsDriver, zygoteArgs); packageName, useUsapPool, zygoteArgs);
} catch (ZygoteStartFailedEx ex) { } catch (ZygoteStartFailedEx ex) {
Log.e(LOG_TAG, Log.e(LOG_TAG,
"Starting VM process through Zygote failed"); "Starting VM process through Zygote failed");
@@ -554,7 +552,6 @@ public class ZygoteProcess {
boolean startChildZygote, boolean startChildZygote,
@Nullable String packageName, @Nullable String packageName,
boolean useUsapPool, boolean useUsapPool,
boolean useSystemGraphicsDriver,
@Nullable String[] extraArgs) @Nullable String[] extraArgs)
throws ZygoteStartFailedEx { throws ZygoteStartFailedEx {
ArrayList<String> argsForZygote = new ArrayList<>(); ArrayList<String> argsForZygote = new ArrayList<>();
@@ -636,7 +633,7 @@ public class ZygoteProcess {
// The USAP pool can not be used if the application will not use the systems graphics // 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. // driver. If that driver is requested use the Zygote application start path.
return zygoteSendArgsAndGetResult(openZygoteSocketIfNeeded(abi), return zygoteSendArgsAndGetResult(openZygoteSocketIfNeeded(abi),
useUsapPool && useSystemGraphicsDriver, useUsapPool,
argsForZygote); argsForZygote);
} }
} }
@@ -1147,8 +1144,7 @@ public class ZygoteProcess {
gids, runtimeFlags, 0 /* mountExternal */, 0 /* targetSdkVersion */, seInfo, gids, runtimeFlags, 0 /* mountExternal */, 0 /* targetSdkVersion */, seInfo,
abi, instructionSet, null /* appDataDir */, null /* invokeWith */, abi, instructionSet, null /* appDataDir */, null /* invokeWith */,
true /* startChildZygote */, null /* packageName */, true /* startChildZygote */, null /* packageName */,
false /* useUsapPool */, false /*useSystemGraphicsDriver*/, false /* useUsapPool */, extraArgs);
extraArgs);
} catch (ZygoteStartFailedEx ex) { } catch (ZygoteStartFailedEx ex) {
throw new RuntimeException("Starting child-zygote through Zygote failed", ex); throw new RuntimeException("Starting child-zygote through Zygote failed", ex);
} }

View File

@@ -512,9 +512,6 @@ public final class Zygote {
Credentials peerCredentials = null; Credentials peerCredentials = null;
ZygoteArguments args = null; ZygoteArguments args = null;
// Load resources
ZygoteInit.nativePreloadGraphicsDriver();
while (true) { while (true) {
try { try {
sessionSocket = usapPoolSocket.accept(); sessionSocket = usapPoolSocket.accept();

View File

@@ -63,7 +63,6 @@ import android.os.AppZygote;
import android.os.Binder; import android.os.Binder;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.GraphicsEnvironment;
import android.os.Handler; import android.os.Handler;
import android.os.IBinder; import android.os.IBinder;
import android.os.Looper; import android.os.Looper;
@@ -705,16 +704,6 @@ public final class ProcessList {
return prefix + "+" + Integer.toString(diff); return prefix + "+" + Integer.toString(diff);
} }
private static boolean shouldUseSystemGraphicsDriver(Context context, Bundle coreSettings,
ApplicationInfo applicationInfo) {
final boolean shouldUseGameDriver =
GraphicsEnvironment.shouldUseGameDriver(context, coreSettings, applicationInfo);
final boolean shouldUseAngle =
GraphicsEnvironment.shouldUseAngle(context, coreSettings,
applicationInfo.packageName);
return !shouldUseGameDriver && !shouldUseAngle;
}
public static String makeOomAdjString(int setAdj, boolean compact) { public static String makeOomAdjString(int setAdj, boolean compact) {
if (setAdj >= ProcessList.CACHED_APP_MIN_ADJ) { if (setAdj >= ProcessList.CACHED_APP_MIN_ADJ) {
return buildOomTag("cch", "cch", " ", setAdj, return buildOomTag("cch", "cch", " ", setAdj,
@@ -1811,8 +1800,6 @@ public final class ProcessList {
String seInfo, String requiredAbi, String instructionSet, String invokeWith, String seInfo, String requiredAbi, String instructionSet, String invokeWith,
long startTime) { long startTime) {
try { try {
final boolean useSystemGraphicsDriver = shouldUseSystemGraphicsDriver(mService.mContext,
mService.mCoreSettingsObserver.getCoreSettingsLocked(), app.info);
Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "Start proc: " + Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "Start proc: " +
app.processName); app.processName);
checkSlow(startTime, "startProcess: asking zygote to start proc"); checkSlow(startTime, "startProcess: asking zygote to start proc");
@@ -1822,7 +1809,6 @@ public final class ProcessList {
app.processName, uid, uid, gids, runtimeFlags, mountExternal, app.processName, uid, uid, gids, runtimeFlags, mountExternal,
app.info.targetSdkVersion, seInfo, requiredAbi, instructionSet, app.info.targetSdkVersion, seInfo, requiredAbi, instructionSet,
app.info.dataDir, null, app.info.packageName, app.info.dataDir, null, app.info.packageName,
useSystemGraphicsDriver,
new String[] {PROC_START_SEQ_IDENT + app.startSeq}); new String[] {PROC_START_SEQ_IDENT + app.startSeq});
} else if (hostingRecord.usesAppZygote()) { } else if (hostingRecord.usesAppZygote()) {
final AppZygote appZygote = createAppZygoteForProcessIfNeeded(app); final AppZygote appZygote = createAppZygoteForProcessIfNeeded(app);
@@ -1831,14 +1817,13 @@ public final class ProcessList {
app.processName, uid, uid, gids, runtimeFlags, mountExternal, app.processName, uid, uid, gids, runtimeFlags, mountExternal,
app.info.targetSdkVersion, seInfo, requiredAbi, instructionSet, app.info.targetSdkVersion, seInfo, requiredAbi, instructionSet,
app.info.dataDir, null, app.info.packageName, app.info.dataDir, null, app.info.packageName,
/*useUsapPool=*/ false, useSystemGraphicsDriver, /*useUsapPool=*/ false,
new String[] {PROC_START_SEQ_IDENT + app.startSeq}); new String[] {PROC_START_SEQ_IDENT + app.startSeq});
} else { } else {
startResult = Process.start(entryPoint, startResult = Process.start(entryPoint,
app.processName, uid, uid, gids, runtimeFlags, mountExternal, app.processName, uid, uid, gids, runtimeFlags, mountExternal,
app.info.targetSdkVersion, seInfo, requiredAbi, instructionSet, app.info.targetSdkVersion, seInfo, requiredAbi, instructionSet,
app.info.dataDir, invokeWith, app.info.packageName, app.info.dataDir, invokeWith, app.info.packageName,
useSystemGraphicsDriver,
new String[] {PROC_START_SEQ_IDENT + app.startSeq}); new String[] {PROC_START_SEQ_IDENT + app.startSeq});
} }
checkSlow(startTime, "startProcess: returned from zygote!"); checkSlow(startTime, "startProcess: returned from zygote!");