class Parcel

Defined at line 64 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

Public Methods

void Parcel ()
const uint8_t * data ()
size_t dataSize ()
size_t dataAvail ()
size_t dataPosition ()
size_t dataCapacity ()
size_t dataBufferSize ()
status_t appendFrom (const Parcel * parcel, size_t start, size_t len)
int compareData (const Parcel & other)
status_t compareDataInRange (size_t thisOffset, const Parcel & other, size_t otherOffset, size_t length, int * result)
bool allowFds ()
bool pushAllowFds (bool allowFds)
bool hasFileDescriptors ()
status_t hasBinders (bool * result)
status_t hasFileDescriptorsInRange (size_t offset, size_t length, bool * result)
status_t hasBindersInRange (size_t offset, size_t length, bool * result)
std::vector<sp<IBinder>> debugReadAllStrongBinders ()

returns all binder objects in the Parcel

std::vector<int> debugReadAllFileDescriptors ()

returns all file descriptors in the Parcel

does not dup

void markSensitive ()

Zeros data when reallocating. Other mitigations may be added

in the future.

WARNING: some read methods may make additional copies of data.

In order to verify this, heap dumps should be used.

void markForBinder (const sp<IBinder> & binder)

For a 'data' Parcel, this should mark the Parcel as being prepared for a

transaction on this specific binder object. Based on this, the format of

the wire binder protocol may change (data is written differently when it

is for an RPC transaction).

void markForRpc (const sp<RpcSession> & session)

Whenever possible, markForBinder should be preferred. This method is

called automatically on reply Parcels for RPC transactions.

bool isForRpc ()

Whether this Parcel is written for RPC transactions (after calls to

markForBinder or markForRpc).

bool enforceInterface (const String16 & interface, IPCThreadState * threadState)

Parses the RPC header, returning true if the interface name

in the header matches the expected interface from the caller.

Additionally, enforceInterface does part of the work of

propagating the StrictMode policy mask, populating the current

IPCThreadState, which as an optimization may optionally be

passed in.

bool enforceInterface (const char16_t * interface, size_t len, IPCThreadState * threadState)
bool checkInterface (IBinder * )
binder::Status enforceNoDataAvail ()

Verify there are no bytes left to be read on the Parcel.

Returns Status(EX_BAD_PARCELABLE) when the Parcel is not consumed.

bool isServiceFuzzing ()
void freeData ()
size_t objectsCount ()
status_t errorCheck ()
template <typename T, std::enable_if_t<std::is_base_of_v<::android::IInterface, T>, bool> = true>
status_t writeStrongBinder (const sp<T> & val)

Write an IInterface or a vector of IInterface's

Defined at line 262 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T, std::enable_if_t<std::is_base_of_v<::android::IInterface, T>, bool> = true>
status_t writeStrongBinderVector (const std::vector<sp<T>> & val)

Defined at line 267 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T, std::enable_if_t<std::is_base_of_v<::android::IInterface, T>, bool> = true>
status_t writeStrongBinderVector (const std::optional<std::vector<sp<T>>> & val)

Defined at line 272 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T, size_t N>
status_t writeFixedArray (const std::array<T, N> & val)

Defined at line 277 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T, size_t N>
status_t writeFixedArray (const std::optional<std::array<T, N>> & val)

Defined at line 281 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T, std::enable_if_t<std::is_enum_v<T> && std::is_same_v<typename std::underlying_type_t<T>,int8_t>, bool> = 0>
status_t writeEnumVector (const std::vector<T> & val)

Write an Enum vector with underlying type int8_t.

Does not use padding; each byte is contiguous.

Defined at line 288 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T, std::enable_if_t<std::is_enum_v<T> && std::is_same_v<typename std::underlying_type_t<T>,int8_t>, bool> = 0>
status_t writeEnumVector (const std::optional<std::vector<T>> & val)

Defined at line 291 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T, std::enable_if_t<std::is_enum_v<T> && std::is_same_v<typename std::underlying_type_t<T>,int8_t>, bool> = 0>
status_t writeEnumVector (const std::unique_ptr<std::vector<T>> & val)

Defined at line 294 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T, std::enable_if_t<std::is_enum_v<T> && !std::is_same_v<typename std::underlying_type_t<T>,int8_t>, bool> = 0>
status_t writeEnumVector (const std::vector<T> & val)

Write an Enum vector with underlying type != int8_t.

Defined at line 299 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T, std::enable_if_t<std::is_enum_v<T> && !std::is_same_v<typename std::underlying_type_t<T>,int8_t>, bool> = 0>
status_t writeEnumVector (const std::optional<std::vector<T>> & val)

Defined at line 302 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T, std::enable_if_t<std::is_enum_v<T> && !std::is_same_v<typename std::underlying_type_t<T>,int8_t>, bool> = 0>
status_t writeEnumVector (const std::unique_ptr<std::vector<T>> & val)

Defined at line 305 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t writeParcelableVector (const std::optional<std::vector<std::optional<T>>> & val)

Defined at line 310 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t writeParcelableVector (const std::unique_ptr<std::vector<std::unique_ptr<T>>> & val)

Defined at line 313 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t writeParcelableVector (const std::shared_ptr<std::vector<std::unique_ptr<T>>> & val)

Defined at line 317 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t writeParcelableVector (const std::shared_ptr<std::vector<std::optional<T>>> & val)

Defined at line 321 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t writeParcelableVector (const std::vector<T> & val)

Defined at line 324 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t writeNullableParcelable (const std::optional<T> & parcelable)

Defined at line 328 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t writeNullableParcelable (const std::unique_ptr<T> & parcelable)

Defined at line 331 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T, std::enable_if_t<std::is_enum_v<T> && std::is_same_v<typename std::underlying_type_t<T>,int8_t>, bool> = 0>
status_t readEnumVector (std::vector<T> * val)

Read an Enum vector with underlying type int8_t.

Does not use padding; each byte is contiguous.

Defined at line 456 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T, std::enable_if_t<std::is_enum_v<T> && std::is_same_v<typename std::underlying_type_t<T>,int8_t>, bool> = 0>
status_t readEnumVector (std::unique_ptr<std::vector<T>> * val)

Defined at line 459 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T, std::enable_if_t<std::is_enum_v<T> && std::is_same_v<typename std::underlying_type_t<T>,int8_t>, bool> = 0>
status_t readEnumVector (std::optional<std::vector<T>> * val)

Defined at line 463 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T, std::enable_if_t<std::is_enum_v<T> && !std::is_same_v<typename std::underlying_type_t<T>,int8_t>, bool> = 0>
status_t readEnumVector (std::vector<T> * val)

Read an Enum vector with underlying type != int8_t.

Defined at line 467 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T, std::enable_if_t<std::is_enum_v<T> && !std::is_same_v<typename std::underlying_type_t<T>,int8_t>, bool> = 0>
status_t readEnumVector (std::unique_ptr<std::vector<T>> * val)

Defined at line 470 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T, std::enable_if_t<std::is_enum_v<T> && !std::is_same_v<typename std::underlying_type_t<T>,int8_t>, bool> = 0>
status_t readEnumVector (std::optional<std::vector<T>> * val)

Defined at line 474 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t readParcelableVector (std::optional<std::vector<std::optional<T>>> * val)

Defined at line 478 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t readParcelableVector (std::unique_ptr<std::vector<std::unique_ptr<T>>> * val)

Defined at line 482 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t readParcelableVector (std::vector<T> * val)

Defined at line 487 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t readParcelable (std::optional<T> * parcelable)

Defined at line 493 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t readParcelable (std::unique_ptr<T> * parcelable)

Defined at line 496 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T, std::enable_if_t<std::is_base_of_v<::android::IInterface, T>, bool> = true>
status_t readStrongBinderVector (std::vector<sp<T>> * val)

Defined at line 516 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T, std::enable_if_t<std::is_base_of_v<::android::IInterface, T>, bool> = true>
status_t readStrongBinderVector (std::optional<std::vector<sp<T>>> * val)

Defined at line 521 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T, size_t N>
status_t readFixedArray (std::array<T, N> * val)

Defined at line 575 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T, size_t N>
status_t readFixedArray (std::optional<std::array<T, N>> * val)

Defined at line 579 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

void ~Parcel ()
status_t setDataSize (size_t size)
void setDataPosition (size_t pos)

this must only be used to set a data position that was previously returned from

dataPosition(). If writes are made, the exact same types of writes must be made (e.g.

auto i = p.dataPosition(); p.writeInt32(0); p.setDataPosition(i); p.writeInt32(1);).

Writing over objects, such as file descriptors and binders, is not supported.

status_t setDataCapacity (size_t size)
status_t setData (const uint8_t * buffer, size_t len)
void restoreAllowFds (bool lastValue)
status_t writeInterfaceToken (const String16 & interface)

Writes the IPC/RPC header.

status_t writeInterfaceToken (const char16_t * str, size_t len)
void setEnforceNoDataAvail (bool enforceNoDataAvail)

This Api is used by fuzzers to skip dataAvail checks.

void setServiceFuzzing ()

When fuzzing, we want to remove certain ABI checks that cause significant

lost coverage, and we also want to avoid logs that cost too much to write.

void setError (status_t err)
status_t write (const void * data, size_t len)
void * writeInplace (size_t len)
status_t writeInt32 (int32_t val)
status_t writeUint32 (uint32_t val)
status_t writeInt64 (int64_t val)
status_t writeUint64 (uint64_t val)
status_t writeFloat (float val)
status_t writeDouble (double val)
status_t writeCString (const char * str)
status_t writeString8 (const String8 & str)
status_t writeString8 (const char * str, size_t len)
status_t writeString16 (const String16 & str)
status_t writeString16 (const std::optional<String16> & str)
status_t writeString16 (const std::unique_ptr<String16> & str)
status_t writeString16 (const char16_t * str, size_t len)
status_t writeStrongBinder (const sp<IBinder> & val)
status_t writeInt32Array (size_t len, const int32_t * val)
status_t writeByteArray (size_t len, const uint8_t * val)
status_t writeBool (bool val)
status_t writeChar (char16_t val)
status_t writeByte (int8_t val)
status_t writeUtf8AsUtf16 (const std::string & str)

Take a UTF8 encoded string, convert to UTF16, write it to the parcel.

status_t writeUtf8AsUtf16 (const std::optional<std::string> & str)
status_t writeUtf8AsUtf16 (const std::unique_ptr<std::string> & str)
status_t writeByteVector (const std::optional<std::vector<int8_t>> & val)
status_t writeByteVector (const std::unique_ptr<std::vector<int8_t>> & val)
status_t writeByteVector (const std::vector<int8_t> & val)
status_t writeByteVector (const std::optional<std::vector<uint8_t>> & val)
status_t writeByteVector (const std::unique_ptr<std::vector<uint8_t>> & val)
status_t writeByteVector (const std::vector<uint8_t> & val)
status_t writeInt32Vector (const std::optional<std::vector<int32_t>> & val)
status_t writeInt32Vector (const std::unique_ptr<std::vector<int32_t>> & val)
status_t writeInt32Vector (const std::vector<int32_t> & val)
status_t writeInt64Vector (const std::optional<std::vector<int64_t>> & val)
status_t writeInt64Vector (const std::unique_ptr<std::vector<int64_t>> & val)
status_t writeInt64Vector (const std::vector<int64_t> & val)
status_t writeUint64Vector (const std::optional<std::vector<uint64_t>> & val)
status_t writeUint64Vector (const std::unique_ptr<std::vector<uint64_t>> & val)
status_t writeUint64Vector (const std::vector<uint64_t> & val)
status_t writeFloatVector (const std::optional<std::vector<float>> & val)
status_t writeFloatVector (const std::unique_ptr<std::vector<float>> & val)
status_t writeFloatVector (const std::vector<float> & val)
status_t writeDoubleVector (const std::optional<std::vector<double>> & val)
status_t writeDoubleVector (const std::unique_ptr<std::vector<double>> & val)
status_t writeDoubleVector (const std::vector<double> & val)
status_t writeBoolVector (const std::optional<std::vector<bool>> & val)
status_t writeBoolVector (const std::unique_ptr<std::vector<bool>> & val)
status_t writeBoolVector (const std::vector<bool> & val)
status_t writeCharVector (const std::optional<std::vector<char16_t>> & val)
status_t writeCharVector (const std::unique_ptr<std::vector<char16_t>> & val)
status_t writeCharVector (const std::vector<char16_t> & val)
status_t writeString16Vector (const std::optional<std::vector<std::optional<String16>>> & val)
status_t writeString16Vector (const std::unique_ptr<std::vector<std::unique_ptr<String16>>> & val)
status_t writeString16Vector (const std::vector<String16> & val)
status_t writeUtf8VectorAsUtf16Vector (const std::optional<std::vector<std::optional<std::string>>> & val)
status_t writeUtf8VectorAsUtf16Vector (const std::unique_ptr<std::vector<std::unique_ptr<std::string>>> & val)
status_t writeUtf8VectorAsUtf16Vector (const std::vector<std::string> & val)
status_t writeStrongBinderVector (const std::optional<std::vector<sp<IBinder>>> & val)
status_t writeStrongBinderVector (const std::unique_ptr<std::vector<sp<IBinder>>> & val)
status_t writeStrongBinderVector (const std::vector<sp<IBinder>> & val)
status_t writeParcelable (const Parcelable & parcelable)
template <typename T>
status_t write (const Flattenable<T> & val)

---------------------------------------------------------------------------

Defined at line 1502 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t write (const LightFlattenable<T> & val)

Defined at line 1508 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t writeVectorSize (const std::vector<T> & val)

Defined at line 1556 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t writeVectorSize (const std::optional<std::vector<T>> & val)

Defined at line 1564 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t writeVectorSize (const std::unique_ptr<std::vector<T>> & val)

Defined at line 1573 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

status_t writeNativeHandle (const native_handle * handle)

Place a native_handle into the parcel (the native_handle's file-

descriptors are dup'ed, so it is safe to delete the native_handle

when this function returns).

Doesn't take ownership of the native_handle.

status_t writeFileDescriptor (int fd, bool takeOwnership)

Place a file descriptor into the parcel. The given fd must remain

valid for the lifetime of the parcel.

The Parcel does not take ownership of the given fd unless you ask it to.

status_t writeDupFileDescriptor (int fd)

Place a file descriptor into the parcel. A dup of the fd is made, which

will be closed once the parcel is destroyed.

status_t writeParcelFileDescriptor (int fd, bool takeOwnership)

Place a Java "parcel file descriptor" into the parcel. The given fd must remain

valid for the lifetime of the parcel.

The Parcel does not take ownership of the given fd unless you ask it to.

status_t writeDupParcelFileDescriptor (int fd)

Place a Java "parcel file descriptor" into the parcel. A dup of the fd is made, which will

be closed once the parcel is destroyed.

status_t writeUniqueFileDescriptor (const binder::unique_fd & fd)

Place a file descriptor into the parcel. This will not affect the

semantics of the smart file descriptor. A new descriptor will be

created, and will be closed when the parcel is destroyed.

status_t writeUniqueFileDescriptorVector (const std::optional<std::vector<binder::unique_fd>> & val)

Place a vector of file desciptors into the parcel. Each descriptor is

dup'd as in writeDupFileDescriptor

status_t writeUniqueFileDescriptorVector (const std::vector<binder::unique_fd> & val)
status_t writeBlob (size_t len, bool mutableCopy, WritableBlob * outBlob)

WARNING: deprecated and incompatible with AIDL. You should use Parcelable

definitions outside of Parcel to represent shared memory, such as

IMemory or with ParcelFileDescriptor. We should remove this, or move it to be

external to Parcel, it's not a very encapsulated API.

Writes a blob to the parcel.

If the blob is small, then it is stored in-place, otherwise it is

transferred by way of an anonymous shared memory region. Prefer sending

immutable blobs if possible since they may be subsequently transferred between

processes without further copying whereas mutable blobs always need to be copied.

The caller should call release() on the blob after writing its contents.

status_t writeDupImmutableBlobFileDescriptor (int fd)

Write an existing immutable blob file descriptor to the parcel.

This allows the client to send the same blob to multiple processes

as long as it keeps a dup of the blob file descriptor handy for later.

status_t writeNoException ()

Like Parcel.java's writeNoException(). Just writes a zero int32.

Currently the native implementation doesn't do any of the StrictMode

stack gathering and serialization that the Java implementation does.

status_t read (void * outData, size_t len)
const void * readInplace (size_t len)
int32_t readInt32 ()
status_t readInt32 (int32_t * pArg)
uint32_t readUint32 ()
status_t readUint32 (uint32_t * pArg)
int64_t readInt64 ()
status_t readInt64 (int64_t * pArg)
uint64_t readUint64 ()
status_t readUint64 (uint64_t * pArg)
float readFloat ()
status_t readFloat (float * pArg)
double readDouble ()
status_t readDouble (double * pArg)
bool readBool ()
status_t readBool (bool * pArg)
char16_t readChar ()
status_t readChar (char16_t * pArg)
int8_t readByte ()
status_t readByte (int8_t * pArg)
status_t readUtf8FromUtf16 (std::string * str)

Read a UTF16 encoded string, convert to UTF8

status_t readUtf8FromUtf16 (std::optional<std::string> * str)
status_t readUtf8FromUtf16 (std::unique_ptr<std::string> * str)
const char * readCString ()
String8 readString8 ()
status_t readString8 (String8 * pArg)
const char * readString8Inplace (size_t * outLen)
String16 readString16 ()
status_t readString16 (String16 * pArg)
status_t readString16 (std::optional<String16> * pArg)
status_t readString16 (std::unique_ptr<String16> * pArg)
const char16_t * readString16Inplace (size_t * outLen)
sp<IBinder> readStrongBinder ()
status_t readStrongBinder (sp<IBinder> * val)
status_t readNullableStrongBinder (sp<IBinder> * val)
status_t readParcelable (Parcelable * parcelable)
template <typename T>
status_t readStrongBinder (sp<T> * val)

If strong binder would be nullptr, readStrongBinder() returns an error.

TODO: T must be derived from IInterface, fix for clarity.

Defined at line 1629 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t readNullableStrongBinder (sp<T> * val)

Defined at line 1645 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

status_t readStrongBinderVector (std::optional<std::vector<sp<IBinder>>> * val)
status_t readStrongBinderVector (std::unique_ptr<std::vector<sp<IBinder>>> * val)
status_t readStrongBinderVector (std::vector<sp<IBinder>> * val)
status_t readByteVector (std::optional<std::vector<int8_t>> * val)
status_t readByteVector (std::unique_ptr<std::vector<int8_t>> * val)
status_t readByteVector (std::vector<int8_t> * val)
status_t readByteVector (std::optional<std::vector<uint8_t>> * val)
status_t readByteVector (std::unique_ptr<std::vector<uint8_t>> * val)
status_t readByteVector (std::vector<uint8_t> * val)
status_t readInt32Vector (std::optional<std::vector<int32_t>> * val)
status_t readInt32Vector (std::unique_ptr<std::vector<int32_t>> * val)
status_t readInt32Vector (std::vector<int32_t> * val)
status_t readInt64Vector (std::optional<std::vector<int64_t>> * val)
status_t readInt64Vector (std::unique_ptr<std::vector<int64_t>> * val)
status_t readInt64Vector (std::vector<int64_t> * val)
status_t readUint64Vector (std::optional<std::vector<uint64_t>> * val)
status_t readUint64Vector (std::unique_ptr<std::vector<uint64_t>> * val)
status_t readUint64Vector (std::vector<uint64_t> * val)
status_t readFloatVector (std::optional<std::vector<float>> * val)
status_t readFloatVector (std::unique_ptr<std::vector<float>> * val)
status_t readFloatVector (std::vector<float> * val)
status_t readDoubleVector (std::optional<std::vector<double>> * val)
status_t readDoubleVector (std::unique_ptr<std::vector<double>> * val)
status_t readDoubleVector (std::vector<double> * val)
status_t readBoolVector (std::optional<std::vector<bool>> * val)
status_t readBoolVector (std::unique_ptr<std::vector<bool>> * val)
status_t readBoolVector (std::vector<bool> * val)
status_t readCharVector (std::optional<std::vector<char16_t>> * val)
status_t readCharVector (std::unique_ptr<std::vector<char16_t>> * val)
status_t readCharVector (std::vector<char16_t> * val)
status_t readString16Vector (std::optional<std::vector<std::optional<String16>>> * val)
status_t readString16Vector (std::unique_ptr<std::vector<std::unique_ptr<String16>>> * val)
status_t readString16Vector (std::vector<String16> * val)
status_t readUtf8VectorFromUtf16Vector (std::optional<std::vector<std::optional<std::string>>> * val)
status_t readUtf8VectorFromUtf16Vector (std::unique_ptr<std::vector<std::unique_ptr<std::string>>> * val)
status_t readUtf8VectorFromUtf16Vector (std::vector<std::string> * val)
template <typename T>
status_t read (Flattenable<T> & val)

Defined at line 1529 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t read (LightFlattenable<T> & val)

Defined at line 1535 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t resizeOutVector (std::vector<T> * val)

resizeOutVector is used to resize AIDL out vector parameters.

Defined at line 1582 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t resizeOutVector (std::optional<std::vector<T>> * val)

Defined at line 1597 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

template <typename T>
status_t resizeOutVector (std::unique_ptr<std::vector<T>> * val)

Defined at line 1613 of file ../../third_party/android/platform/frameworks/native/libs/binder/include/binder/Parcel.h

int32_t readExceptionCode ()

Like Parcel.java's readExceptionCode(). Reads the first int32

off of a Parcel's header, returning 0 or the negative error

code on exceptions, but also deals with skipping over rich

response headers. Callers should use this to read

&

parse the

response headers rather than doing it by hand.

native_handle * readNativeHandle ()

Retrieve native_handle from the parcel. This returns a copy of the

parcel's native_handle (the caller takes ownership). The caller

must free the native_handle with native_handle_close() and

native_handle_delete().

int readFileDescriptor ()

Retrieve a file descriptor from the parcel. This returns the raw fd

in the parcel, which you do not own -- use dup() to get your own copy.

int readParcelFileDescriptor ()

Retrieve a Java "parcel file descriptor" from the parcel. This returns the raw fd

in the parcel, which you do not own -- use dup() to get your own copy.

status_t readUniqueFileDescriptor (binder::unique_fd * val)

Retrieve a smart file descriptor from the parcel.

status_t readUniqueParcelFileDescriptor (binder::unique_fd * val)

Retrieve a Java "parcel file descriptor" from the parcel.

status_t readUniqueFileDescriptorVector (std::optional<std::vector<binder::unique_fd>> * val)

Retrieve a vector of smart file descriptors from the parcel.

status_t readUniqueFileDescriptorVector (std::vector<binder::unique_fd> * val)
status_t readBlob (size_t len, ReadableBlob * outBlob)

WARNING: deprecated and incompatible with AIDL. You should use Parcelable

definitions outside of Parcel to represent shared memory, such as

IMemory or with ParcelFileDescriptor. We should remove this, or move it to be

external to Parcel, it's not a very encapsulated API.

Reads a blob from the parcel.

The caller should call release() on the blob after reading its contents.

const flat_binder_object * readObject (bool nullMetaData)
size_t getGlobalAllocSize ()

Debugging: get metrics on current allocations.

size_t getGlobalAllocCount ()
bool replaceCallingWorkSourceUid (uid_t uid)
uid_t readCallingWorkSourceUid ()

Returns the work source provided by the caller. This can only be trusted for trusted calling

uid.

void print (std::ostream & to, uint32_t flags)
size_t getOpenAshmemSize ()

Returns the total amount of ashmem memory owned by this object.

Note: for historical reasons, this does not include ashmem memory which

is referenced by this Parcel, but which this parcel doesn't own (e.g.

writeFileDescriptor is called without 'takeOwnership' true).

WARNING: you should not use this, but rather, unparcel, and inspect

each FD independently. This counts ashmem size, but there may be

other resources used for non-ashmem FDs, such as other types of

shared memory, files, etc..

Records

Friends

class RecordedTransaction
class RpcState
class IPCThreadState