Merge "Deprecate unsafe Parcel.readParcelableArray(ClassLoader)" am: 2ee662c767 am: 91e53b04aa am: 017bfa357a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1910046 Change-Id: Ibd6a6dcfc757ba244333e44b75d9e03907bd0400
This commit is contained in:
@@ -31652,7 +31652,7 @@ package android.os {
|
|||||||
method public <K, V> void readMap(@NonNull java.util.Map<? super K,? super V>, @Nullable ClassLoader, @NonNull Class<K>, @NonNull Class<V>);
|
method public <K, V> void readMap(@NonNull java.util.Map<? super K,? super V>, @Nullable ClassLoader, @NonNull Class<K>, @NonNull Class<V>);
|
||||||
method @Deprecated @Nullable public <T extends android.os.Parcelable> T readParcelable(@Nullable ClassLoader);
|
method @Deprecated @Nullable public <T extends android.os.Parcelable> T readParcelable(@Nullable ClassLoader);
|
||||||
method @Nullable public <T extends android.os.Parcelable> T readParcelable(@Nullable ClassLoader, @NonNull Class<T>);
|
method @Nullable public <T extends android.os.Parcelable> T readParcelable(@Nullable ClassLoader, @NonNull Class<T>);
|
||||||
method @Nullable public android.os.Parcelable[] readParcelableArray(@Nullable ClassLoader);
|
method @Deprecated @Nullable public android.os.Parcelable[] readParcelableArray(@Nullable ClassLoader);
|
||||||
method @Nullable public <T> T[] readParcelableArray(@Nullable ClassLoader, @NonNull Class<T>);
|
method @Nullable public <T> T[] readParcelableArray(@Nullable ClassLoader, @NonNull Class<T>);
|
||||||
method @Deprecated @Nullable public android.os.Parcelable.Creator<?> readParcelableCreator(@Nullable ClassLoader);
|
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 @Nullable public <T> android.os.Parcelable.Creator<T> readParcelableCreator(@Nullable ClassLoader, @NonNull Class<T>);
|
||||||
|
|||||||
@@ -4388,9 +4388,16 @@ public final class Parcel {
|
|||||||
* The given class loader will be used to load any enclosed
|
* The given class loader will be used to load any enclosed
|
||||||
* Parcelables.
|
* Parcelables.
|
||||||
* @return the Parcelable array, or null if the array is null
|
* @return the Parcelable array, or null if the array is null
|
||||||
|
*
|
||||||
|
* @deprecated Use the type-safer version {@link #readParcelableArray(ClassLoader, Class)}
|
||||||
|
* starting from Android {@link Build.VERSION_CODES#TIRAMISU}. Also consider changing the
|
||||||
|
* format to use {@link #createTypedArray(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
|
||||||
@Nullable
|
@Nullable
|
||||||
public final Parcelable[] readParcelableArray(@Nullable ClassLoader loader) {
|
public Parcelable[] readParcelableArray(@Nullable ClassLoader loader) {
|
||||||
int N = readInt();
|
int N = readInt();
|
||||||
if (N < 0) {
|
if (N < 0) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user