summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-05-22 14:53:18 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-05-22 14:53:18 -0700
commit9f7d60cbfaa40bd78c0f4d5d4e3b8e8cf257e87a (patch)
treed00f0230d2e178a2f1aca915766f0901cc2262f8 /libs
parentccf1ab64846112846c0bcd7fc4a623f55588ee46 (diff)
parentd50a458bb291801ab9fdc119301bc7b84b42a6e3 (diff)
downloadframeworks_base-9f7d60cbfaa40bd78c0f4d5d4e3b8e8cf257e87a.zip
frameworks_base-9f7d60cbfaa40bd78c0f4d5d4e3b8e8cf257e87a.tar.gz
frameworks_base-9f7d60cbfaa40bd78c0f4d5d4e3b8e8cf257e87a.tar.bz2
am d50a458b: Merge change 2351 into donut
Merge commit 'd50a458bb291801ab9fdc119301bc7b84b42a6e3' * commit 'd50a458bb291801ab9fdc119301bc7b84b42a6e3': Fix a major bug in Bundle when unparcelling from AIDL.
Diffstat (limited to 'libs')
-rw-r--r--libs/binder/Parcel.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index 0819c29..3747de6 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -409,12 +409,16 @@ status_t Parcel::appendFrom(Parcel *parcel, size_t offset, size_t len)
mObjects[idx++] = off;
mObjectsSize++;
- const flat_binder_object* flat
+ flat_binder_object* flat
= reinterpret_cast<flat_binder_object*>(mData + off);
acquire_object(proc, *flat, this);
- // take note if the object is a file descriptor
if (flat->type == BINDER_TYPE_FD) {
+ // If this is a file descriptor, we need to dup it so the
+ // new Parcel now owns its own fd, and can declare that we
+ // officially know we have fds.
+ flat->handle = dup(flat->handle);
+ flat->cookie = (void*)1;
mHasFds = mFdsKnown = true;
}
}