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

Commit 70696230 authored by Achim Thesmann's avatar Achim Thesmann
Browse files

Remove unused isPendingIntentBalAllowedByPermission

Test: atest BackgroundActivityLaunchTest BackgroundActivityStartContriller*Test
Flag: com.android.window.flags.bal_additional_start_modes
Bug: 352182359
Change-Id: I9648efb1a94511b7e32c49e1fcfa3e06d7fee777
parent 2cc1c157
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: