diff options
Diffstat (limited to 'libs/binder')
-rw-r--r-- | libs/binder/IPCThreadState.cpp | 8 | ||||
-rw-r--r-- | libs/binder/MemoryBase.cpp | 9 | ||||
-rw-r--r-- | libs/binder/Parcel.cpp | 49 |
3 files changed, 56 insertions, 10 deletions
diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp index 7e416b9..6e83faa 100644 --- a/libs/binder/IPCThreadState.cpp +++ b/libs/binder/IPCThreadState.cpp @@ -371,11 +371,6 @@ int IPCThreadState::getCallingUid() return mCallingUid; } -int IPCThreadState::getOrigCallingUid() -{ - return mOrigCallingUid; -} - int64_t IPCThreadState::clearCallingIdentity() { int64_t token = ((int64_t)mCallingUid<<32) | mCallingPid; @@ -646,7 +641,6 @@ IPCThreadState::IPCThreadState() { pthread_setspecific(gTLS, this); clearCaller(); - mOrigCallingUid = mCallingUid; mIn.setDataCapacity(256); mOut.setDataCapacity(256); } @@ -998,7 +992,6 @@ status_t IPCThreadState::executeCommand(int32_t cmd) mCallingPid = tr.sender_pid; mCallingUid = tr.sender_euid; - mOrigCallingUid = tr.sender_euid; int curPrio = getpriority(PRIO_PROCESS, mMyThreadId); if (gDisableBackgroundScheduling) { @@ -1056,7 +1049,6 @@ status_t IPCThreadState::executeCommand(int32_t cmd) mCallingPid = origPid; mCallingUid = origUid; - mOrigCallingUid = origUid; IF_LOG_TRANSACTIONS() { TextOutput::Bundle _b(alog); diff --git a/libs/binder/MemoryBase.cpp b/libs/binder/MemoryBase.cpp index 033066b..5c82330 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> @@ -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!"); +} diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index 4c15913..c7bdcbc 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -627,11 +627,27 @@ status_t Parcel::writeFloat(float val) return writeAligned(val); } +#if defined(__mips__) && defined(__mips_hard_float) + +status_t Parcel::writeDouble(double val) +{ + union { + double d; + unsigned long long ll; + } u; + u.d = val; + return writeAligned(u.ll); +} + +#else + status_t Parcel::writeDouble(double val) { return writeAligned(val); } +#endif + status_t Parcel::writeIntPtr(intptr_t val) { return writeAligned(val); @@ -962,17 +978,44 @@ float Parcel::readFloat() const return readAligned<float>(); } +#if defined(__mips__) && defined(__mips_hard_float) + status_t Parcel::readDouble(double *pArg) const { - return readAligned(pArg); + union { + double d; + unsigned long long ll; + } u; + status_t status; + status = readAligned(&u.ll); + *pArg = u.d; + return status; +} + +double Parcel::readDouble() const +{ + union { + double d; + unsigned long long ll; + } u; + u.ll = readAligned<unsigned long long>(); + return u.d; } +#else + +status_t Parcel::readDouble(double *pArg) const +{ + return readAligned(pArg); +} double Parcel::readDouble() const { return readAligned<double>(); } +#endif + status_t Parcel::readIntPtr(intptr_t *pArg) const { return readAligned(pArg); @@ -1429,6 +1472,8 @@ status_t Parcel::continueWrite(size_t desired) if (objectsSize) { objects = (size_t*)malloc(objectsSize*sizeof(size_t)); if (!objects) { + free(data); + mError = NO_MEMORY; return NO_MEMORY; } @@ -1509,7 +1554,7 @@ status_t Parcel::continueWrite(size_t desired) mError = NO_MEMORY; return NO_MEMORY; } - + if(!(mDataCapacity == 0 && mObjects == NULL && mObjectsCapacity == 0)) { ALOGE("continueWrite: %d/%p/%d/%d", mDataCapacity, mObjects, mObjectsCapacity, desired); |