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

Commit c95de735 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Revert "Do not propogate test api access flags to Zygote."" into sc-dev am: 9132e2de

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13669305

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I236660d9a1808dce5b02d4261fc4651501868ab4
parents ed348470 9132e2de
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line Diff line number Diff line
@@ -103,7 +103,7 @@ public final class Zygote {
     */
     */
    public static final int PROFILE_FROM_SHELL = 1 << 15;
    public static final int PROFILE_FROM_SHELL = 1 << 15;


    /**
    /*
     * Enable using the ART app image startup cache
     * Enable using the ART app image startup cache
     */
     */
    public static final int USE_APP_IMAGE_STARTUP_CACHE = 1 << 16;
    public static final int USE_APP_IMAGE_STARTUP_CACHE = 1 << 16;
@@ -116,6 +116,13 @@ public final class Zygote {
     */
     */
    public static final int DEBUG_IGNORE_APP_SIGNAL_HANDLER = 1 << 17;
    public static final int DEBUG_IGNORE_APP_SIGNAL_HANDLER = 1 << 17;


    /**
     * Disable runtime access to {@link android.annotation.TestApi} annotated members.
     *
     * <p>This only takes effect if Hidden API access restrictions are enabled as well.
     */
    public static final int DISABLE_TEST_API_ENFORCEMENT_POLICY = 1 << 18;

    public static final int MEMORY_TAG_LEVEL_MASK = (1 << 19) | (1 << 20);
    public static final int MEMORY_TAG_LEVEL_MASK = (1 << 19) | (1 << 20);


    public static final int MEMORY_TAG_LEVEL_NONE = 0;
    public static final int MEMORY_TAG_LEVEL_NONE = 0;
+13 −4
Original line number Original line Diff line number Diff line
@@ -6083,10 +6083,18 @@ public class ActivityManagerService extends IActivityManager.Stub
                abiOverride, zygotePolicyFlags);
                abiOverride, zygotePolicyFlags);
    }
    }
    // TODO: Move to ProcessList?
    @GuardedBy("this")
    @GuardedBy("this")
    final ProcessRecord addAppLocked(ApplicationInfo info, String customProcess, boolean isolated,
    final ProcessRecord addAppLocked(ApplicationInfo info, String customProcess, boolean isolated,
            boolean disableHiddenApiChecks, String abiOverride, int zygotePolicyFlags) {
            boolean disableHiddenApiChecks, String abiOverride, int zygotePolicyFlags) {
        return addAppLocked(info, customProcess, isolated, disableHiddenApiChecks,
                false /* disableTestApiChecks */, abiOverride, zygotePolicyFlags);
    }
    // TODO: Move to ProcessList?
    @GuardedBy("this")
    final ProcessRecord addAppLocked(ApplicationInfo info, String customProcess, boolean isolated,
            boolean disableHiddenApiChecks, boolean disableTestApiChecks,
            String abiOverride, int zygotePolicyFlags) {
        ProcessRecord app;
        ProcessRecord app;
        if (!isolated) {
        if (!isolated) {
            app = getProcessRecordLocked(customProcess != null ? customProcess : info.processName,
            app = getProcessRecordLocked(customProcess != null ? customProcess : info.processName,
@@ -6121,7 +6129,8 @@ public class ActivityManagerService extends IActivityManager.Stub
            mPersistentStartingProcesses.add(app);
            mPersistentStartingProcesses.add(app);
            mProcessList.startProcessLocked(app, new HostingRecord("added application",
            mProcessList.startProcessLocked(app, new HostingRecord("added application",
                    customProcess != null ? customProcess : app.processName),
                    customProcess != null ? customProcess : app.processName),
                    zygotePolicyFlags, disableHiddenApiChecks, abiOverride);
                    zygotePolicyFlags, disableHiddenApiChecks, disableTestApiChecks,
                    abiOverride);
        }
        }
        return app;
        return app;
@@ -13576,8 +13585,8 @@ public class ActivityManagerService extends IActivityManager.Stub
                        mUsageStatsService.reportEvent(ii.targetPackage, userId,
                        mUsageStatsService.reportEvent(ii.targetPackage, userId,
                                UsageEvents.Event.SYSTEM_INTERACTION);
                                UsageEvents.Event.SYSTEM_INTERACTION);
                    }
                    }
                    app = addAppLocked(ai, defProcess, false, disableHiddenApiChecks, abiOverride,
                    app = addAppLocked(ai, defProcess, false, disableHiddenApiChecks,
                            ZYGOTE_POLICY_FLAG_EMPTY);
                            disableTestApiChecks, abiOverride, ZYGOTE_POLICY_FLAG_EMPTY);
                }
                }
                app.setActiveInstrumentation(activeInstr);
                app.setActiveInstrumentation(activeInstr);
+8 −2
Original line number Original line Diff line number Diff line
@@ -1759,7 +1759,8 @@ public final class ProcessList {
     */
     */
    @GuardedBy("mService")
    @GuardedBy("mService")
    boolean startProcessLocked(ProcessRecord app, HostingRecord hostingRecord,
    boolean startProcessLocked(ProcessRecord app, HostingRecord hostingRecord,
            int zygotePolicyFlags, boolean disableHiddenApiChecks, String abiOverride) {
            int zygotePolicyFlags, boolean disableHiddenApiChecks, boolean disableTestApiChecks,
            String abiOverride) {
        if (app.isPendingStart()) {
        if (app.isPendingStart()) {
            return true;
            return true;
        }
        }
@@ -1905,6 +1906,10 @@ public final class ProcessList {
                    throw new IllegalStateException("Invalid API policy: " + policy);
                    throw new IllegalStateException("Invalid API policy: " + policy);
                }
                }
                runtimeFlags |= policyBits;
                runtimeFlags |= policyBits;

                if (disableTestApiChecks) {
                    runtimeFlags |= Zygote.DISABLE_TEST_API_ENFORCEMENT_POLICY;
                }
            }
            }


            String useAppImageCache = SystemProperties.get(
            String useAppImageCache = SystemProperties.get(
@@ -2368,7 +2373,8 @@ public final class ProcessList {
    boolean startProcessLocked(ProcessRecord app, HostingRecord hostingRecord,
    boolean startProcessLocked(ProcessRecord app, HostingRecord hostingRecord,
            int zygotePolicyFlags, String abiOverride) {
            int zygotePolicyFlags, String abiOverride) {
        return startProcessLocked(app, hostingRecord, zygotePolicyFlags,
        return startProcessLocked(app, hostingRecord, zygotePolicyFlags,
                false /* disableHiddenApiChecks */, abiOverride);
                false /* disableHiddenApiChecks */, false /* disableTestApiChecks */,
                abiOverride);
    }
    }


    @GuardedBy("mService")
    @GuardedBy("mService")