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

Commit cc78cf44 authored by David Brazdil's avatar David Brazdil
Browse files

Revert "Exempt instrumented processes from hidden API checks"

This reverts commit 4bf7443a.

Reason for revert: Causing too many downstream issues together
    with I072dd571f779e2b5e405d21eecce5a60d1b3c7f2. Revert to
    unblock pi-release and testing.

Bug: 73105914
Bug: 73103669
Bug: 73106486
Bug: 64382372
Bug: 73103081
Bug: 73119220
Bug: 73114663
Change-Id: I2c1353d31386da447456b17f9643c0470128ee3d
parent fcd3c57e
Loading
Loading
Loading
Loading
+9 −12
Original line number Diff line number Diff line
@@ -4084,9 +4084,9 @@ public class ActivityManagerService extends IActivityManager.Stub
                runtimeFlags |= Zygote.ONLY_USE_SYSTEM_OAT_FILES;
            }
            if (app.info.isAllowedToUseHiddenApi() || app.instr != null) {
                // This app is allowed to use undocumented and private APIs or is
                // being instrumented. Set up its runtime with the appropriate flag.
            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;
            }
@@ -7218,7 +7218,7 @@ public class ActivityManagerService extends IActivityManager.Stub
            handleAppDiedLocked(app, willRestart, allowRestart);
            if (willRestart) {
                removeLruProcessLocked(app);
                addAppLocked(app.info, null, false, null /* ABI override */, app.instr);
                addAppLocked(app.info, null, false, null /* ABI override */);
            }
        } else {
            mRemovedProcesses.add(app);
@@ -12490,8 +12490,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                        .getPersistentApplications(STOCK_PM_FLAGS | matchFlags).getList();
                for (ApplicationInfo app : apps) {
                    if (!"android".equals(app.packageName)) {
                        addAppLocked(app, null, false, null /* ABI override */,
                                null /* instrumentation */);
                        addAppLocked(app, null, false, null /* ABI override */);
                    }
                }
            } catch (RemoteException ex) {
@@ -12707,7 +12706,7 @@ public class ActivityManagerService extends IActivityManager.Stub
    }
    final ProcessRecord addAppLocked(ApplicationInfo info, String customProcess, boolean isolated,
            String abiOverride, ActiveInstrumentation instrumentation) {
            String abiOverride) {
        ProcessRecord app;
        if (!isolated) {
            app = getProcessRecordLocked(customProcess != null ? customProcess : info.processName,
@@ -12736,9 +12735,6 @@ public class ActivityManagerService extends IActivityManager.Stub
            app.persistent = true;
            app.maxAdj = ProcessList.PERSISTENT_PROC_ADJ;
        }
        app.instr = instrumentation;
        if (app.thread == null && mPersistentStartingProcesses.indexOf(app) < 0) {
            mPersistentStartingProcesses.add(app);
            startProcessLocked(app, "added application",
@@ -21543,7 +21539,8 @@ public class ActivityManagerService extends IActivityManager.Stub
                mUsageStatsService.reportEvent(ii.targetPackage, userId,
                        UsageEvents.Event.SYSTEM_INTERACTION);
            }
            ProcessRecord app = addAppLocked(ai, defProcess, false, abiOverride, activeInstr);
            ProcessRecord app = addAppLocked(ai, defProcess, false, abiOverride);
            app.instr = activeInstr;
            activeInstr.mFinished = false;
            activeInstr.mRunningProcesses.add(app);
            if (!mActiveInstrumentation.contains(activeInstr)) {
@@ -24942,7 +24939,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                    mRemovedProcesses.remove(i);
                    if (app.persistent) {
                        addAppLocked(app.info, null, false, null /* ABI override */, app.instr);
                        addAppLocked(app.info, null, false, null /* ABI override */);
                    }
                }
            }