Correct ActivityInfo constructors.
ActivityInfo was missing initialization for the documentLaunchMode flag in the copy-constructor and the Parcel constructor. The copy-constructor is used in multi-user/profile mode to create a seperate instance of the ActivityInfo per uid and this was manifesting in the linked bug. Bug: 21590915 Change-Id: I6f71d94ec32ec6326d23c9b62e9d8d319e2fa25e
This commit is contained in:
@@ -33,12 +33,16 @@ import java.lang.annotation.RetentionPolicy;
|
||||
*/
|
||||
public class ActivityInfo extends ComponentInfo
|
||||
implements Parcelable {
|
||||
|
||||
// NOTE: When adding new data members be sure to update the copy-constructor, Parcel
|
||||
// constructor, and writeToParcel.
|
||||
|
||||
/**
|
||||
* A style resource identifier (in the package's resources) of this
|
||||
* activity's theme. From the "theme" attribute or, if not set, 0.
|
||||
*/
|
||||
public int theme;
|
||||
|
||||
|
||||
/**
|
||||
* Constant corresponding to <code>standard</code> in
|
||||
* the {@link android.R.attr#launchMode} attribute.
|
||||
@@ -707,6 +711,7 @@ public class ActivityInfo extends ComponentInfo
|
||||
super(orig);
|
||||
theme = orig.theme;
|
||||
launchMode = orig.launchMode;
|
||||
documentLaunchMode = orig.documentLaunchMode;
|
||||
permission = orig.permission;
|
||||
taskAffinity = orig.taskAffinity;
|
||||
targetActivity = orig.targetActivity;
|
||||
@@ -788,6 +793,7 @@ public class ActivityInfo extends ComponentInfo
|
||||
super.writeToParcel(dest, parcelableFlags);
|
||||
dest.writeInt(theme);
|
||||
dest.writeInt(launchMode);
|
||||
dest.writeInt(documentLaunchMode);
|
||||
dest.writeString(permission);
|
||||
dest.writeString(taskAffinity);
|
||||
dest.writeString(targetActivity);
|
||||
@@ -827,6 +833,7 @@ public class ActivityInfo extends ComponentInfo
|
||||
super(source);
|
||||
theme = source.readInt();
|
||||
launchMode = source.readInt();
|
||||
documentLaunchMode = source.readInt();
|
||||
permission = source.readString();
|
||||
taskAffinity = source.readString();
|
||||
targetActivity = source.readString();
|
||||
|
||||
Reference in New Issue
Block a user