diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java index 5a09c0028cdce..94c406a882e23 100644 --- a/core/java/android/content/pm/ActivityInfo.java +++ b/core/java/android/content/pm/ActivityInfo.java @@ -332,6 +332,14 @@ public class ActivityInfo extends ComponentInfo */ public static final int FLAG_ALWAYS_FOCUSABLE = 0x40000; + /** + * Bit in {@link #flags} indicating if the activity is a launcher activity which should always + * show up on the top of others. + * See android.R.attr#onTopLauncher. + * @hide + */ + public static final int FLAG_ON_TOP_LAUNCHER = 0x80000; + /** * @hide Bit in {@link #flags}: If set, this component will only be seen * by the system user. Only works with broadcast receivers. Set from the diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index adf9fe62c37e5..7b40cc5cb2c2b 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -79,6 +79,7 @@ import libcore.io.IoUtils; import static android.content.pm.ActivityInfo.FLAG_ALWAYS_FOCUSABLE; import static android.content.pm.ActivityInfo.FLAG_IMMERSIVE; +import static android.content.pm.ActivityInfo.FLAG_ON_TOP_LAUNCHER; import static android.content.pm.ActivityInfo.RESIZE_MODE_FORCE_RESIZEABLE; import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE; import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE_AND_PIPABLE; @@ -3567,6 +3568,10 @@ public class PackageParser { a.info.flags |= FLAG_ALWAYS_FOCUSABLE; } + if (sa.getBoolean(R.styleable.AndroidManifestActivity_onTopLauncher, false)) { + a.info.flags |= FLAG_ON_TOP_LAUNCHER; + } + a.info.lockTaskLaunchMode = sa.getInt(R.styleable.AndroidManifestActivity_lockTaskMode, 0); diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml index d69d73db60916..e1bbef7555ab8 100644 --- a/core/res/res/values/attrs_manifest.xml +++ b/core/res/res/values/attrs_manifest.xml @@ -1898,6 +1898,9 @@ in a task/stack that isn't focusable. This flag allows them to be focusable.--> + +