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

Commit 9bfd6b06 authored by Achim Thesmann's avatar Achim Thesmann Committed by Android (Google) Code Review
Browse files

Merge "Remove unused isPendingIntentBalAllowedByPermission" into main

parents 4b4b57e1 70696230
Loading
Loading
Loading
Loading
+4 −11
Original line number Diff line number Diff line
@@ -19,9 +19,11 @@ package com.android.server.am;
import static android.app.ActivityManager.PROCESS_STATE_TOP;
import static android.app.ActivityManager.START_SUCCESS;
import static android.app.ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED;
import static android.app.ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS;
import static android.app.ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_COMPAT;
import static android.app.ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_DENIED;
import static android.app.ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_SYSTEM_DEFINED;
import static android.app.ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_IF_VISIBLE;
import static android.os.Process.ROOT_UID;
import static android.os.Process.SYSTEM_UID;

@@ -366,17 +368,6 @@ public final class PendingIntentRecord extends IIntentSender.Stub {
                requiredPermission, null, null, 0, 0, 0, options);
    }

    /**
     * Return true if the activity options allows PendingIntent to use caller's BAL permission.
     */
    public static boolean isPendingIntentBalAllowedByPermission(
            @Nullable ActivityOptions activityOptions) {
        if (activityOptions == null) {
            return false;
        }
        return activityOptions.isPendingIntentBackgroundActivityLaunchAllowedByPermission();
    }

    /**
     * Return the {@link BackgroundStartPrivileges} the activity options grant the PendingIntent to
     * use caller's BAL permission.
@@ -404,6 +395,8 @@ public final class PendingIntentRecord extends IIntentSender.Stub {
                return BackgroundStartPrivileges.NONE;
            case MODE_BACKGROUND_ACTIVITY_START_SYSTEM_DEFINED:
                return getDefaultBackgroundStartPrivileges(callingUid, callingPackage);
            case MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS:
            case MODE_BACKGROUND_ACTIVITY_START_ALLOW_IF_VISIBLE:
            case MODE_BACKGROUND_ACTIVITY_START_ALLOWED:
            case MODE_BACKGROUND_ACTIVITY_START_COMPAT:
            default: