Lines Matching refs:handle
28 bool isAidlNativeHandleEmpty(const NativeHandle& handle) { in isAidlNativeHandleEmpty() argument
29 return handle.fds.empty() && handle.ints.empty(); in isAidlNativeHandleEmpty()
32 static native_handle_t* fromAidl(const NativeHandle& handle, bool doDup) { in fromAidl() argument
33 native_handle_t* to = native_handle_create(handle.fds.size(), handle.ints.size()); in fromAidl()
36 for (size_t i = 0; i < handle.fds.size(); i++) { in fromAidl()
37 int fd = handle.fds[i].get(); in fromAidl()
40 memcpy(to->data + handle.fds.size(), handle.ints.data(), handle.ints.size() * sizeof(int)); in fromAidl()
44 native_handle_t* makeFromAidl(const NativeHandle& handle) { in makeFromAidl() argument
45 return fromAidl(handle, false /* doDup */); in makeFromAidl()
47 native_handle_t* dupFromAidl(const NativeHandle& handle) { in dupFromAidl() argument
48 return fromAidl(handle, true /* doDup */); in dupFromAidl()
51 static NativeHandle toAidl(const native_handle_t* handle, bool doDup) { in toAidl() argument
54 to.fds = std::vector<ndk::ScopedFileDescriptor>(handle->numFds); in toAidl()
55 for (size_t i = 0; i < handle->numFds; i++) { in toAidl()
56 int fd = handle->data[i]; in toAidl()
60 to.ints = std::vector<int32_t>(handle->data + handle->numFds, in toAidl()
61 handle->data + handle->numFds + handle->numInts); in toAidl()
65 NativeHandle makeToAidl(const native_handle_t* handle) { in makeToAidl() argument
66 return toAidl(handle, false /* doDup */); in makeToAidl()
69 NativeHandle dupToAidl(const native_handle_t* handle) { in dupToAidl() argument
70 return toAidl(handle, true /* doDup */); in dupToAidl()