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

Commit 50cfaa40 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Set Zygote.DISABLE_HIDDEN_API_CHECKS for system apps"

parents d3dac85e 071bcaa9
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -55,6 +55,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 = 0;
@@ -158,6 +160,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
@@ -3877,6 +3877,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.