From 8307ea701c8a06378bd31148bcbe4d312af2b31a Mon Sep 17 00:00:00 2001 From: Craig Mautner Date: Thu, 11 Sep 2014 15:03:53 -0700 Subject: [PATCH] If activity is an alias get maxRecents from target Activity aliases do not pick up values in the PackageParser. The actual values should come from the target activity instead. Also ActivityInfo now propagates maxRecents in copy constructor and across Binder calls (via parcelling). Fixes bug 17391328. Change-Id: I35d248032eca7557528c9d499b3b38f27c713d09 --- core/java/android/content/pm/ActivityInfo.java | 3 +++ core/java/android/content/pm/PackageParser.java | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java index 8d3126de15e1b..641f843ea2d59 100644 --- a/core/java/android/content/pm/ActivityInfo.java +++ b/core/java/android/content/pm/ActivityInfo.java @@ -657,6 +657,7 @@ public class ActivityInfo extends ComponentInfo softInputMode = orig.softInputMode; uiOptions = orig.uiOptions; parentActivityName = orig.parentActivityName; + maxRecents = orig.maxRecents; } /** @@ -728,6 +729,7 @@ public class ActivityInfo extends ComponentInfo dest.writeInt(uiOptions); dest.writeString(parentActivityName); dest.writeInt(persistableMode); + dest.writeInt(maxRecents); } public static final Parcelable.Creator CREATOR @@ -754,5 +756,6 @@ public class ActivityInfo extends ComponentInfo uiOptions = source.readInt(); parentActivityName = source.readString(); persistableMode = source.readInt(); + maxRecents = source.readInt(); } } diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index ddb0a6d7ab625..ffde7cefa9434 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -3308,7 +3308,8 @@ public class PackageParser { info.softInputMode = target.info.softInputMode; info.uiOptions = target.info.uiOptions; info.parentActivityName = target.info.parentActivityName; - + info.maxRecents = target.info.maxRecents; + Activity a = new Activity(mParseActivityAliasArgs, info); if (outError[0] != null) { sa.recycle();