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

Commit 2c704a60 authored by Achim Thesmann's avatar Achim Thesmann
Browse files

Remove setIgnorePendingIntentCreatorForegroundState

The `setIgnorePendingIntentCreatorForegroundState` provides similar
funtionality as `setPendingIntentBackgroundActivityStartMode` which
is more versatile. The method is hidden and deprecated, so removal
should be safe.

Test: atest com.android.server.wm.ActivityStarterTests
Bug: 261780465
Change-Id: I5a4c433b78ff5e362f8d29e0723c3840643c4c5e
parent 80b546e6
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -2204,19 +2204,6 @@ public class ActivityOptions extends ComponentOptions {
        return mDismissKeyguardIfInsecure;
    }

    /**
     * Sets background activity launch logic won't use pending intent creator foreground state.
     *
     * @hide
     * @deprecated use {@link #setPendingIntentCreatorBackgroundActivityStartMode(int)} instead
     */
    @Deprecated
    public ActivityOptions setIgnorePendingIntentCreatorForegroundState(boolean ignore) {
        mPendingIntentCreatorBackgroundActivityStartMode = ignore
                ? MODE_BACKGROUND_ACTIVITY_START_DENIED : MODE_BACKGROUND_ACTIVITY_START_ALLOWED;
        return this;
    }

    /**
     * Allow a {@link PendingIntent} to use the privilege of its creator to start background
     * activities.
+2 −1
Original line number Diff line number Diff line
@@ -1617,7 +1617,8 @@ abstract public class ManagedServices {
        intent.putExtra(Intent.EXTRA_CLIENT_LABEL, mConfig.clientLabel);

        final ActivityOptions activityOptions = ActivityOptions.makeBasic();
        activityOptions.setIgnorePendingIntentCreatorForegroundState(true);
        activityOptions.setPendingIntentCreatorBackgroundActivityStartMode(
                ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_DENIED);
        final PendingIntent pendingIntent = PendingIntent.getActivity(
                mContext, 0, new Intent(mConfig.settingsAction), PendingIntent.FLAG_IMMUTABLE,
                activityOptions.toBundle());