Android 6.0.1 release 24
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEABECAAYFAlcDBbwACgkQ6K0/gZqxDnhMYQCfVROi/aOR0642Ja6QWTz0O9xP Ra4An1OMMl1qJIc66uRZ0V03qP0WIklv =AQQB -----END PGP SIGNATURE----- Merge tag 'android-6.0.1_r24' into HEAD Ticket: CYNGNOS-2213 Android 6.0.1 release 24
This commit is contained in:
commit
31d9cccf23
@ -26,6 +26,7 @@
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include <binder/IMemory.h>
|
||||
#include <cutils/log.h>
|
||||
#include <utils/KeyedVector.h>
|
||||
#include <utils/threads.h>
|
||||
#include <utils/Atomic.h>
|
||||
@ -191,15 +192,26 @@ sp<IMemoryHeap> BpMemory::getMemory(ssize_t* offset, size_t* size) const
|
||||
if (heap != 0) {
|
||||
mHeap = interface_cast<IMemoryHeap>(heap);
|
||||
if (mHeap != 0) {
|
||||
mOffset = o;
|
||||
mSize = s;
|
||||
size_t heapSize = mHeap->getSize();
|
||||
if (s <= heapSize
|
||||
&& o >= 0
|
||||
&& (static_cast<size_t>(o) <= heapSize - s)) {
|
||||
mOffset = o;
|
||||
mSize = s;
|
||||
} else {
|
||||
// Hm.
|
||||
android_errorWriteWithInfoLog(0x534e4554,
|
||||
"26877992", -1, NULL, 0);
|
||||
mOffset = 0;
|
||||
mSize = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (offset) *offset = mOffset;
|
||||
if (size) *size = mSize;
|
||||
return mHeap;
|
||||
return (mSize > 0) ? mHeap : 0;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@ -26,6 +26,10 @@
|
||||
#include <gui/IConsumerListener.h>
|
||||
#include <gui/IProducerListener.h>
|
||||
|
||||
#include <binder/IPCThreadState.h>
|
||||
#include <binder/PermissionCache.h>
|
||||
#include <private/android_filesystem_config.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
BufferQueueConsumer::BufferQueueConsumer(const sp<BufferQueueCore>& core) :
|
||||
@ -572,7 +576,18 @@ sp<NativeHandle> BufferQueueConsumer::getSidebandStream() const {
|
||||
}
|
||||
|
||||
void BufferQueueConsumer::dump(String8& result, const char* prefix) const {
|
||||
mCore->dump(result, prefix);
|
||||
const IPCThreadState* ipc = IPCThreadState::self();
|
||||
const pid_t pid = ipc->getCallingPid();
|
||||
const uid_t uid = ipc->getCallingUid();
|
||||
if ((uid != AID_SHELL)
|
||||
&& !PermissionCache::checkPermission(String16(
|
||||
"android.permission.DUMP"), pid, uid)) {
|
||||
result.appendFormat("Permission Denial: can't dump BufferQueueConsumer "
|
||||
"from pid=%d, uid=%d\n", pid, uid);
|
||||
android_errorWriteWithInfoLog(0x534e4554, "27046057", uid, NULL, 0);
|
||||
} else {
|
||||
mCore->dump(result, prefix);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace android
|
||||
|
Loading…
Reference in New Issue
Block a user