diff --git a/api/current.txt b/api/current.txt index 012f979b6f4ef..5c923e3ef9626 100644 --- a/api/current.txt +++ b/api/current.txt @@ -7558,12 +7558,12 @@ package android.content { 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 - field public static final int FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET = 524288; // 0x80000 + field public static final deprecated int FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET = 524288; // 0x80000 field public static final int FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS = 8388608; // 0x800000 field public static final int FLAG_ACTIVITY_FORWARD_RESULT = 33554432; // 0x2000000 field public static final int FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY = 1048576; // 0x100000 field public static final int FLAG_ACTIVITY_MULTIPLE_TASK = 134217728; // 0x8000000 - field public static final int FLAG_ACTIVITY_NEW_DOCUMENT = 268959744; // 0x10080000 + field public static final int FLAG_ACTIVITY_NEW_DOCUMENT = 524288; // 0x80000 field public static final int FLAG_ACTIVITY_NEW_TASK = 268435456; // 0x10000000 field public static final int FLAG_ACTIVITY_NO_ANIMATION = 65536; // 0x10000 field public static final int FLAG_ACTIVITY_NO_HISTORY = 1073741824; // 0x40000000 @@ -8043,6 +8043,7 @@ package android.content.pm { field public static final android.os.Parcelable.Creator CREATOR; field public static final int DOCUMENT_LAUNCH_ALWAYS = 2; // 0x2 field public static final int DOCUMENT_LAUNCH_INTO_EXISTING = 1; // 0x1 + field public static final int DOCUMENT_LAUNCH_NEVER = 3; // 0x3 field public static final int DOCUMENT_LAUNCH_NONE = 0; // 0x0 field public static final int FLAG_ALLOW_TASK_REPARENTING = 64; // 0x40 field public static final int FLAG_ALWAYS_RETAIN_TASK_STATE = 8; // 0x8 diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 93572b604801b..6e53a6fb59692 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -3711,30 +3711,8 @@ public class Intent implements Parcelable, Cloneable { */ public static final int FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY = 0x00100000; /** - * If set, this marks a point in the task's activity stack that should - * be cleared when the task is reset. That is, the next time the task - * is brought to the foreground with - * {@link #FLAG_ACTIVITY_RESET_TASK_IF_NEEDED} (typically as a result of - * the user re-launching it from home), this activity and all on top of - * it will be finished so that the user does not return to them, but - * instead returns to whatever activity preceeded it. - * - *
When this flag is assigned to the root activity all activities up - * to, but not including the root activity, will be cleared. This prevents - * this flag from being used to finish all activities in a task and thereby - * ending the task. - * - *
This is useful for cases where you have a logical break in your
- * application. For example, an e-mail application may have a command
- * to view an attachment, which launches an image view activity to
- * display it. This activity should be part of the e-mail application's
- * task, since it is a part of the task the user is involved in. However,
- * if the user leaves that task, and later selects the e-mail app from
- * home, we may like them to return to the conversation they were
- * viewing, not the picture attachment, since that is confusing. By
- * setting this flag when launching the image viewer, that viewer and
- * any activities it starts will be removed the next time the user returns
- * to mail.
+ * @deprecated As of API 21 this performs identically to
+ * {@link #FLAG_ACTIVITY_NEW_DOCUMENT} which should be used instead of this.
*/
public static final int FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET = 0x00080000;
/**
@@ -3761,8 +3739,7 @@ public class Intent implements Parcelable, Cloneable {
* @see android.R.attr#documentLaunchMode
* @see #FLAG_ACTIVITY_MULTIPLE_TASK
*/
- public static final int FLAG_ACTIVITY_NEW_DOCUMENT =
- FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET | FLAG_ACTIVITY_NEW_TASK;
+ public static final int FLAG_ACTIVITY_NEW_DOCUMENT = FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET;
/**
* If set, this flag will prevent the normal {@link android.app.Activity#onUserLeaveHint}
* callback from occurring on the current frontmost activity before it is
diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java
index cfe471265608f..791e5aa46c7f6 100644
--- a/core/java/android/content/pm/ActivityInfo.java
+++ b/core/java/android/content/pm/ActivityInfo.java
@@ -83,6 +83,11 @@ public class ActivityInfo extends ComponentInfo
* the {@link android.R.attr#documentLaunchMode} attribute.
*/
public static final int DOCUMENT_LAUNCH_ALWAYS = 2;
+ /**
+ * Constant corresponding to never in
+ * the {@link android.R.attr#documentLaunchMode} attribute.
+ */
+ public static final int DOCUMENT_LAUNCH_NEVER = 3;
/**
* The document launch mode style requested by the activity. From the
* {@link android.R.attr#documentLaunchMode} attribute, one of
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index 3a0f7670036e0..814d8fc0c8000 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -898,16 +898,22 @@
android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT} to every Intent used to launch
the activity.
-
The documentLaunchMode attribute may be assigned one of three values, "none",
- "intoExisting" and "always", described in detail below. For values other than
- none the activity must be defined with
- {@link android.R.attr#launchMode} standard or singleTop.
+
The documentLaunchMode attribute may be assigned one of four values, "none",
+ "intoExisting", "always" and "never", described in detail below. For values other than
+ none and never the activity must be defined with
+ {@link android.R.attr#launchMode} standard.
If this attribute is not specified, none will be used.
Note that none can be overridden at run time if the Intent used
- to launch it contains the flag {@link android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT}.
+ to launch it contains the flag {@link android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT
+ Intent.FLAG_ACTIVITY_NEW_DOCUMENT}.
Similarly intoExisting will be overridden by the flag
- {@link android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT} combined with
- {@link android.content.Intent#FLAG_ACTIVITY_MULTIPLE_TASK}. -->
+ {@link android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT
+ Intent.FLAG_ACTIVITY_NEW_DOCUMENT} combined with
+ {@link android.content.Intent#FLAG_ACTIVITY_MULTIPLE_TASK
+ Intent.FLAG_ACTIVITY_MULTIPLE_TASK}. If the value of
+ documentLaunchModes is never then any use of
+.........{@link android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT
+ Intent.FLAG_ACTIVITY_NEW_DOCUMENT} to launch this activity will be ignored. -->