Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71e8c409 authored by David Brazdil's avatar David Brazdil Committed by android-build-merger
Browse files

Merge "Set Zygote.DISABLE_HIDDEN_API_CHECKS for system apps" am: 50cfaa40 am: 97a970e5

am: 5fab1431

Change-Id: I788ad36976b6c63670f40c735380982e6567df86
parents 4a014d8f 5fab1431
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -53,6 +53,8 @@ public final class Zygote {
    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;
    /** Do not enfore hidden API access restrictions. */
    public static final int DISABLE_HIDDEN_API_CHECKS = 1 << 11;

    /** No external storage should be mounted. */
    public static final int MOUNT_EXTERNAL_NONE = IVold.REMOUNT_MODE_NONE;
@@ -156,6 +158,9 @@ public final class Zygote {
     */
    public static int forkSystemServer(int uid, int gid, int[] gids, int runtimeFlags,
            int[][] rlimits, long permittedCapabilities, long effectiveCapabilities) {
        // SystemServer is always allowed to use hidden APIs.
        runtimeFlags |= DISABLE_HIDDEN_API_CHECKS;

        VM_HOOKS.preFork();
        // Resets nice priority for zygote process.
        resetNicePriority();
+6 −0
Original line number Diff line number Diff line
@@ -4064,6 +4064,12 @@ public class ActivityManagerService extends IActivityManager.Stub
                runtimeFlags |= Zygote.ONLY_USE_SYSTEM_OAT_FILES;
            }
            if (app.info.isAllowedToUseHiddenApi()) {
                // This app is allowed to use undocumented and private APIs. Set
                // up its runtime with the appropriate flag.
                runtimeFlags |= Zygote.DISABLE_HIDDEN_API_CHECKS;
            }
            String invokeWith = null;
            if ((app.info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
                // Debuggable apps may include a wrapper script with their library directory.