am 0a7936b7: Merge "Fix a couple of issues with system_server forking."

* commit '0a7936b7c54fb7dff0406a40452cb0242f66a067':
  Fix a couple of issues with system_server forking.
This commit is contained in:
Narayan Kamath
2015-02-19 10:23:57 +00:00
committed by Android Git Automerger
2 changed files with 13 additions and 9 deletions

View File

@@ -399,7 +399,7 @@ class ZygoteConnection {
throws IllegalArgumentException {
int curArg = 0;
boolean seenRuntimeArgs = true;
boolean seenRuntimeArgs = false;
for ( /* curArg */ ; curArg < args.length; curArg++) {
String arg = args[curArg];
@@ -533,14 +533,18 @@ class ZygoteConnection {
}
}
if (!seenRuntimeArgs) {
throw new IllegalArgumentException("Unexpected argument : " + args[curArg]);
if (abiListQuery) {
if (args.length - curArg > 0) {
throw new IllegalArgumentException("Unexpected arguments after --query-abi-list.");
}
} else {
if (!seenRuntimeArgs) {
throw new IllegalArgumentException("Unexpected argument : " + args[curArg]);
}
remainingArgs = new String[args.length - curArg];
System.arraycopy(args, curArg, remainingArgs, 0, remainingArgs.length);
}
remainingArgs = new String[args.length - curArg];
System.arraycopy(args, curArg, remainingArgs, 0,
remainingArgs.length);
}
}

View File

@@ -504,8 +504,8 @@ public class ZygoteInit {
"--setgid=1000",
"--setgroups=1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1018,1032,3001,3002,3003,3006,3007",
"--capabilities=" + capabilities + "," + capabilities,
"--runtime-init",
"--nice-name=system_server",
"--runtime-args",
"com.android.server.SystemServer",
};
ZygoteConnection.Arguments parsedArgs = null;