Loading core/java/com/android/internal/os/Zygote.java +7 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,13 @@ public final class Zygote { */ 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; /** No external storage should be mounted. */ public static final int MOUNT_EXTERNAL_NONE = IVold.REMOUNT_MODE_NONE; /** Default external storage should be mounted. */ Loading services/core/java/com/android/server/am/ActivityManagerService.java +15 −3 Original line number Diff line number Diff line Loading @@ -7786,10 +7786,18 @@ public class ActivityManagerService extends IActivityManager.Stub false /* mountExtStorageFull */, abiOverride); } // TODO: Move to ProcessList? @GuardedBy("this") final ProcessRecord addAppLocked(ApplicationInfo info, String customProcess, boolean isolated, boolean disableHiddenApiChecks, boolean mountExtStorageFull, String abiOverride) { return addAppLocked(info, customProcess, isolated, disableHiddenApiChecks, false /* disableTestApiChecks */, mountExtStorageFull, abiOverride); } // TODO: Move to ProcessList? @GuardedBy("this") final ProcessRecord addAppLocked(ApplicationInfo info, String customProcess, boolean isolated, boolean disableHiddenApiChecks, boolean disableTestApiChecks, boolean mountExtStorageFull, String abiOverride) { ProcessRecord app; if (!isolated) { app = getProcessRecordLocked(customProcess != null ? customProcess : info.processName, Loading Loading @@ -7824,7 +7832,7 @@ public class ActivityManagerService extends IActivityManager.Stub mPersistentStartingProcesses.add(app); mProcessList.startProcessLocked(app, new HostingRecord("added application", customProcess != null ? customProcess : app.processName), disableHiddenApiChecks, mountExtStorageFull, abiOverride); disableHiddenApiChecks, disableTestApiChecks, mountExtStorageFull, abiOverride); } return app; Loading Loading @@ -15765,6 +15773,10 @@ public class ActivityManagerService extends IActivityManager.Stub enforceCallingPermission(android.Manifest.permission.DISABLE_HIDDEN_API_CHECKS, "disable hidden API checks"); } // Allow instrumented processes access to test APIs. // TODO(satayev): make this configurable via testing framework. boolean disableTestApiChecks = true; final boolean mountExtStorageFull = isCallerShell() && (flags & INSTR_FLAG_MOUNT_EXTERNAL_STORAGE_FULL) != 0; Loading @@ -15779,7 +15791,7 @@ public class ActivityManagerService extends IActivityManager.Stub } ProcessRecord app = addAppLocked(ai, defProcess, false, disableHiddenApiChecks, mountExtStorageFull, abiOverride); disableTestApiChecks, mountExtStorageFull, abiOverride); app.setActiveInstrumentation(activeInstr); activeInstr.mFinished = false; activeInstr.mRunningProcesses.add(app); services/core/java/com/android/server/am/ProcessList.java +8 −7 Original line number Diff line number Diff line Loading @@ -1419,15 +1419,11 @@ public final class ProcessList { /** * @return {@code true} if process start is successful, false otherwise. * @param app * @param hostingRecord * @param disableHiddenApiChecks * @param abiOverride */ @GuardedBy("mService") boolean startProcessLocked(ProcessRecord app, HostingRecord hostingRecord, boolean disableHiddenApiChecks, boolean mountExtStorageFull, String abiOverride) { boolean disableHiddenApiChecks, boolean disableTestApiChecks, boolean mountExtStorageFull, String abiOverride) { if (app.pendingStart) { return true; } Loading Loading @@ -1572,6 +1568,10 @@ public final class ProcessList { throw new IllegalStateException("Invalid API policy: " + policy); } runtimeFlags |= policyBits; if (disableTestApiChecks) { runtimeFlags |= Zygote.DISABLE_TEST_API_ENFORCEMENT_POLICY; } } String useAppImageCache = SystemProperties.get( Loading Loading @@ -1845,7 +1845,8 @@ public final class ProcessList { final boolean startProcessLocked(ProcessRecord app, HostingRecord hostingRecord, String abiOverride) { return startProcessLocked(app, hostingRecord, false /* disableHiddenApiChecks */, false /* mountExtStorageFull */, abiOverride); false /* disableHiddenApiChecks */, false /* disableTestApiChecks */, false /* mountExtStorageFull */, abiOverride); } @GuardedBy("mService") Loading Loading
core/java/com/android/internal/os/Zygote.java +7 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,13 @@ public final class Zygote { */ 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; /** No external storage should be mounted. */ public static final int MOUNT_EXTERNAL_NONE = IVold.REMOUNT_MODE_NONE; /** Default external storage should be mounted. */ Loading
services/core/java/com/android/server/am/ActivityManagerService.java +15 −3 Original line number Diff line number Diff line Loading @@ -7786,10 +7786,18 @@ public class ActivityManagerService extends IActivityManager.Stub false /* mountExtStorageFull */, abiOverride); } // TODO: Move to ProcessList? @GuardedBy("this") final ProcessRecord addAppLocked(ApplicationInfo info, String customProcess, boolean isolated, boolean disableHiddenApiChecks, boolean mountExtStorageFull, String abiOverride) { return addAppLocked(info, customProcess, isolated, disableHiddenApiChecks, false /* disableTestApiChecks */, mountExtStorageFull, abiOverride); } // TODO: Move to ProcessList? @GuardedBy("this") final ProcessRecord addAppLocked(ApplicationInfo info, String customProcess, boolean isolated, boolean disableHiddenApiChecks, boolean disableTestApiChecks, boolean mountExtStorageFull, String abiOverride) { ProcessRecord app; if (!isolated) { app = getProcessRecordLocked(customProcess != null ? customProcess : info.processName, Loading Loading @@ -7824,7 +7832,7 @@ public class ActivityManagerService extends IActivityManager.Stub mPersistentStartingProcesses.add(app); mProcessList.startProcessLocked(app, new HostingRecord("added application", customProcess != null ? customProcess : app.processName), disableHiddenApiChecks, mountExtStorageFull, abiOverride); disableHiddenApiChecks, disableTestApiChecks, mountExtStorageFull, abiOverride); } return app; Loading Loading @@ -15765,6 +15773,10 @@ public class ActivityManagerService extends IActivityManager.Stub enforceCallingPermission(android.Manifest.permission.DISABLE_HIDDEN_API_CHECKS, "disable hidden API checks"); } // Allow instrumented processes access to test APIs. // TODO(satayev): make this configurable via testing framework. boolean disableTestApiChecks = true; final boolean mountExtStorageFull = isCallerShell() && (flags & INSTR_FLAG_MOUNT_EXTERNAL_STORAGE_FULL) != 0; Loading @@ -15779,7 +15791,7 @@ public class ActivityManagerService extends IActivityManager.Stub } ProcessRecord app = addAppLocked(ai, defProcess, false, disableHiddenApiChecks, mountExtStorageFull, abiOverride); disableTestApiChecks, mountExtStorageFull, abiOverride); app.setActiveInstrumentation(activeInstr); activeInstr.mFinished = false; activeInstr.mRunningProcesses.add(app);
services/core/java/com/android/server/am/ProcessList.java +8 −7 Original line number Diff line number Diff line Loading @@ -1419,15 +1419,11 @@ public final class ProcessList { /** * @return {@code true} if process start is successful, false otherwise. * @param app * @param hostingRecord * @param disableHiddenApiChecks * @param abiOverride */ @GuardedBy("mService") boolean startProcessLocked(ProcessRecord app, HostingRecord hostingRecord, boolean disableHiddenApiChecks, boolean mountExtStorageFull, String abiOverride) { boolean disableHiddenApiChecks, boolean disableTestApiChecks, boolean mountExtStorageFull, String abiOverride) { if (app.pendingStart) { return true; } Loading Loading @@ -1572,6 +1568,10 @@ public final class ProcessList { throw new IllegalStateException("Invalid API policy: " + policy); } runtimeFlags |= policyBits; if (disableTestApiChecks) { runtimeFlags |= Zygote.DISABLE_TEST_API_ENFORCEMENT_POLICY; } } String useAppImageCache = SystemProperties.get( Loading Loading @@ -1845,7 +1845,8 @@ public final class ProcessList { final boolean startProcessLocked(ProcessRecord app, HostingRecord hostingRecord, String abiOverride) { return startProcessLocked(app, hostingRecord, false /* disableHiddenApiChecks */, false /* mountExtStorageFull */, abiOverride); false /* disableHiddenApiChecks */, false /* disableTestApiChecks */, false /* mountExtStorageFull */, abiOverride); } @GuardedBy("mService") Loading