Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 45d3bfc5 authored by Felipe Leme's avatar Felipe Leme
Browse files

Document that Bundle.getParcelableXXX() can throw exception when classloader is not set.

Fixes: 128848849
Test: mmm -j frameworks/base/:doc-comment-check-docs

Change-Id: I027176bd0b022ab0d2a45f8a757e7eb7c7665acd
parent 6625e37e
Loading
Loading
Loading
Loading
+23 −11
Original line number Diff line number Diff line
@@ -935,12 +935,16 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable {
    }

    /**
     * Returns the value associated with the given key, or null if
     * no mapping of the desired type exists for the given key or a null
     * Returns the value associated with the given key, or {@code null} if
     * no mapping of the desired type exists for the given key or a {@code null}
     * value is explicitly associated with the key.
     *
     * @param key a String, or null
     * @return a Parcelable value, or null
     * <p><b>Note: </b> if the expected value is not a class provided by the Android platform,
     * you must call {@link #setClassLoader(ClassLoader)} with the proper {@link ClassLoader} first.
     * Otherwise, this method might throw an exception or return {@code null}.
     *
     * @param key a String, or {@code null}
     * @return a Parcelable value, or {@code null}
     */
    @Nullable
    public <T extends Parcelable> T getParcelable(@Nullable String key) {
@@ -958,12 +962,16 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable {
    }

    /**
     * Returns the value associated with the given key, or null if
     * Returns the value associated with the given key, or {@code null} if
     * no mapping of the desired type exists for the given key or a null
     * value is explicitly associated with the key.
     *
     * @param key a String, or null
     * @return a Parcelable[] value, or null
     * <p><b>Note: </b> if the expected value is not a class provided by the Android platform,
     * you must call {@link #setClassLoader(ClassLoader)} with the proper {@link ClassLoader} first.
     * Otherwise, this method might throw an exception or return {@code null}.
     *
     * @param key a String, or {@code null}
     * @return a Parcelable[] value, or {@code null}
     */
    @Nullable
    public Parcelable[] getParcelableArray(@Nullable String key) {
@@ -981,12 +989,16 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable {
    }

    /**
     * Returns the value associated with the given key, or null if
     * no mapping of the desired type exists for the given key or a null
     * Returns the value associated with the given key, or {@code null} if
     * no mapping of the desired type exists for the given key or a {@code null}
     * value is explicitly associated with the key.
     *
     * @param key a String, or null
     * @return an ArrayList<T> value, or null
     * <p><b>Note: </b> if the expected value is not a class provided by the Android platform,
     * you must call {@link #setClassLoader(ClassLoader)} with the proper {@link ClassLoader} first.
     * Otherwise, this method might throw an exception or return {@code null}.
     *
     * @param key a String, or {@code null}
     * @return an ArrayList<T> value, or {@code null}
     */
    @Nullable
    public <T extends Parcelable> ArrayList<T> getParcelableArrayList(@Nullable String key) {