Merge "Choose the right executable for wrapped applications."
This commit is contained in:
@@ -19,6 +19,7 @@ package com.android.internal.os;
|
||||
import android.os.Process;
|
||||
import android.util.Slog;
|
||||
|
||||
import dalvik.system.VMRuntime;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.FileOutputStream;
|
||||
@@ -96,9 +97,20 @@ public class WrapperInit {
|
||||
* @param args Arguments for {@link RuntimeInit#main}.
|
||||
*/
|
||||
public static void execApplication(String invokeWith, String niceName,
|
||||
int targetSdkVersion, FileDescriptor pipeFd, String[] args) {
|
||||
int targetSdkVersion, String instructionSet, FileDescriptor pipeFd,
|
||||
String[] args) {
|
||||
StringBuilder command = new StringBuilder(invokeWith);
|
||||
command.append(" /system/bin/app_process /system/bin --application");
|
||||
|
||||
final String appProcess;
|
||||
if (VMRuntime.is64BitInstructionSet(instructionSet)) {
|
||||
appProcess = "/system/bin/app_process64";
|
||||
} else {
|
||||
appProcess = "/system/bin/app_process32";
|
||||
}
|
||||
command.append(' ');
|
||||
command.append(appProcess);
|
||||
|
||||
command.append(" /system/bin --application");
|
||||
if (niceName != null) {
|
||||
command.append(" '--nice-name=").append(niceName).append("'");
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import android.system.ErrnoException;
|
||||
import android.system.Os;
|
||||
import android.util.Log;
|
||||
import dalvik.system.PathClassLoader;
|
||||
import dalvik.system.VMRuntime;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
@@ -858,6 +859,7 @@ class ZygoteConnection {
|
||||
if (parsedArgs.invokeWith != null) {
|
||||
WrapperInit.execApplication(parsedArgs.invokeWith,
|
||||
parsedArgs.niceName, parsedArgs.targetSdkVersion,
|
||||
VMRuntime.getCurrentInstructionSet(),
|
||||
pipeFd, parsedArgs.remainingArgs);
|
||||
} else {
|
||||
RuntimeInit.zygoteInit(parsedArgs.targetSdkVersion,
|
||||
|
||||
@@ -437,7 +437,7 @@ public class ZygoteInit {
|
||||
|
||||
WrapperInit.execApplication(parsedArgs.invokeWith,
|
||||
parsedArgs.niceName, parsedArgs.targetSdkVersion,
|
||||
null, args);
|
||||
VMRuntime.getCurrentInstructionSet(), null, args);
|
||||
} else {
|
||||
ClassLoader cl = null;
|
||||
if (systemServerClasspath != null) {
|
||||
|
||||
Reference in New Issue
Block a user