Unhide Parcel.writeTypedList() with additional flag

The flag should be propagated to Parcelable.writeToParcel(). But since
it was hidden, we were not able to pass the flag to elements of the
list.

Bug: 215654054
Test: atest android.os.cts.ParcelTest
Change-Id: I72d419caa74c62d979c5102ebd8eba4338ec3e3b
This commit is contained in:
Jooyung Han 2022-05-27 18:33:52 +09:00
parent 4e76dec6c3
commit 8cff29b8ea
2 changed files with 15 additions and 1 deletions

View File

@ -30355,6 +30355,7 @@ package android.os {
method public <T extends android.os.Parcelable> void writeTypedArray(@Nullable T[], int);
method public <T extends android.os.Parcelable> void writeTypedArrayMap(@Nullable android.util.ArrayMap<java.lang.String,T>, int);
method public <T extends android.os.Parcelable> void writeTypedList(@Nullable java.util.List<T>);
method public <T extends android.os.Parcelable> void writeTypedList(@Nullable java.util.List<T>, int);
method public <T extends android.os.Parcelable> void writeTypedObject(@Nullable T, int);
method public <T extends android.os.Parcelable> void writeTypedSparseArray(@Nullable android.util.SparseArray<T>, int);
method public void writeValue(@Nullable Object);

View File

@ -1990,7 +1990,20 @@ public final class Parcel {
}
/**
* @hide
* Flatten a List containing a particular object type into the parcel, at
* the current dataPosition() and growing dataCapacity() if needed. The
* type of the objects in the list must be one that implements Parcelable.
* Unlike the generic writeList() method, however, only the raw data of the
* objects is written and not their type, so you must use the corresponding
* readTypedList() to unmarshall them.
*
* @param val The list of objects to be written.
* @param parcelableFlags Contextual flags as per
* {@link Parcelable#writeToParcel(Parcel, int) Parcelable.writeToParcel()}.
*
* @see #createTypedArrayList
* @see #readTypedList
* @see Parcelable
*/
public <T extends Parcelable> void writeTypedList(@Nullable List<T> val, int parcelableFlags) {
if (val == null) {