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

Commit ea397088 authored by Jing Ji's avatar Jing Ji
Browse files

Log wtf on startInstrumentation from non-shell callers

Bug: 237766679
Test: atest CtsAppTestCases:InstrumentationTest & check dropbox
Change-Id: I1b76f61c5fd6c9f7e738978592260945a606f40c
parent e61d7fbd
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -14695,10 +14695,11 @@ 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 "
                final String msg = "Permission Denial: instrumentation test "
                        + className + " from pid=" + callingPid + ", uid=" + callingUid
                        + " not allowed because target package " + ii.targetPackage
                        + " is not debuggable.";
                        + ", pkgName=" + mInternal.getPackageNameByPid(callingPid)
                        + " not allowed because it's not started from SHELL";
                Slog.wtfQuiet(TAG, msg);
                reportStartInstrumentationFailureLocked(watcher, className, msg);
                throw new SecurityException(msg);
            }