summaryrefslogtreecommitdiffstats
path: root/libs/binder/Parcel.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Don't propagate StrictMode over one-way Binder calls.Brad Fitzpatrick2010-08-311-1/+10
| | | | | | | | | | | | | | | | | This was causing stack stitching problems where a one-way call with violations followed by a two-way call without violations was getting the previous one-way call's violation stack stitched on to the second caller's stack. The solution is a little more indirect than I would've liked (preserving the binder's onTransact flags until enforceInterface) but was seemingly necessary to work without changing the AIDL compiler. It should also be sufficiently cheap, since no new calls to thread-local IPCThreadState lookups were required. The additional work is just same-thread getter/setters on the existing IPCThreadState. Change-Id: I4b6db1d445c56e868e6d0d7be3ba6849f4ef23ae
* Replace several IPCThreadState::get() lookups with one.Brad Fitzpatrick2010-07-271-5/+5
| | | | | | Also, make StrictMode's ThreadLocal final. Change-Id: I08d400ed254fa67bb7a3dae1227f205a54c00df0
* StrictMode: gather and return violating stacks in Binder repliesBrad Fitzpatrick2010-07-151-1/+12
| | | | | | | | | | | Now, when Thread A has a strict mode policy in effect and does a Binder call to Thread B (most likely in another process), the strict mode policy is passed along, but with the GATHER penalty bit set which overrides other policies and instead gathers all offending stack traces to a threadlocal which are then written back in the Parcel's reply header. Change-Id: I7d4497032a0609b37b1a2a15855f5c929ba0584d
* More StrictMode work, keeping Binder & BlockGuard's thread-locals in-sync.Brad Fitzpatrick2010-07-151-2/+11
| | | | Change-Id: Ia67cabcc17a73a0f15907ffea683d06bc41b90e5
* Add Parcel::readExceptionCode() and Parcel::writeNoException()Brad Fitzpatrick2010-07-131-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add native Parcel methods analogous to the Java versions. Currently, these don't do much, but upcoming StrictMode work changes the RPC calling conventions in some cases, so it's important that everybody uses these consistently, rather than having a lot of code trying to parse RPC responses out of Parcels themselves. As a summary, the current convention that Java Binder services use is to prepend the reply Parcel with an int32 signaling the exception status: 0: no exception -1: Security exception -2: Bad Parcelable -3: ... -4: ... -5: ... ... followed by Parceled String if the exception code is non-zero. With an upcoming change, it'll be the case that a response Parcel can, non-exceptionally return rich data in the header, and also return data to the caller. The important thing to note in this new case is that the first int32 in the reply parcel *will not be zero*, so anybody manually checking for it with reply.readInt32() will get false negative failures. Short summary: If you're calling into a Java service and manually checking the exception status with reply.readInt32(), change it to reply.readExceptionCode(). Change-Id: I23f9a0e53a8cfbbd9759242cfde16723641afe04
* Start of work on passing around StrictMode policy over Binder calls.Brad Fitzpatrick2010-06-211-2/+6
| | | | | | | | | | | | This is (intendend to be) a no-op change. At this stage, Binder RPCs just have an additional uint32 passed around in the header, right before the interface name. But nothing is actually done with them yet. That value should right now always be 0. This now boots and seems to work. Change-Id: I135b7c84f07575e6b9717fef2424d301a450df7b
* remove a dependency of GraphicBuffer (libui) on Parcel (libbinder).Mathias Agopian2010-02-211-1/+69
| | | | | | | | | Add a Flattenable interface to libutils which can be used to flatten an object into bytestream + filedescriptor stream. Parcel is modified to handle Flattenable. And GraphicBuffer implements Flattenable. Except for the overlay classes libui is now independent of libbinder.
* Support for marshalling pointers / intptr_t in Parcel.Andreas Huber2009-08-171-95/+63
| | | | Some refactoring to eliminate code duplication in Parcel implementation.
* don't crash in Parcel when given a null (and therfore invalid) native_handle_tMathias Agopian2009-07-311-1/+1
|
* some work to try to reduce the code size of some native librariesMathias Agopian2009-05-261-1/+6
| | | | | | | | | | | | | | | | | - make sure that all binder Bn classes define a ctor and dtor in their respective library. This avoids duplication of the ctor/dtor in libraries where these objects are instantiated. This is also cleaner, should we want these ctor/dtor to do something one day. - same change as above for some Bp classes and various other non-binder classes - moved the definition of CHECK_INTERFACE() in IInterface.h instead of having it everywhere. - improved the CHECK_INTERFACE() macro so it calls a single method in Parcel, instead of inlining its code everywhere - IBinder::getInterfaceDescriptor() now returns a "const String16&" instead of String16, which saves calls to String16 and ~String16 - implemented a cache for BpBinder::getInterfaceDescriptor(), since this does an IPC. HOWEVER, this method never seems to be called. The cache makes BpBinder bigger, so we need to figure out if we need this method at all.
* am d50a458b: Merge change 2351 into donutAndroid (Google) Code Review2009-05-221-2/+6
| | | | | | | Merge commit 'd50a458bb291801ab9fdc119301bc7b84b42a6e3' * commit 'd50a458bb291801ab9fdc119301bc7b84b42a6e3': Fix a major bug in Bundle when unparcelling from AIDL.
* change 2115 wasn't merged properly into master. this fixes that.Mathias Agopian2009-05-211-28/+11
| | | | | | | | | | | Merge change 2115 into donut * changes: bring the native_handle stuff back from master_gl Conflicts: libs/binder/Parcel.cpp
* move libbinder's header files under includes/binderMathias Agopian2009-05-201-4/+4
|
* checkpoint: split libutils into libutils + libbinderMathias Agopian2009-05-201-0/+1376