OSDN Git Service

If activity is an alias get maxRecents from target
authorCraig Mautner <cmautner@google.com>
Thu, 11 Sep 2014 22:03:53 +0000 (15:03 -0700)
committerCraig Mautner <cmautner@google.com>
Thu, 11 Sep 2014 22:53:44 +0000 (15:53 -0700)
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
core/java/android/content/pm/PackageParser.java

index 8d3126d..641f843 100644 (file)
@@ -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<ActivityInfo> CREATOR
@@ -754,5 +756,6 @@ public class ActivityInfo extends ComponentInfo
         uiOptions = source.readInt();
         parentActivityName = source.readString();
         persistableMode = source.readInt();
+        maxRecents = source.readInt();
     }
 }
index ddb0a6d..ffde7ce 100644 (file)
@@ -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();