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

Commit 0b2ee80a authored by Achim Thesmann's avatar Achim Thesmann
Browse files

Fix clone method for ActivityOptions

Some flags were lost when the `cloneLaunchingOptions` was used. This
breaks some tests when the flag to grant BAL privileges is passed and
the default is not to allow BAL anymore.

Test: atest android.content.pm.cts.shortcutmanager.ShortcutManagerStartShortcutTest
Bug: 265916225
Change-Id: Id65b481eefc341d1c16ccdf06ea4489e109f5fba
parent 5ef07b0c
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1997,10 +1997,12 @@ public class ActivityOptions extends ComponentOptions {

    /**
     * Sets background activity launch logic won't use pending intent creator foreground state.
     *
     * @hide
     */
    public void setIgnorePendingIntentCreatorForegroundState(boolean state) {
    public ActivityOptions setIgnorePendingIntentCreatorForegroundState(boolean state) {
        mIgnorePendingIntentCreatorForegroundState = state;
        return this;
    }

    /**
+5 −1
Original line number Diff line number Diff line
@@ -143,7 +143,11 @@ public class SafeActivityOptions {
                .setLaunchTaskDisplayArea(options.getLaunchTaskDisplayArea())
                .setLaunchDisplayId(options.getLaunchDisplayId())
                .setCallerDisplayId(options.getCallerDisplayId())
                .setLaunchRootTask(options.getLaunchRootTask());
                .setLaunchRootTask(options.getLaunchRootTask())
                .setPendingIntentBackgroundActivityStartMode(
                        options.getPendingIntentBackgroundActivityStartMode())
                .setIgnorePendingIntentCreatorForegroundState(
                        options.getIgnorePendingIntentCreatorForegroundState());
    }

    /**