summaryrefslogtreecommitdiff
path: root/core/java/android/os/Parcel.java
diff options
context:
space:
mode:
authorDavid Su <dysu@google.com>2019-12-16 15:43:47 -0800
committerDavid Su <dysu@google.com>2019-12-16 16:26:18 -0800
commit87e22207bfd4e40594f7af9a116b66bfd68e52dd (patch)
tree1de603abde2a79c9943f4f3ae9576fdb6d7ace19 /core/java/android/os/Parcel.java
parentfc2aa7d60076ba8d8eeaa40049c0d009241bebf2 (diff)
Expose @hide APIs needed by ParceledListSlice
Expose @hide APIs referenced by ParceledListSlice/ BaseParceledListSlice as public APIs. ParceledListSlice will not be made a stable API in Android R. Thus, allow it to be copied into modules that need it by ensuring it does not use any @hide APIs. Bug: 145317012 Test: compiles Change-Id: Ife85b66005ba22b03c09bf9446661368dea31945
Diffstat (limited to 'core/java/android/os/Parcel.java')
-rw-r--r--core/java/android/os/Parcel.java23
1 files changed, 19 insertions, 4 deletions
diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java
index 9eb6445d5931..339397b90afa 100644
--- a/core/java/android/os/Parcel.java
+++ b/core/java/android/os/Parcel.java
@@ -1815,8 +1815,12 @@ public final class Parcel {
p.writeToParcel(this, parcelableFlags);
}
- /** @hide */
- @UnsupportedAppUsage
+ /**
+ * Flatten the name of the class of the Parcelable into this Parcel.
+ *
+ * @param p The Parcelable object to be written.
+ * @see #readParcelableCreator
+ */
public final void writeParcelableCreator(@NonNull Parcelable p) {
String name = p.getClass().getName();
writeString(name);
@@ -3011,8 +3015,19 @@ public final class Parcel {
return (T) creator.createFromParcel(this);
}
- /** @hide */
- @UnsupportedAppUsage
+ /**
+ * Read and return a Parcelable.Creator from the parcel. The given class loader will be used to
+ * load the {@link Parcelable.Creator}. If it is null, the default class loader will be used.
+ *
+ * @param loader A ClassLoader from which to instantiate the {@link Parcelable.Creator}
+ * object, or null for the default class loader.
+ * @return the previously written {@link Parcelable.Creator}, or null if a null Creator was
+ * written.
+ * @throws BadParcelableException Throws BadParcelableException if there was an error trying to
+ * read the {@link Parcelable.Creator}.
+ *
+ * @see #writeParcelableCreator
+ */
@Nullable
public final Parcelable.Creator<?> readParcelableCreator(@Nullable ClassLoader loader) {
String name = readString();