diff options
author | Elliott Hughes <enh@google.com> | 2013-03-13 23:11:00 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-03-13 23:11:00 -0700 |
commit | 5ca39ea57a4bfa04e90dd2aafc31c8f20bd8bf1c (patch) | |
tree | 2cb5a4f70491e31b7aa1fb8855578a0514c4abde /libs | |
parent | 6a531717cddf1d30be0946884d21c27e5b6b390c (diff) | |
parent | 9b57ad737bceba9f8d4f5be303c70fa72be00eaf (diff) | |
download | frameworks_native-5ca39ea57a4bfa04e90dd2aafc31c8f20bd8bf1c.zip frameworks_native-5ca39ea57a4bfa04e90dd2aafc31c8f20bd8bf1c.tar.gz frameworks_native-5ca39ea57a4bfa04e90dd2aafc31c8f20bd8bf1c.tar.bz2 |
am 9b57ad73: am 8facd1b2: Merge "Add a compatibility symbol for the MemoryBase constructor."
* commit '9b57ad737bceba9f8d4f5be303c70fa72be00eaf':
Add a compatibility symbol for the MemoryBase constructor.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/binder/IMemory.cpp | 6 | ||||
-rw-r--r-- | libs/binder/MemoryBase.cpp | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/libs/binder/IMemory.cpp b/libs/binder/IMemory.cpp index cd2451a..947ac19 100644 --- a/libs/binder/IMemory.cpp +++ b/libs/binder/IMemory.cpp @@ -298,11 +298,11 @@ void BpMemoryHeap::assertReallyMapped() const uint32_t flags = reply.readInt32(); uint32_t offset = reply.readInt32(); - ALOGE_IF(err, "binder=%p transaction failed fd=%d, size=%ld, err=%d (%s)", + ALOGE_IF(err, "binder=%p transaction failed fd=%d, size=%d, err=%d (%s)", asBinder().get(), parcel_fd, size, err, strerror(-err)); int fd = dup( parcel_fd ); - ALOGE_IF(fd==-1, "cannot dup fd=%d, size=%ld, err=%d (%s)", + ALOGE_IF(fd==-1, "cannot dup fd=%d, size=%d, err=%d (%s)", parcel_fd, size, err, strerror(errno)); int access = PROT_READ; @@ -315,7 +315,7 @@ void BpMemoryHeap::assertReallyMapped() const mRealHeap = true; mBase = mmap(0, size, access, MAP_SHARED, fd, offset); if (mBase == MAP_FAILED) { - ALOGE("cannot map BpMemoryHeap (binder=%p), size=%ld, fd=%d (%s)", + ALOGE("cannot map BpMemoryHeap (binder=%p), size=%d, fd=%d (%s)", asBinder().get(), size, fd, strerror(errno)); close(fd); } else { diff --git a/libs/binder/MemoryBase.cpp b/libs/binder/MemoryBase.cpp index 033066b..835124f 100644 --- a/libs/binder/MemoryBase.cpp +++ b/libs/binder/MemoryBase.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#define LOG_TAG "MemoryBase" #include <stdlib.h> #include <stdint.h> @@ -31,6 +32,14 @@ MemoryBase::MemoryBase(const sp<IMemoryHeap>& heap, { } +MemoryBase::MemoryBase(const sp<IMemoryHeap>& heap, + long offset, unsigned int size) + : mSize(size), mOffset(offset), mHeap(heap) +{ + ALOGW("Using temporary compatibility workaround for usage of MemoryBase " + "private API. Please fix your application!"); +} + sp<IMemoryHeap> MemoryBase::getMemory(ssize_t* offset, size_t* size) const { if (offset) *offset = mOffset; |