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

Commit fb75487f authored by Tom O'Neill's avatar Tom O'Neill Committed by Android (Google) Code Review
Browse files

Merge "Explain what warnIfCallingFromSystemProcess() is about" into klp-dev

parents a7127540 365632e8
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1827,6 +1827,11 @@ class ContextImpl extends Context {
                      message);
    }

    /**
     * Logs a warning if the system process directly called a method such as
     * {@link #startService(Intent)} instead of {@link #startServiceAsUser(Intent, UserHandle)}.
     * The "AsUser" variants allow us to properly enforce the user's restrictions.
     */
    private void warnIfCallingFromSystemProcess() {
        if (Process.myUid() == Process.SYSTEM_UID) {
            Slog.w(TAG, "Calling a method in the system process without a qualified user: "