summaryrefslogtreecommitdiffstats
path: root/core/java/com
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2015-02-19 10:17:31 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-02-19 10:17:32 +0000
commit0a7936b7c54fb7dff0406a40452cb0242f66a067 (patch)
treececc9a97a65fd2b47ff86b99dc245e8f733c3e49 /core/java/com
parente460f88d37ce035718987b9424190956a6bba52f (diff)
parentb6b044ae8263d1104e249ad2b857f0c570309990 (diff)
downloadframeworks_base-0a7936b7c54fb7dff0406a40452cb0242f66a067.zip
frameworks_base-0a7936b7c54fb7dff0406a40452cb0242f66a067.tar.gz
frameworks_base-0a7936b7c54fb7dff0406a40452cb0242f66a067.tar.bz2
Merge "Fix a couple of issues with system_server forking."
Diffstat (limited to 'core/java/com')
-rw-r--r--core/java/com/android/internal/os/ZygoteConnection.java20
-rw-r--r--core/java/com/android/internal/os/ZygoteInit.java2
2 files changed, 13 insertions, 9 deletions
diff --git a/core/java/com/android/internal/os/ZygoteConnection.java b/core/java/com/android/internal/os/ZygoteConnection.java
index c9b44be..a55fe9a 100644
--- a/core/java/com/android/internal/os/ZygoteConnection.java
+++ b/core/java/com/android/internal/os/ZygoteConnection.java
@@ -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]);
- }
-
- remainingArgs = new String[args.length - 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]);
+ }
- System.arraycopy(args, curArg, remainingArgs, 0,
- remainingArgs.length);
+ remainingArgs = new String[args.length - curArg];
+ System.arraycopy(args, curArg, remainingArgs, 0, remainingArgs.length);
+ }
}
}
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java
index 98c2a11..98638ed 100644
--- a/core/java/com/android/internal/os/ZygoteInit.java
+++ b/core/java/com/android/internal/os/ZygoteInit.java
@@ -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;