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

Commit 22bc5136 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Allow system process by opt in" into main

parents eee2efae 3edf573f
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -1164,8 +1164,9 @@ public class BackgroundActivityStartController {
     * or {@link #BAL_BLOCK} if the launch should be blocked
     * or {@link #BAL_BLOCK} if the launch should be blocked
     */
     */
    BalVerdict checkBackgroundActivityStartAllowedByRealCallerInBackground(BalState state) {
    BalVerdict checkBackgroundActivityStartAllowedByRealCallerInBackground(BalState state) {
        if (state.mCheckedOptions.getPendingIntentBackgroundActivityStartMode()
        boolean allowAlways = state.mCheckedOptions.getPendingIntentBackgroundActivityStartMode()
                == MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS
                == MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS;
        if (allowAlways
                && hasBalPermission(state.mRealCallingUid, state.mRealCallingPid)) {
                && hasBalPermission(state.mRealCallingUid, state.mRealCallingPid)) {
            return new BalVerdict(BAL_ALLOW_PERMISSION,
            return new BalVerdict(BAL_ALLOW_PERMISSION,
                    /*background*/ false,
                    /*background*/ false,
@@ -1177,8 +1178,7 @@ public class BackgroundActivityStartController {
                + state.mRealCallingPid + ", " + state.mRealCallingPackage + ") "
                + state.mRealCallingPid + ", " + state.mRealCallingPackage + ") "
                + balStartModeToString(
                + balStartModeToString(
                state.mCheckedOptions.getPendingIntentBackgroundActivityStartMode()));
                state.mCheckedOptions.getPendingIntentBackgroundActivityStartMode()));
        if (state.mCheckedOptions.getPendingIntentBackgroundActivityStartMode()
        if (allowAlways
                == MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS
                && mService.hasSystemAlertWindowPermission(state.mRealCallingUid,
                && mService.hasSystemAlertWindowPermission(state.mRealCallingUid,
                state.mRealCallingPid, state.mRealCallingPackage)) {
                state.mRealCallingPid, state.mRealCallingPackage)) {
            Slog.w(
            Slog.w(
@@ -1192,7 +1192,7 @@ public class BackgroundActivityStartController {


        // if the realCallingUid is a persistent system process, abort if the IntentSender
        // if the realCallingUid is a persistent system process, abort if the IntentSender
        // wasn't allowed to start an activity
        // wasn't allowed to start an activity
        if (state.mAllowBalExemptionForSystemProcess
        if ((allowAlways || state.mAllowBalExemptionForSystemProcess)
                && state.mIsRealCallingUidPersistentSystemProcess) {
                && state.mIsRealCallingUidPersistentSystemProcess) {
            return new BalVerdict(BAL_ALLOW_ALLOWLISTED_UID,
            return new BalVerdict(BAL_ALLOW_ALLOWLISTED_UID,
                    /*background*/ false,
                    /*background*/ false,