summaryrefslogtreecommitdiffstats
path: root/libs/binder/Parcel.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF)Steve Block2012-01-191-6/+6
| | | | Change-Id: I1de629b4632a4b3187ca1a28d6416daccd35f924
* Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF)Steve Block2012-01-191-2/+2
| | | | Change-Id: I8fbdfa7a7581f481968dbb65aa40f7042936d7cb
* Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF)Steve Block2012-01-191-6/+6
| | | | Change-Id: I26f76452ac49e2890b14d133c065493d8df0fb4a
* Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF)Steve Block2012-01-191-2/+2
| | | | Change-Id: I44f267700356967dc51e8f85ebf457dc85cfb229
* Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF)Steve Block2012-01-191-26/+26
| | | | Change-Id: I5321ebd12e9c6248a108529e82c4e1af2a4405e3
* Rename (IF_)LOG() to (IF_)ALOG()Steve Block2012-01-181-1/+1
| | | | Change-Id: If49c81a2793182771c6160fbca93905daa6f44c1
* Fix a leak in Parcel::writeBlob.Jeff Brown2011-11-041-9/+4
| | | | | | | | | | Was mistakenly assuming that Parcel::writeFileDescriptor took ownership of the fd that was passed in. It does not! Added some comments and a default parameter to allow the caller to specify whether it wishes the Parcel to take ownership. Bug: 5563374 Change-Id: I5a12f51d582bf246ce90133cce7690bb9bca93f6
* Use ashmem for CursorWindows.Jeff Brown2011-10-111-2/+2
| | | | | | | | | | | | | | | | | | | | | Bug: 5332296 The memory dealer introduces additional delays for reclaiming the memory owned by CursorWindows because the Binder object must be finalized. Using ashmem instead gives CursorWindow more direct control over the lifetime of the shared memory region. The provider now allocates the CursorWindows and returns them to clients with a read-only protection bit set on the ashmem region. Improved the encapsulation of CursorWindow. Callers shouldn't need to care about details like how string fields are allocated. Removed the compile-time configuration of string and numeric storage modes to remove some dead weight. Change-Id: I07c2bc2a9c573d7e435dcaecd269d25ea9807acd
* Fix handling of "allow fds" state.Dianne Hackborn2011-10-031-2/+9
| | | | | | Didn't take into account nesting of bundles. Boo. Change-Id: Ic8cf21ad8d6f4938a3e105128624c9d162310d01
* Transfer large bitmaps using ashmem.Jeff Brown2011-10-031-0/+108
| | | | | | Bug: 5224703 Change-Id: If385a66adf4c6179a0bb49c0e6d09a9567e23808
* Add mechanism for Parcel to not allow FDs to be written to it.Dianne Hackborn2011-10-031-1/+18
| | | | | | This is to help implement issue #5224703. Change-Id: I026a5890495537d15b57fe61227a640aac806d46
* Revert "Transfer large bitmaps using ashmem. Bug: 5224703"Bart Sears2011-09-251-97/+0
| | | | | This reverts commit 56c58f66b97d22fe7e7de1f7d9548bcbe1973029 This CL was causing the browser to crash when adding bookmarks, visiting the bookmarks page, and sharing pages (see bug http://b/issue?id=5369231
* Transfer large bitmaps using ashmem.Jeff Brown2011-09-231-0/+97
| | | | | | Bug: 5224703 Change-Id: Ic7481dd9f173986f085a8bbdcc59bbe9830d7a44
* Merge "Parcel::appendFrom({const } Parcel *parcel, size_t, size_t)"Andreas Huber2011-04-181-3/+3
|\
| * Parcel::appendFrom({const } Parcel *parcel, size_t, size_t)Andreas Huber2011-04-131-3/+3
| | | | | | | | | | | | As far as I can tell "parcel" isn't actually modified by the implementation. Change-Id: Ib806eefdc13c97b932773e1dc9ca3a4aad4422b2
* | Rewrite battery history storage.Dianne Hackborn2011-04-141-7/+11
|/ | | | | | | | | | We now write battery history directly into a buffer, instead of creating objects. This allows for more efficient storage; later it can be even better because we can only write deltas. The old code is still there temporarily for validation. Change-Id: I9707d4d8ff30855be8ebdc93bc078911040d8e0b
* Fix for writing empty strings to Parcel::writeString8()Pravat Dalbehera2010-12-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | If writeString8 is called with the following sequence: writeString8(String8("")); writeString8(String8("TempString")); Then in the readString8, the 2nd String i.e. "TempString" is not read, instead an empty string is read. The bug comes because of the write call for String8("") where there are no String bytes present. In the write Statement, an extra ‘\0’ is written. During the Marshalling, Following bytes are written: 1 2 3 4 5 ... 0x0 0x0 0xB ‘T’ ‘e’ ... The readString8 function has a check that, if String length is 0, don’t read anything. So the first byte is read as the length for the first string. The second byte i.e. ‘\0’ is read as the length for the second string and hence the second string becomes empty too. Change-Id: Id7acc0c80ae16e77be4331f1ddf69ea87e758420
* 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