Add “@throws BadParcelableException” to the JavaDoc of new API methods that throw the exception.

Test: atest -d android.os.cts.ParcelTest
Bug: b/203004511
Change-Id: I24bf7314e63015d46ab478ec8c44ecf22857bac2
This commit is contained in:
Hao Ke
2021-10-14 15:09:27 +00:00
parent 12e479b70e
commit f98489f1c0

View File

@@ -2874,9 +2874,11 @@ public final class Parcel {
/**
* Same as {@link #readList(List, ClassLoader)} but accepts {@code clazz} parameter as
* the type required for each item. If the item to be deserialized is not an instance
* of that class or any of its children class
* a {@link BadParcelableException} will be thrown.
* the type required for each item.
*
* @throws BadParcelableException Throws BadParcelableException if the item to be deserialized
* is not an instance of that class or any of its children classes or there was an error
* trying to instantiate an element.
*/
public <T> void readList(@NonNull List<? super T> outVal,
@Nullable ClassLoader loader, @NonNull Class<T> clazz) {
@@ -3869,8 +3871,11 @@ public final class Parcel {
/**
* Same as {@link #readParcelable(ClassLoader)} but accepts {@code clazz} parameter as the type
* required for each item. If the item to be deserialized is not an instance of that class or
* any of its children classes a {@link BadParcelableException} will be thrown.
* required for each item.
*
* @throws BadParcelableException Throws BadParcelableException if the item to be deserialized
* is not an instance of that class or any of its children classes or there was an error
* trying to instantiate an element.
*/
@Nullable
public <T extends Parcelable> T readParcelable(@Nullable ClassLoader loader,
@@ -3936,8 +3941,11 @@ public final class Parcel {
/**
* Same as {@link #readParcelableCreator(ClassLoader)} but accepts {@code clazz} parameter
* as the required type. If the item to be deserialized is not an instance of that class
* or any of its children classes a {@link BadParcelableException} will be thrown.
* as the required type.
*
* @throws BadParcelableException Throws BadParcelableException if the item to be deserialized
* is not an instance of that class or any of its children class or there there was an error
* trying to read the {@link Parcelable.Creator}.
*/
@Nullable
public <T> Parcelable.Creator<T> readParcelableCreator(