From 397ff875b29ac6305d16e7225a646454ff0b5a07 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 13 Mar 2013 15:22:11 -0700 Subject: [PATCH 1/2] size IMemoryHeap properly for screenshots since we're using glReadPixels(), we only need to use the width (as opposed to the stride) of the source screenshot. Bug: 8374664 Change-Id: I145c80f4fff5444df7c77c4f52e70a7203caddbd --- services/surfaceflinger/SurfaceFlinger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 184f47e91..884d7edbe 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -2783,7 +2783,7 @@ status_t SurfaceFlinger::captureScreenImplLocked( sp buf(consumer->getCurrentBuffer()); sw = buf->getWidth(); sh = buf->getHeight(); - size_t size = buf->getStride() * sh * 4; + size_t size = sw * sh * 4; // allocate shared memory large enough to hold the // screen capture From 284414bf4f1a6a649b2177286d473e4d3626631f Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 14 Mar 2013 10:31:38 -0700 Subject: [PATCH 2/2] am 7212ff29: am 20e154f1: Merge "Second try at adding a compatibility symbol for the MemoryBase constructor." * commit '7212ff29c6f4e4cd192fee6f072e80b36d8a728b': Second try at adding a compatibility symbol for the MemoryBase constructor. --- libs/binder/MemoryBase.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/binder/MemoryBase.cpp b/libs/binder/MemoryBase.cpp index 033066bea..5c823302f 100644 --- a/libs/binder/MemoryBase.cpp +++ b/libs/binder/MemoryBase.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#define LOG_TAG "MemoryBase" #include #include @@ -44,3 +45,11 @@ MemoryBase::~MemoryBase() // --------------------------------------------------------------------------- }; // namespace android + +// Backwards compatibility for libdatabase_sqlcipher (http://b/8253769). +extern "C" void _ZN7android10MemoryBaseC1ERKNS_2spINS_11IMemoryHeapEEEij(void*, void*, ssize_t, size_t); +extern "C" void _ZN7android10MemoryBaseC1ERKNS_2spINS_11IMemoryHeapEEElj(void* obj, void* h, long o, unsigned int size) { + _ZN7android10MemoryBaseC1ERKNS_2spINS_11IMemoryHeapEEEij(obj, h, o, size); + ALOGW("Using temporary compatibility workaround for usage of MemoryBase " + "private API. Please fix your application!"); +}