Merge "Deprecate unsafe readParcelableList API." am: f75e459db0 am: ffabccb807 am: d6948b9583 am: 62c4143833

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1909291

Change-Id: I5a37fb8423f98ef07d2522ec9e6b1647ed21f2bf
This commit is contained in:
Hao Ke
2021-12-02 22:26:39 +00:00
committed by Automerger Merge Worker
2 changed files with 8 additions and 1 deletions

View File

@@ -31856,7 +31856,7 @@ package android.os {
method @Nullable public <T> T[] readParcelableArray(@Nullable ClassLoader, @NonNull Class<T>);
method @Deprecated @Nullable public android.os.Parcelable.Creator<?> readParcelableCreator(@Nullable ClassLoader);
method @Nullable public <T> android.os.Parcelable.Creator<T> readParcelableCreator(@Nullable ClassLoader, @NonNull Class<T>);
method @NonNull public <T extends android.os.Parcelable> java.util.List<T> readParcelableList(@NonNull java.util.List<T>, @Nullable ClassLoader);
method @Deprecated @NonNull public <T extends android.os.Parcelable> java.util.List<T> readParcelableList(@NonNull java.util.List<T>, @Nullable ClassLoader);
method @NonNull public <T> java.util.List<T> readParcelableList(@NonNull java.util.List<T>, @Nullable ClassLoader, @NonNull Class<T>);
method @Nullable public android.os.PersistableBundle readPersistableBundle();
method @Nullable public android.os.PersistableBundle readPersistableBundle(@Nullable ClassLoader);

View File

@@ -3646,7 +3646,14 @@ public final class Parcel {
* list was {@code null}, {@code list} is cleared.
*
* @see #writeParcelableList(List, int)
*
* @deprecated Use the type-safer version {@link #readParcelableList(List, ClassLoader, Class)}
* starting from Android {@link Build.VERSION_CODES#TIRAMISU}. Also consider changing the
* format to use {@link #readTypedList(List, Parcelable.Creator)} if possible (eg. if the
* items' class is final) since this is also more performant. Note that changing to the
* latter also requires changing the writes.
*/
@Deprecated
@NonNull
public final <T extends Parcelable> List<T> readParcelableList(@NonNull List<T> list,
@Nullable ClassLoader cl) {