diff --git a/core/api/current.txt b/core/api/current.txt index 596f044c0e427..3b4ebb4ee45f8 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -31959,6 +31959,7 @@ package android.os { method @Nullable public java.util.ArrayList readArrayList(@Nullable ClassLoader, @NonNull Class); method public void readBinderArray(@NonNull android.os.IBinder[]); method public void readBinderList(@NonNull java.util.List); + method @Nullable public byte[] readBlob(); method public boolean readBoolean(); method public void readBooleanArray(@NonNull boolean[]); method @Nullable public android.os.Bundle readBundle(); @@ -32018,6 +32019,8 @@ package android.os { method public void writeArray(@Nullable Object[]); method public void writeBinderArray(@Nullable android.os.IBinder[]); method public void writeBinderList(@Nullable java.util.List); + method public void writeBlob(@Nullable byte[]); + method public void writeBlob(@Nullable byte[], int, int); method public void writeBoolean(boolean); method public void writeBooleanArray(@Nullable boolean[]); method public void writeBundle(@Nullable android.os.Bundle); diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java index 09eac79c991e5..3bc3ec83bde52 100644 --- a/core/java/android/os/Parcel.java +++ b/core/java/android/os/Parcel.java @@ -915,11 +915,15 @@ public final class Parcel { /** * Write a blob of data into the parcel at the current {@link #dataPosition}, * growing {@link #dataCapacity} if needed. + * + *

If the blob is small, then it is stored in-place, otherwise it is transferred by way of + * an anonymous shared memory region. If you prefer send in-place, please use + * {@link #writeByteArray(byte[])}. + * * @param b Bytes to place into the parcel. - * {@hide} - * {@SystemApi} + * + * @see #readBlob() */ - @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public final void writeBlob(@Nullable byte[] b) { writeBlob(b, 0, (b != null) ? b.length : 0); } @@ -927,11 +931,16 @@ public final class Parcel { /** * Write a blob of data into the parcel at the current {@link #dataPosition}, * growing {@link #dataCapacity} if needed. + * + *

If the blob is small, then it is stored in-place, otherwise it is transferred by way of + * an anonymous shared memory region. If you prefer send in-place, please use + * {@link #writeByteArray(byte[], int, int)}. + * * @param b Bytes to place into the parcel. * @param offset Index of first byte to be written. * @param len Number of bytes to write. - * {@hide} - * {@SystemApi} + * + * @see #readBlob() */ public final void writeBlob(@Nullable byte[] b, int offset, int len) { if (b == null) { @@ -3210,10 +3219,8 @@ public final class Parcel { /** * Read a blob of data from the parcel and return it as a byte array. - * {@hide} - * {@SystemApi} + * @see #writeBlob(byte[], int, int) */ - @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) @Nullable public final byte[] readBlob() { return nativeReadBlob(mNativePtr);