本文整理汇总了C++中Parcel::writeFileDescriptor方法的典型用法代码示例。如果您正苦于以下问题:C++ Parcel::writeFileDescriptor方法的具体用法?C++ Parcel::writeFileDescriptor怎么用?C++ Parcel::writeFileDescriptor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parcel
的用法示例。
在下文中一共展示了Parcel::writeFileDescriptor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: shellCommand
status_t IBinder::shellCommand(const sp<IBinder>& target, int in, int out, int err,
Vector<String16>& args, const sp<IResultReceiver>& resultReceiver)
{
Parcel send;
Parcel reply;
send.writeFileDescriptor(in);
send.writeFileDescriptor(out);
send.writeFileDescriptor(err);
const size_t numArgs = args.size();
send.writeInt32(numArgs);
for (size_t i = 0; i < numArgs; i++) {
send.writeString16(args[i]);
}
send.writeStrongBinder(resultReceiver != NULL ? IInterface::asBinder(resultReceiver) : NULL);
return target->transact(SHELL_COMMAND_TRANSACTION, send, &reply);
}
示例2: dump
status_t BpBinder::dump(int fd, const Vector<String16>& args)
{
Parcel send;
Parcel reply;
send.writeFileDescriptor(fd);
const size_t numArgs = args.size();
send.writeInt32(numArgs);
for (size_t i = 0; i < numArgs; i++) {
send.writeString16(args[i]);
}
status_t err = transact(DUMP_TRANSACTION, send, &reply);
return err;
}
示例3: WriteMemoryToParcel
void WriteMemoryToParcel(Parcel &parcel, allocator_memory_t *memory)
{
int32_t p, n;
parcel.writeInt32(memory->memtype);
parcel.writeInt32(memory->nptrs);
parcel.writeInt32(memory->ndims);
for (p = 0; p < memory->nptrs; p++) {
for(n = 0; n < memory->ndims; n++) {
parcel.writeInt32(memory->dims[p].dims[n]);
}
}
for (p = 0; p < memory->nptrs; p++) {
for(n = 0; n < memory->ndims; n++) {
parcel.writeInt32(memory->strides[p].dims[n]);
}
}
for (p = 0; p < memory->nptrs; p++) {
if (memory->memtype == ALLOCATOR_MEMORY_TYPE_TILED_1D_CACHED ||
memory->memtype == ALLOCATOR_MEMORY_TYPE_TILED_1D_UNCACHED)
parcel.writeFileDescriptor(memory->fds[p]);
else if (memory->memtype == ALLOCATOR_MEMORY_TYPE_VIRTUAL_SHARED)
parcel.writeInt32(memory->fds[p]);
}
}