summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-05-21 16:32:55 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-05-21 16:32:55 -0700
commitbca8ecf8054f81f1908b7b876803c08bbb3e8ec2 (patch)
treec4e4fcaaab3b17e49a2f2dfeb3b794be8ae4c124 /include
parent547a397f9bd86e5383ec68d96fb15bfa9bfcec77 (diff)
parentdfece80c790934e4413def863070ac0dd21f6e29 (diff)
downloadframeworks_base-bca8ecf8054f81f1908b7b876803c08bbb3e8ec2.zip
frameworks_base-bca8ecf8054f81f1908b7b876803c08bbb3e8ec2.tar.gz
frameworks_base-bca8ecf8054f81f1908b7b876803c08bbb3e8ec2.tar.bz2
Merge change 2260
* changes: change 2115 wasn't merged properly into master. this fixes that.
Diffstat (limited to 'include')
-rw-r--r--include/binder/Parcel.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/include/binder/Parcel.h b/include/binder/Parcel.h
index 9087c44..af1490a 100644
--- a/include/binder/Parcel.h
+++ b/include/binder/Parcel.h
@@ -80,8 +80,11 @@ public:
status_t writeStrongBinder(const sp<IBinder>& val);
status_t writeWeakBinder(const wp<IBinder>& val);
- // doesn't take ownership of the native_handle
- 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 writeNativeHandle(const native_handle* handle);
// Place a file descriptor into the parcel. The given fd must remain
// valid for the lifetime of the parcel.
@@ -114,12 +117,11 @@ public:
wp<IBinder> readWeakBinder() const;
- // if alloc is NULL, native_handle is allocated with malloc(), otherwise
- // alloc is used. If the function fails, the effects of alloc() must be
- // reverted by the caller.
- native_handle* readNativeHandle(
- native_handle* (*alloc)(void* cookie, int numFds, int ints),
- void* cookie) const;
+ // 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().
+ native_handle* readNativeHandle() const;
// Retrieve a file descriptor from the parcel. This returns the raw fd