am d5a99922: Merge "Add attributes and flags for DocCentric."

* commit 'd5a9992273039671f2a7155597cf4150599df761':
  Add attributes and flags for DocCentric.
This commit is contained in:
Craig Mautner
2014-05-07 16:05:49 +00:00
committed by Android Git Automerger
6 changed files with 125 additions and 15 deletions

View File

@@ -3736,7 +3736,8 @@ public class Intent implements Parcelable, Cloneable {
*
* <p>When set, the activity specified by this Intent will launch into a
* separate task rooted at that activity. The activity launched must be
* defined with {@link android.R.attr#launchMode} "standard" or "singleTop".
* defined with {@link android.R.attr#launchMode} <code>standard</code>
* or <code>singleTop</code>.
*
* <p>If FLAG_ACTIVITY_NEW_DOCUMENT is used without
* {@link #FLAG_ACTIVITY_MULTIPLE_TASK} then the activity manager will
@@ -3751,6 +3752,8 @@ public class Intent implements Parcelable, Cloneable {
* always create a new task. Thus the same document may be made to appear
* more than one time in Recents.
*
* <p>This is equivalent to the attribute {@link android.R.attr#documentLaunchMode}.
*
* @see #FLAG_ACTIVITY_MULTIPLE_TASK
*/
public static final int FLAG_ACTIVITY_NEW_DOCUMENT =
@@ -3814,6 +3817,15 @@ public class Intent implements Parcelable, Cloneable {
* saw. This can only be used in conjunction with {@link #FLAG_ACTIVITY_NEW_TASK}.
*/
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.
*
* <p>This is equivalent to the attribute
* {@link android.R.styleable#AndroidManifestActivity_autoRemoveFromRecents}.
*/
public static final int FLAG_ACTIVITY_AUTO_REMOVE_FROM_RECENTS = 0x00002000;
/**
* If set, when sending a broadcast only registered receivers will be
* called -- no BroadcastReceiver components will be launched.
@@ -4019,7 +4031,7 @@ public class Intent implements Parcelable, Cloneable {
/**
* Create an intent for a specific component with a specified action and data.
* This is equivalent using {@link #Intent(String, android.net.Uri)} to
* This is equivalent to using {@link #Intent(String, android.net.Uri)} to
* construct the Intent and then calling {@link #setClass} to set its
* class.
*

View File

@@ -67,7 +67,37 @@ public class ActivityInfo extends ComponentInfo
* {@link #LAUNCH_SINGLE_INSTANCE}.
*/
public int launchMode;
/**
* Constant corresponding to <code>none</code> in
* the {@link android.R.attr#documentLaunchMode} attribute.
*/
public static final int DOCUMENT_LAUNCH_NONE = 0;
/**
* Constant corresponding to <code>intoExisting</code> in
* the {@link android.R.attr#documentLaunchMode} attribute.
*/
public static final int DOCUMENT_LAUNCH_INTO_EXISTING = 1;
/**
* Constant corresponding to <code>always</code> in
* the {@link android.R.attr#documentLaunchMode} attribute.
*/
public static final int DOCUMENT_LAUNCH_ALWAYS = 2;
/**
* The document launch mode style requested by the activity. From the
* {@link android.R.attr#documentLaunchMode} attribute, one of
* {@link #DOCUMENT_LAUNCH_NONE}, {@link #DOCUMENT_LAUNCH_INTO_EXISTING},
* {@link #DOCUMENT_LAUNCH_ALWAYS}.
*
* <p>Modes DOCUMENT_LAUNCH_ALWAYS
* and DOCUMENT_LAUNCH_INTO_EXISTING are equivalent to {@link
* android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT
* Intent.FLAG_ACTIVITY_NEW_DOCUMENT} with and without {@link
* android.content.Intent#FLAG_ACTIVITY_MULTIPLE_TASK
* Intent.FLAG_ACTIVITY_MULTIPLE_TASK} respectively.
*/
public int documentLaunchMode;
/**
* Optional name of a permission required to be able to access this
* Activity. From the "permission" attribute.
@@ -192,9 +222,14 @@ public class ActivityInfo extends ComponentInfo
* Bit in {@link #flags} indicating that this activity is to be persisted across
* reboots for display in the Recents list.
* {@link android.R.attr#persistable}
* @hide
*/
public static final int FLAG_PERSISTABLE = 0x1000;
/**
* Bit in {@link #flags} indicating that tasks started with this activity are to be
* removed from the recent list of tasks when the last activity in the task is finished.
* {@link android.R.attr#autoRemoveFromRecents}
*/
public static final int FLAG_AUTO_REMOVE_FROM_RECENTS = 0x2000;
/**
* @hide Bit in {@link #flags}: If set, this component will only be seen
* by the primary user. Only works with broadcast receivers. Set from the

View File

@@ -2462,17 +2462,6 @@ public class PackageParser {
a.info.flags |= ActivityInfo.FLAG_IMMERSIVE;
}
if (sa.getBoolean(
com.android.internal.R.styleable.AndroidManifestActivity_persistable, false)) {
a.info.flags |= ActivityInfo.FLAG_PERSISTABLE;
}
if (sa.getBoolean(
com.android.internal.R.styleable.AndroidManifestActivity_allowEmbedded,
false)) {
a.info.flags |= ActivityInfo.FLAG_ALLOW_EMBEDDED;
}
if (!receiver) {
if (sa.getBoolean(
com.android.internal.R.styleable.AndroidManifestActivity_hardwareAccelerated,
@@ -2483,6 +2472,9 @@ public class PackageParser {
a.info.launchMode = sa.getInt(
com.android.internal.R.styleable.AndroidManifestActivity_launchMode,
ActivityInfo.LAUNCH_MULTIPLE);
a.info.documentLaunchMode = sa.getInt(
com.android.internal.R.styleable.AndroidManifestActivity_documentLaunchMode,
ActivityInfo.DOCUMENT_LAUNCH_NONE);
a.info.screenOrientation = sa.getInt(
com.android.internal.R.styleable.AndroidManifestActivity_screenOrientation,
ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
@@ -2492,6 +2484,23 @@ public class PackageParser {
a.info.softInputMode = sa.getInt(
com.android.internal.R.styleable.AndroidManifestActivity_windowSoftInputMode,
0);
if (sa.getBoolean(
com.android.internal.R.styleable.AndroidManifestActivity_persistable, false)) {
a.info.flags |= ActivityInfo.FLAG_PERSISTABLE;
}
if (sa.getBoolean(
com.android.internal.R.styleable.AndroidManifestActivity_allowEmbedded,
false)) {
a.info.flags |= ActivityInfo.FLAG_ALLOW_EMBEDDED;
}
if (sa.getBoolean(
com.android.internal.R.styleable.AndroidManifestActivity_autoRemoveFromRecents,
false)) {
a.info.flags |= ActivityInfo.FLAG_AUTO_REMOVE_FROM_RECENTS;
}
} else {
a.info.launchMode = ActivityInfo.LAUNCH_MULTIPLE;
a.info.configChanges = 0;