Merge "Special handling of priv-apps in Zygote." am: 46af70cad9 am: 79d4ef6caa

am: 836f2fe701

Change-Id: Ieb8b53e69ac14be6e4e0e0210f12343e7e863b66
This commit is contained in:
Nicolas Geoffray
2017-09-19 12:11:51 +00:00
committed by android-build-merger
2 changed files with 11 additions and 0 deletions

View File

@@ -51,6 +51,11 @@ public final class Zygote {
/** Make the code Java debuggable by turning off some optimizations. */
public static final int DEBUG_JAVA_DEBUGGABLE = 1 << 8;
/** Turn off the verifier. */
public static final int DISABLE_VERIFIER = 1 << 9;
/** Only use oat files located in /system. Otherwise use dex/jar/apk . */
public static final int ONLY_USE_SYSTEM_OAT_FILES = 1 << 10;
/** No external storage should be mounted. */
public static final int MOUNT_EXTERNAL_NONE = 0;
/** Default external storage should be mounted. */

View File

@@ -3865,6 +3865,12 @@ public class ActivityManagerService extends IActivityManager.Stub
mNativeDebuggingApp = null;
}
if (app.info.isPrivilegedApp() &&
!SystemProperties.getBoolean("pm.dexopt.priv-apps", true)) {
runtimeFlags |= Zygote.DISABLE_VERIFIER;
runtimeFlags |= Zygote.ONLY_USE_SYSTEM_OAT_FILES;
}
String invokeWith = null;
if ((app.info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
// Debuggable apps may include a wrapper script with their library directory.