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

Commit 8ca1fdc1 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Fix issue #16400873: Apps that show ads as new tasks stay in recents..." into lmp-dev

parents e9544264 13420f23
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7775,7 +7775,6 @@ package android.content {
    field public static final int FILL_IN_PACKAGE = 16; // 0x10
    field public static final int FILL_IN_SELECTOR = 64; // 0x40
    field public static final int FILL_IN_SOURCE_BOUNDS = 32; // 0x20
    field public static final int FLAG_ACTIVITY_AUTO_REMOVE_FROM_RECENTS = 8192; // 0x2000
    field public static final int FLAG_ACTIVITY_BROUGHT_TO_FRONT = 4194304; // 0x400000
    field public static final int FLAG_ACTIVITY_CLEAR_TASK = 32768; // 0x8000
    field public static final int FLAG_ACTIVITY_CLEAR_TOP = 67108864; // 0x4000000
@@ -7792,6 +7791,7 @@ package android.content {
    field public static final int FLAG_ACTIVITY_PREVIOUS_IS_TOP = 16777216; // 0x1000000
    field public static final int FLAG_ACTIVITY_REORDER_TO_FRONT = 131072; // 0x20000
    field public static final int FLAG_ACTIVITY_RESET_TASK_IF_NEEDED = 2097152; // 0x200000
    field public static final int FLAG_ACTIVITY_RETAIN_IN_RECENTS = 8192; // 0x2000
    field public static final int FLAG_ACTIVITY_SINGLE_TOP = 536870912; // 0x20000000
    field public static final int FLAG_ACTIVITY_TASK_ON_HOME = 16384; // 0x4000
    field public static final int FLAG_DEBUG_LOG_RESOLUTION = 8; // 0x8
+19 −6
Original line number Diff line number Diff line
@@ -3755,6 +3755,13 @@ public class Intent implements Parcelable, Cloneable {
     * Activity to specify multiple document behavior for all launchers of the Activity
     * whereas using this flag requires each Intent that launches the Activity to specify it.
     *
     * <p>Note that the default semantics of this flag w.r.t. whether the recents entry for
     * it is kept after the activity is finished is different than the use of
     * {@link #FLAG_ACTIVITY_NEW_TASK} and {@link android.R.attr#documentLaunchMode} -- if
     * this flag is being used to create a new recents entry, then by default that entry
     * will be removed once the activity is finished.  You can modify this behavior with
     * {@link #FLAG_ACTIVITY_RETAIN_IN_RECENTS}.
     *
     * <p>FLAG_ACTIVITY_NEW_DOCUMENT may be used in conjunction with {@link
     * #FLAG_ACTIVITY_MULTIPLE_TASK}. When used alone it is the
     * equivalent of the Activity manifest specifying {@link
@@ -3828,14 +3835,20 @@ public class Intent implements Parcelable, Cloneable {
     */
    public static final int FLAG_ACTIVITY_TASK_ON_HOME = 0X00004000;
    /**
     * If set and the new activity is the root of a new task, then the task
     * will remain in the list of recently launched tasks only until all of
     * the activities in it are finished.
     * By default a document created by {@link #FLAG_ACTIVITY_NEW_DOCUMENT} will
     * have its entry in recent tasks removed when the user closes it (with back
     * or however else it may finish()).  If you would like to instead allow the
     * document to be kept in recents so that it can be re-launched, you can use
     * this flag.  When set and the task's activity is finished, the recents entry
     * will remain in the interface for the user to re-launch it, like a recents
     * entry for a top-level application.
     *
     * <p>This is equivalent to the attribute
     * {@link android.R.styleable#AndroidManifestActivity_autoRemoveFromRecents}.
     * <p>The receiving activity can override this request with
     * {@link android.R.styleable#AndroidManifestActivity_autoRemoveFromRecents}
     * or by explcitly calling {@link android.app.Activity#finishAndRemoveTask()
     * Activity.finishAndRemoveTask()}.
     */
    public static final int FLAG_ACTIVITY_AUTO_REMOVE_FROM_RECENTS = 0x00002000;
    public static final int FLAG_ACTIVITY_RETAIN_IN_RECENTS = 0x00002000;

    /**
     * If set, when sending a broadcast only registered receivers will be
+2 −4
Original line number Diff line number Diff line
@@ -280,8 +280,7 @@ public class ShareActionProvider extends ActionProvider {
            final String action = shareIntent.getAction();
            if (Intent.ACTION_SEND.equals(action) || Intent.ACTION_SEND_MULTIPLE.equals(action)) {
                shareIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT |
                        Intent.FLAG_ACTIVITY_MULTIPLE_TASK |
                        Intent.FLAG_ACTIVITY_AUTO_REMOVE_FROM_RECENTS);
                        Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
            }
        }
        ActivityChooserModel dataModel = ActivityChooserModel.get(mContext,
@@ -304,8 +303,7 @@ public class ShareActionProvider extends ActionProvider {
                if (Intent.ACTION_SEND.equals(action) ||
                        Intent.ACTION_SEND_MULTIPLE.equals(action)) {
                    launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT |
                            Intent.FLAG_ACTIVITY_MULTIPLE_TASK |
                            Intent.FLAG_ACTIVITY_AUTO_REMOVE_FROM_RECENTS);
                            Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
                }
                mContext.startActivity(launchIntent);
            }
+1 −2
Original line number Diff line number Diff line
@@ -81,8 +81,7 @@ public class ChooserActivity extends ResolverActivity {
        if (Intent.ACTION_SEND.equals(action) ||
                Intent.ACTION_SEND_MULTIPLE.equals(action)) {
            in.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT |
                    Intent.FLAG_ACTIVITY_MULTIPLE_TASK |
                    Intent.FLAG_ACTIVITY_AUTO_REMOVE_FROM_RECENTS);
                    Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
        }
    }
}
+4 −6
Original line number Diff line number Diff line
@@ -989,11 +989,9 @@

    <!-- Tasks launched by activities with this attribute will remain in the recent tasks
         list until the last activity in the task is completed.  When that happens the task
         will be automatically removed from the recent tasks list.

         This attribute is the equivalent of {@link
         android.content.Intent#FLAG_ACTIVITY_AUTO_REMOVE_FROM_RECENTS
         Intent.FLAG_ACTIVITY_AUTO_REMOVE_FROM_RECENTS} -->
         will be automatically removed from the recent tasks list.  This overrides the caller's
         use of {@link android.content.Intent#FLAG_ACTIVITY_RETAIN_IN_RECENTS
         Intent.FLAG_ACTIVITY_RETAIN_IN_RECENTS} -->
    <attr name="autoRemoveFromRecents" format="boolean" />

    <!-- Tasks whose root has this attribute set to true will replace baseIntent with that of the
Loading