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

Commit 073ec93b authored by David Su's avatar David Su Committed by Android (Google) Code Review
Browse files

Merge "Expose @hide APIs needed by ParceledListSlice"

parents 14610721 87e22207
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -35029,6 +35029,7 @@ package android.os {
    method public void dump(@NonNull java.io.FileDescriptor, @Nullable String[]) throws android.os.RemoteException;
    method public void dumpAsync(@NonNull java.io.FileDescriptor, @Nullable String[]) throws android.os.RemoteException;
    method @Nullable public String getInterfaceDescriptor() throws android.os.RemoteException;
    method public static int getSuggestedMaxIpcSizeBytes();
    method public boolean isBinderAlive();
    method public void linkToDeath(@NonNull android.os.IBinder.DeathRecipient, int) throws android.os.RemoteException;
    method public boolean pingBinder();
@@ -35225,6 +35226,7 @@ package android.os {
    method public void readMap(@NonNull java.util.Map, @Nullable ClassLoader);
    method @Nullable public <T extends android.os.Parcelable> T readParcelable(@Nullable ClassLoader);
    method @Nullable public android.os.Parcelable[] readParcelableArray(@Nullable ClassLoader);
    method @Nullable public android.os.Parcelable.Creator<?> readParcelableCreator(@Nullable ClassLoader);
    method @NonNull public <T extends android.os.Parcelable> java.util.List<T> readParcelableList(@NonNull java.util.List<T>, @Nullable ClassLoader);
    method @Nullable public android.os.PersistableBundle readPersistableBundle();
    method @Nullable public android.os.PersistableBundle readPersistableBundle(@Nullable ClassLoader);
@@ -35272,6 +35274,7 @@ package android.os {
    method public void writeNoException();
    method public void writeParcelable(@Nullable android.os.Parcelable, int);
    method public <T extends android.os.Parcelable> void writeParcelableArray(@Nullable T[], int);
    method public void writeParcelableCreator(@NonNull android.os.Parcelable);
    method public <T extends android.os.Parcelable> void writeParcelableList(@Nullable java.util.List<T>, int);
    method public void writePersistableBundle(@Nullable android.os.PersistableBundle);
    method public void writeSerializable(@Nullable java.io.Serializable);
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ abstract class BaseParceledListSlice<T> implements Parcelable {
     * TODO get this number from somewhere else. For now set it to a quarter of
     * the 1MB limit.
     */
    private static final int MAX_IPC_SIZE = IBinder.MAX_IPC_SIZE;
    private static final int MAX_IPC_SIZE = IBinder.getSuggestedMaxIpcSizeBytes();

    private final List<T> mList;

+8 −0
Original line number Diff line number Diff line
@@ -181,6 +181,14 @@ public interface IBinder {
     */
    public static final int MAX_IPC_SIZE = 64 * 1024;

    /**
     * Limit that should be placed on IPC sizes, in bytes, to keep them safely under the transaction
     * buffer limit.
     */
    static int getSuggestedMaxIpcSizeBytes() {
        return MAX_IPC_SIZE;
    }

    /**
     * Get the canonical name of the interface supported by this binder.
     */
+19 −4
Original line number Diff line number Diff line
@@ -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();