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

Commit 9eb572bd authored by Jing Ji's avatar Jing Ji Committed by Android (Google) Code Review
Browse files

Merge "Context#startInstrumentation could be started from SHELL only now."

parents fa37b8d1 c6e73437
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -14692,6 +14692,17 @@ public class ActivityManagerService extends IActivityManager.Stub
                }
            }
            if (!Build.IS_DEBUGGABLE && callingUid != ROOT_UID && callingUid != SHELL_UID
                    && callingUid != SYSTEM_UID) {
                // If it's not debug build and not called from root/shell/system uid, reject it.
                String msg = "Permission Denial: instrumentation test "
                        + className + " from pid=" + callingPid + ", uid=" + callingUid
                        + " not allowed because target package " + ii.targetPackage
                        + " is not debuggable.";
                reportStartInstrumentationFailureLocked(watcher, className, msg);
                throw new SecurityException(msg);
            }
            boolean disableHiddenApiChecks = ai.usesNonSdkApi()
                    || (flags & INSTR_FLAG_DISABLE_HIDDEN_API_CHECKS) != 0;
            boolean disableTestApiChecks = disableHiddenApiChecks