Merge "Make AbsSavedState read using given ClassLoader" into nyc-dev
am: b02d51b
* commit 'b02d51b3d31b1a49ddc7c7e7db97b576d6e4f78f':
Make AbsSavedState read using given ClassLoader
Change-Id: I680a362e229c7ebbd42f344fa7446aff86fa98ae
This commit is contained in:
@@ -40825,6 +40825,7 @@ package android.view {
|
|||||||
public abstract class AbsSavedState implements android.os.Parcelable {
|
public abstract class AbsSavedState implements android.os.Parcelable {
|
||||||
ctor protected AbsSavedState(android.os.Parcelable);
|
ctor protected AbsSavedState(android.os.Parcelable);
|
||||||
ctor protected AbsSavedState(android.os.Parcel);
|
ctor protected AbsSavedState(android.os.Parcel);
|
||||||
|
ctor protected AbsSavedState(android.os.Parcel, java.lang.ClassLoader);
|
||||||
method public int describeContents();
|
method public int describeContents();
|
||||||
method public final android.os.Parcelable getSuperState();
|
method public final android.os.Parcelable getSuperState();
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
method public void writeToParcel(android.os.Parcel, int);
|
||||||
@@ -42941,6 +42942,7 @@ package android.view {
|
|||||||
|
|
||||||
public static class View.BaseSavedState extends android.view.AbsSavedState {
|
public static class View.BaseSavedState extends android.view.AbsSavedState {
|
||||||
ctor public View.BaseSavedState(android.os.Parcel);
|
ctor public View.BaseSavedState(android.os.Parcel);
|
||||||
|
ctor public View.BaseSavedState(android.os.Parcel, java.lang.ClassLoader);
|
||||||
ctor public View.BaseSavedState(android.os.Parcelable);
|
ctor public View.BaseSavedState(android.os.Parcelable);
|
||||||
field public static final android.os.Parcelable.Creator<android.view.View.BaseSavedState> CREATOR;
|
field public static final android.os.Parcelable.Creator<android.view.View.BaseSavedState> CREATOR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43838,6 +43838,7 @@ package android.view {
|
|||||||
public abstract class AbsSavedState implements android.os.Parcelable {
|
public abstract class AbsSavedState implements android.os.Parcelable {
|
||||||
ctor protected AbsSavedState(android.os.Parcelable);
|
ctor protected AbsSavedState(android.os.Parcelable);
|
||||||
ctor protected AbsSavedState(android.os.Parcel);
|
ctor protected AbsSavedState(android.os.Parcel);
|
||||||
|
ctor protected AbsSavedState(android.os.Parcel, java.lang.ClassLoader);
|
||||||
method public int describeContents();
|
method public int describeContents();
|
||||||
method public final android.os.Parcelable getSuperState();
|
method public final android.os.Parcelable getSuperState();
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
method public void writeToParcel(android.os.Parcel, int);
|
||||||
@@ -45954,6 +45955,7 @@ package android.view {
|
|||||||
|
|
||||||
public static class View.BaseSavedState extends android.view.AbsSavedState {
|
public static class View.BaseSavedState extends android.view.AbsSavedState {
|
||||||
ctor public View.BaseSavedState(android.os.Parcel);
|
ctor public View.BaseSavedState(android.os.Parcel);
|
||||||
|
ctor public View.BaseSavedState(android.os.Parcel, java.lang.ClassLoader);
|
||||||
ctor public View.BaseSavedState(android.os.Parcelable);
|
ctor public View.BaseSavedState(android.os.Parcelable);
|
||||||
field public static final android.os.Parcelable.Creator<android.view.View.BaseSavedState> CREATOR;
|
field public static final android.os.Parcelable.Creator<android.view.View.BaseSavedState> CREATOR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40902,6 +40902,7 @@ package android.view {
|
|||||||
public abstract class AbsSavedState implements android.os.Parcelable {
|
public abstract class AbsSavedState implements android.os.Parcelable {
|
||||||
ctor protected AbsSavedState(android.os.Parcelable);
|
ctor protected AbsSavedState(android.os.Parcelable);
|
||||||
ctor protected AbsSavedState(android.os.Parcel);
|
ctor protected AbsSavedState(android.os.Parcel);
|
||||||
|
ctor protected AbsSavedState(android.os.Parcel, java.lang.ClassLoader);
|
||||||
method public int describeContents();
|
method public int describeContents();
|
||||||
method public final android.os.Parcelable getSuperState();
|
method public final android.os.Parcelable getSuperState();
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
method public void writeToParcel(android.os.Parcel, int);
|
||||||
@@ -43018,6 +43019,7 @@ package android.view {
|
|||||||
|
|
||||||
public static class View.BaseSavedState extends android.view.AbsSavedState {
|
public static class View.BaseSavedState extends android.view.AbsSavedState {
|
||||||
ctor public View.BaseSavedState(android.os.Parcel);
|
ctor public View.BaseSavedState(android.os.Parcel);
|
||||||
|
ctor public View.BaseSavedState(android.os.Parcel, java.lang.ClassLoader);
|
||||||
ctor public View.BaseSavedState(android.os.Parcelable);
|
ctor public View.BaseSavedState(android.os.Parcelable);
|
||||||
field public static final android.os.Parcelable.Creator<android.view.View.BaseSavedState> CREATOR;
|
field public static final android.os.Parcelable.Creator<android.view.View.BaseSavedState> CREATOR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public abstract class AbsSavedState implements Parcelable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor called by derived classes when creating their SavedState objects
|
* Constructor called by derived classes when creating their SavedState objects
|
||||||
*
|
*
|
||||||
* @param superState The state of the superclass of this view
|
* @param superState The state of the superclass of this view
|
||||||
*/
|
*/
|
||||||
protected AbsSavedState(Parcelable superState) {
|
protected AbsSavedState(Parcelable superState) {
|
||||||
@@ -49,13 +49,22 @@ public abstract class AbsSavedState implements Parcelable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor used when reading from a parcel. Reads the state of the superclass.
|
* Constructor used when reading from a parcel. Reads the state of the superclass.
|
||||||
*
|
*
|
||||||
* @param source
|
* @param source parcel to read from
|
||||||
*/
|
*/
|
||||||
protected AbsSavedState(Parcel source) {
|
protected AbsSavedState(Parcel source) {
|
||||||
// FIXME need class loader
|
this(source, null);
|
||||||
Parcelable superState = source.readParcelable(null);
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor used when reading from a parcel using a given class loader.
|
||||||
|
* Reads the state of the superclass.
|
||||||
|
*
|
||||||
|
* @param source parcel to read from
|
||||||
|
* @param loader ClassLoader to use for reading
|
||||||
|
*/
|
||||||
|
protected AbsSavedState(Parcel source, ClassLoader loader) {
|
||||||
|
Parcelable superState = source.readParcelable(loader);
|
||||||
mSuperState = superState != null ? superState : EMPTY_STATE;
|
mSuperState = superState != null ? superState : EMPTY_STATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,20 +77,27 @@ public abstract class AbsSavedState implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void writeToParcel(Parcel dest, int flags) {
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
dest.writeParcelable(mSuperState, flags);
|
dest.writeParcelable(mSuperState, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Parcelable.Creator<AbsSavedState> CREATOR
|
public static final Parcelable.Creator<AbsSavedState> CREATOR
|
||||||
= new Parcelable.Creator<AbsSavedState>() {
|
= new Parcelable.ClassLoaderCreator<AbsSavedState>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public AbsSavedState createFromParcel(Parcel in) {
|
public AbsSavedState createFromParcel(Parcel in) {
|
||||||
Parcelable superState = in.readParcelable(null);
|
return createFromParcel(in, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AbsSavedState createFromParcel(Parcel in, ClassLoader loader) {
|
||||||
|
Parcelable superState = in.readParcelable(loader);
|
||||||
if (superState != null) {
|
if (superState != null) {
|
||||||
throw new IllegalStateException("superState must be null");
|
throw new IllegalStateException("superState must be null");
|
||||||
}
|
}
|
||||||
return EMPTY_STATE;
|
return EMPTY_STATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public AbsSavedState[] newArray(int size) {
|
public AbsSavedState[] newArray(int size) {
|
||||||
return new AbsSavedState[size];
|
return new AbsSavedState[size];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22575,10 +22575,21 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
|||||||
/**
|
/**
|
||||||
* Constructor used when reading from a parcel. Reads the state of the superclass.
|
* Constructor used when reading from a parcel. Reads the state of the superclass.
|
||||||
*
|
*
|
||||||
* @param source
|
* @param source parcel to read from
|
||||||
*/
|
*/
|
||||||
public BaseSavedState(Parcel source) {
|
public BaseSavedState(Parcel source) {
|
||||||
super(source);
|
this(source, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor used when reading from a parcel using a given class loader.
|
||||||
|
* Reads the state of the superclass.
|
||||||
|
*
|
||||||
|
* @param source parcel to read from
|
||||||
|
* @param loader ClassLoader to use for reading
|
||||||
|
*/
|
||||||
|
public BaseSavedState(Parcel source, ClassLoader loader) {
|
||||||
|
super(source, loader);
|
||||||
mStartActivityRequestWhoSaved = source.readString();
|
mStartActivityRequestWhoSaved = source.readString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22597,12 +22608,19 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
|||||||
out.writeString(mStartActivityRequestWhoSaved);
|
out.writeString(mStartActivityRequestWhoSaved);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Parcelable.Creator<BaseSavedState> CREATOR =
|
public static final Parcelable.Creator<BaseSavedState> CREATOR
|
||||||
new Parcelable.Creator<BaseSavedState>() {
|
= new Parcelable.ClassLoaderCreator<BaseSavedState>() {
|
||||||
|
@Override
|
||||||
public BaseSavedState createFromParcel(Parcel in) {
|
public BaseSavedState createFromParcel(Parcel in) {
|
||||||
return new BaseSavedState(in);
|
return new BaseSavedState(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BaseSavedState createFromParcel(Parcel in, ClassLoader loader) {
|
||||||
|
return new BaseSavedState(in, loader);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public BaseSavedState[] newArray(int size) {
|
public BaseSavedState[] newArray(int size) {
|
||||||
return new BaseSavedState[size];
|
return new BaseSavedState[size];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user