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

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

Merge "Replace get/setPendingIntentBackgroundActivityLaunchAllowedByPermission" into main

parents fa422aa0 e9c5fab5
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.wm.shell.bubbles;

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.ActivityTaskManager.INVALID_TASK_ID;
import static android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK;
import static android.content.Intent.FLAG_ACTIVITY_NEW_DOCUMENT;
@@ -225,8 +225,7 @@ public class BubbleExpandedView extends LinearLayout {
                    options.setTaskAlwaysOnTop(true);
                    options.setLaunchedFromBubble(true);
                    options.setPendingIntentBackgroundActivityStartMode(
                            MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
                    options.setPendingIntentBackgroundActivityLaunchAllowedByPermission(true);
                            MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS);

                    Intent fillInIntent = new Intent();
                    // Apply flags to make behaviour match documentLaunchMode=always.
+2 −3
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
 */
package com.android.wm.shell.bubbles;

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.ActivityTaskManager.INVALID_TASK_ID;
import static android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK;
import static android.content.Intent.FLAG_ACTIVITY_NEW_DOCUMENT;
@@ -103,8 +103,7 @@ public class BubbleTaskViewHelper {
                    options.setTaskAlwaysOnTop(true);
                    options.setLaunchedFromBubble(true);
                    options.setPendingIntentBackgroundActivityStartMode(
                            MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
                    options.setPendingIntentBackgroundActivityLaunchAllowedByPermission(true);
                            MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS);

                    Intent fillInIntent = new Intent();
                    // Apply flags to make behaviour match documentLaunchMode=always.
+1 −3
Original line number Diff line number Diff line
@@ -818,9 +818,8 @@ class DesktopTasksController(
        val intent = Intent(context, DesktopWallpaperActivity::class.java)
        val options =
            ActivityOptions.makeBasic().apply {
                isPendingIntentBackgroundActivityLaunchAllowedByPermission = true
                pendingIntentBackgroundActivityStartMode =
                    ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED
                    ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS
            }
        val pendingIntent =
            PendingIntent.getActivity(
@@ -1426,7 +1425,6 @@ class DesktopTasksController(
                setPendingIntentBackgroundActivityStartMode(
                    ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_DENIED
                )
                isPendingIntentBackgroundActivityLaunchAllowedByPermission = true
            }
        val wct = WindowContainerTransaction()
        wct.sendPendingIntent(launchIntent, null, opts.toBundle())
+2 −3
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.wm.shell.draganddrop;

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_DENIED;
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
@@ -280,8 +280,7 @@ public class DragAndDropPolicy {
        baseActivityOpts.setDisallowEnterPictureInPictureWhileLaunching(true);
        // Put BAL flags to avoid activity start aborted.
        baseActivityOpts.setPendingIntentBackgroundActivityStartMode(
                MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
        baseActivityOpts.setPendingIntentBackgroundActivityLaunchAllowedByPermission(true);
                MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS);
        final Bundle opts = baseActivityOpts.toBundle();
        if (session.appData.hasExtra(EXTRA_ACTIVITY_OPTIONS)) {
            opts.putAll(session.appData.getBundleExtra(EXTRA_ACTIVITY_OPTIONS));
+3 −3
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.wm.shell.splitscreen;

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.ActivityTaskManager.INVALID_TASK_ID;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
@@ -1909,8 +1909,8 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
        }
        // Put BAL flags to avoid activity start aborted. Otherwise, flows like shortcut to split
        // will be canceled.
        options.setPendingIntentBackgroundActivityStartMode(MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
        options.setPendingIntentBackgroundActivityLaunchAllowedByPermission(true);
        options.setPendingIntentBackgroundActivityStartMode(
                MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS);

        // TODO (b/336477473): Disallow enter PiP when launching a task in split by default;
        //                     this might have to be changed as more split-to-pip cujs are defined.
Loading