diff options
Diffstat (limited to 'libs')
124 files changed, 1402 insertions, 1402 deletions
diff --git a/libs/binder/Binder.cpp b/libs/binder/Binder.cpp index 9945f91..e20d8a3 100644 --- a/libs/binder/Binder.cpp +++ b/libs/binder/Binder.cpp @@ -89,7 +89,7 @@ const String16& BBinder::getInterfaceDescriptor() const // This is a local static rather than a global static, // to avoid static initializer ordering issues. static String16 sEmptyDescriptor; - LOGW("reached BBinder::getInterfaceDescriptor (this=%p)", this); + ALOGW("reached BBinder::getInterfaceDescriptor (this=%p)", this); return sEmptyDescriptor; } diff --git a/libs/binder/BpBinder.cpp b/libs/binder/BpBinder.cpp index 5de87ec..47a62db 100644 --- a/libs/binder/BpBinder.cpp +++ b/libs/binder/BpBinder.cpp @@ -24,8 +24,8 @@ #include <stdio.h> -//#undef LOGV -//#define LOGV(...) fprintf(stderr, __VA_ARGS__) +//#undef ALOGV +//#define ALOGV(...) fprintf(stderr, __VA_ARGS__) namespace android { @@ -50,7 +50,7 @@ void BpBinder::ObjectManager::attach( e.func = func; if (mObjects.indexOfKey(objectID) >= 0) { - LOGE("Trying to attach object ID %p to binder ObjectManager %p with object %p, but object ID already in use", + ALOGE("Trying to attach object ID %p to binder ObjectManager %p with object %p, but object ID already in use", objectID, this, object); return; } @@ -73,7 +73,7 @@ void BpBinder::ObjectManager::detach(const void* objectID) void BpBinder::ObjectManager::kill() { const size_t N = mObjects.size(); - LOGV("Killing %d objects in manager %p", N, this); + ALOGV("Killing %d objects in manager %p", N, this); for (size_t i=0; i<N; i++) { const entry_t& e = mObjects.valueAt(i); if (e.func != NULL) { @@ -92,7 +92,7 @@ BpBinder::BpBinder(int32_t handle) , mObitsSent(0) , mObituaries(NULL) { - LOGV("Creating BpBinder %p handle %d\n", this, mHandle); + ALOGV("Creating BpBinder %p handle %d\n", this, mHandle); extendObjectLifetime(OBJECT_LIFETIME_WEAK); IPCThreadState::self()->incWeakHandle(handle); @@ -190,7 +190,7 @@ status_t BpBinder::linkToDeath( if (!mObituaries) { return NO_MEMORY; } - LOGV("Requesting death notification: %p handle %d\n", this, mHandle); + ALOGV("Requesting death notification: %p handle %d\n", this, mHandle); getWeakRefs()->incWeak(this); IPCThreadState* self = IPCThreadState::self(); self->requestDeathNotification(mHandle, this); @@ -226,7 +226,7 @@ status_t BpBinder::unlinkToDeath( } mObituaries->removeAt(i); if (mObituaries->size() == 0) { - LOGV("Clearing death notification: %p handle %d\n", this, mHandle); + ALOGV("Clearing death notification: %p handle %d\n", this, mHandle); IPCThreadState* self = IPCThreadState::self(); self->clearDeathNotification(mHandle, this); self->flushCommands(); @@ -242,7 +242,7 @@ status_t BpBinder::unlinkToDeath( void BpBinder::sendObituary() { - LOGV("Sending obituary for proxy %p handle %d, mObitsSent=%s\n", + ALOGV("Sending obituary for proxy %p handle %d, mObitsSent=%s\n", this, mHandle, mObitsSent ? "true" : "false"); mAlive = 0; @@ -251,7 +251,7 @@ void BpBinder::sendObituary() mLock.lock(); Vector<Obituary>* obits = mObituaries; if(obits != NULL) { - LOGV("Clearing sent death notification: %p handle %d\n", this, mHandle); + ALOGV("Clearing sent death notification: %p handle %d\n", this, mHandle); IPCThreadState* self = IPCThreadState::self(); self->clearDeathNotification(mHandle, this); self->flushCommands(); @@ -260,7 +260,7 @@ void BpBinder::sendObituary() mObitsSent = 1; mLock.unlock(); - LOGV("Reporting death of proxy %p for %d recipients\n", + ALOGV("Reporting death of proxy %p for %d recipients\n", this, obits ? obits->size() : 0); if (obits != NULL) { @@ -276,7 +276,7 @@ void BpBinder::sendObituary() void BpBinder::reportOneDeath(const Obituary& obit) { sp<DeathRecipient> recipient = obit.recipient.promote(); - LOGV("Reporting death to recipient: %p\n", recipient.get()); + ALOGV("Reporting death to recipient: %p\n", recipient.get()); if (recipient == NULL) return; recipient->binderDied(this); @@ -288,7 +288,7 @@ void BpBinder::attachObject( object_cleanup_func func) { AutoMutex _l(mLock); - LOGV("Attaching object %p to binder %p (manager=%p)", object, this, &mObjects); + ALOGV("Attaching object %p to binder %p (manager=%p)", object, this, &mObjects); mObjects.attach(objectID, object, cleanupCookie, func); } @@ -311,7 +311,7 @@ BpBinder* BpBinder::remoteBinder() BpBinder::~BpBinder() { - LOGV("Destroying BpBinder %p handle %d\n", this, mHandle); + ALOGV("Destroying BpBinder %p handle %d\n", this, mHandle); IPCThreadState* ipc = IPCThreadState::self(); @@ -338,15 +338,15 @@ BpBinder::~BpBinder() void BpBinder::onFirstRef() { - LOGV("onFirstRef BpBinder %p handle %d\n", this, mHandle); + ALOGV("onFirstRef BpBinder %p handle %d\n", this, mHandle); IPCThreadState* ipc = IPCThreadState::self(); if (ipc) ipc->incStrongHandle(mHandle); } void BpBinder::onLastStrongRef(const void* id) { - LOGV("onLastStrongRef BpBinder %p handle %d\n", this, mHandle); - IF_LOGV() { + ALOGV("onLastStrongRef BpBinder %p handle %d\n", this, mHandle); + IF_ALOGV() { printRefs(); } IPCThreadState* ipc = IPCThreadState::self(); @@ -355,7 +355,7 @@ void BpBinder::onLastStrongRef(const void* id) bool BpBinder::onIncStrongAttempted(uint32_t flags, const void* id) { - LOGV("onIncStrongAttempted BpBinder %p handle %d\n", this, mHandle); + ALOGV("onIncStrongAttempted BpBinder %p handle %d\n", this, mHandle); IPCThreadState* ipc = IPCThreadState::self(); return ipc ? ipc->attemptIncStrongHandle(mHandle) == NO_ERROR : false; } diff --git a/libs/binder/CursorWindow.cpp b/libs/binder/CursorWindow.cpp index 0733378..a6e5f71 100644 --- a/libs/binder/CursorWindow.cpp +++ b/libs/binder/CursorWindow.cpp @@ -150,7 +150,7 @@ status_t CursorWindow::setNumColumns(uint32_t numColumns) { uint32_t cur = mHeader->numColumns; if ((cur > 0 || mHeader->numRows > 0) && cur != numColumns) { - LOGE("Trying to go from %d columns to %d", cur, numColumns); + ALOGE("Trying to go from %d columns to %d", cur, numColumns); return INVALID_OPERATION; } mHeader->numColumns = numColumns; @@ -209,7 +209,7 @@ uint32_t CursorWindow::alloc(size_t size, bool aligned) { uint32_t offset = mHeader->freeOffset + padding; uint32_t nextFreeOffset = offset + size; if (nextFreeOffset > mSize) { - LOGW("Window is full: requested allocation %d bytes, " + ALOGW("Window is full: requested allocation %d bytes, " "free space %d bytes, window size %d bytes", size, freeSpace(), mSize); return 0; @@ -255,14 +255,14 @@ CursorWindow::RowSlot* CursorWindow::allocRowSlot() { CursorWindow::FieldSlot* CursorWindow::getFieldSlot(uint32_t row, uint32_t column) { if (row >= mHeader->numRows || column >= mHeader->numColumns) { - LOGE("Failed to read row %d, column %d from a CursorWindow which " + ALOGE("Failed to read row %d, column %d from a CursorWindow which " "has %d rows, %d columns.", row, column, mHeader->numRows, mHeader->numColumns); return NULL; } RowSlot* rowSlot = getRowSlot(row); if (!rowSlot) { - LOGE("Failed to find rowSlot for row %d.", row); + ALOGE("Failed to find rowSlot for row %d.", row); return NULL; } FieldSlot* fieldDir = static_cast<FieldSlot*>(offsetToPtr(rowSlot->offset)); diff --git a/libs/binder/IMemory.cpp b/libs/binder/IMemory.cpp index 1ace8f8..cd2451a 100644 --- a/libs/binder/IMemory.cpp +++ b/libs/binder/IMemory.cpp @@ -244,7 +244,7 @@ BpMemoryHeap::~BpMemoryHeap() { sp<IBinder> binder = const_cast<BpMemoryHeap*>(this)->asBinder(); if (VERBOSE) { - LOGD("UNMAPPING binder=%p, heap=%p, size=%d, fd=%d", + ALOGD("UNMAPPING binder=%p, heap=%p, size=%d, fd=%d", binder.get(), this, mSize, mHeapId); CallStack stack; stack.update(); @@ -298,11 +298,11 @@ void BpMemoryHeap::assertReallyMapped() const uint32_t flags = reply.readInt32(); uint32_t offset = reply.readInt32(); - LOGE_IF(err, "binder=%p transaction failed fd=%d, size=%ld, err=%d (%s)", + ALOGE_IF(err, "binder=%p transaction failed fd=%d, size=%ld, err=%d (%s)", asBinder().get(), parcel_fd, size, err, strerror(-err)); int fd = dup( parcel_fd ); - LOGE_IF(fd==-1, "cannot dup fd=%d, size=%ld, err=%d (%s)", + ALOGE_IF(fd==-1, "cannot dup fd=%d, size=%ld, 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) { - LOGE("cannot map BpMemoryHeap (binder=%p), size=%ld, fd=%d (%s)", + ALOGE("cannot map BpMemoryHeap (binder=%p), size=%ld, fd=%d (%s)", asBinder().get(), size, fd, strerror(errno)); close(fd); } else { @@ -393,7 +393,7 @@ HeapCache::~HeapCache() void HeapCache::binderDied(const wp<IBinder>& binder) { - //LOGD("binderDied binder=%p", binder.unsafe_get()); + //ALOGD("binderDied binder=%p", binder.unsafe_get()); free_heap(binder); } @@ -403,7 +403,7 @@ sp<IMemoryHeap> HeapCache::find_heap(const sp<IBinder>& binder) ssize_t i = mHeapCache.indexOfKey(binder); if (i>=0) { heap_info_t& info = mHeapCache.editValueAt(i); - LOGD_IF(VERBOSE, + ALOGD_IF(VERBOSE, "found binder=%p, heap=%p, size=%d, fd=%d, count=%d", binder.get(), info.heap.get(), static_cast<BpMemoryHeap*>(info.heap.get())->mSize, @@ -415,7 +415,7 @@ sp<IMemoryHeap> HeapCache::find_heap(const sp<IBinder>& binder) heap_info_t info; info.heap = interface_cast<IMemoryHeap>(binder); info.count = 1; - //LOGD("adding binder=%p, heap=%p, count=%d", + //ALOGD("adding binder=%p, heap=%p, count=%d", // binder.get(), info.heap.get(), info.count); mHeapCache.add(binder, info); return info.heap; @@ -436,7 +436,7 @@ void HeapCache::free_heap(const wp<IBinder>& binder) heap_info_t& info(mHeapCache.editValueAt(i)); int32_t c = android_atomic_dec(&info.count); if (c == 1) { - LOGD_IF(VERBOSE, + ALOGD_IF(VERBOSE, "removing binder=%p, heap=%p, size=%d, fd=%d, count=%d", binder.unsafe_get(), info.heap.get(), static_cast<BpMemoryHeap*>(info.heap.get())->mSize, @@ -446,7 +446,7 @@ void HeapCache::free_heap(const wp<IBinder>& binder) mHeapCache.removeItemsAt(i); } } else { - LOGE("free_heap binder=%p not found!!!", binder.unsafe_get()); + ALOGE("free_heap binder=%p not found!!!", binder.unsafe_get()); } } } @@ -468,7 +468,7 @@ void HeapCache::dump_heaps() for (int i=0 ; i<c ; i++) { const heap_info_t& info = mHeapCache.valueAt(i); BpMemoryHeap const* h(static_cast<BpMemoryHeap const *>(info.heap.get())); - LOGD("hey=%p, heap=%p, count=%d, (fd=%d, base=%p, size=%d)", + ALOGD("hey=%p, heap=%p, count=%d, (fd=%d, base=%p, size=%d)", mHeapCache.keyAt(i).unsafe_get(), info.heap.get(), info.count, h->mHeapId, h->mBase, h->mSize); diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp index 5d34787..629b899 100644 --- a/libs/binder/IPCThreadState.cpp +++ b/libs/binder/IPCThreadState.cpp @@ -56,12 +56,12 @@ #else -#define IF_LOG_TRANSACTIONS() IF_LOG(LOG_VERBOSE, "transact") -#define IF_LOG_COMMANDS() IF_LOG(LOG_VERBOSE, "ipc") -#define LOG_REMOTEREFS(...) LOG(LOG_DEBUG, "remoterefs", __VA_ARGS__) -#define IF_LOG_REMOTEREFS() IF_LOG(LOG_DEBUG, "remoterefs") -#define LOG_THREADPOOL(...) LOG(LOG_DEBUG, "threadpool", __VA_ARGS__) -#define LOG_ONEWAY(...) LOG(LOG_DEBUG, "ipc", __VA_ARGS__) +#define IF_LOG_TRANSACTIONS() IF_ALOG(LOG_VERBOSE, "transact") +#define IF_LOG_COMMANDS() IF_ALOG(LOG_VERBOSE, "ipc") +#define LOG_REMOTEREFS(...) ALOG(LOG_DEBUG, "remoterefs", __VA_ARGS__) +#define IF_LOG_REMOTEREFS() IF_ALOG(LOG_DEBUG, "remoterefs") +#define LOG_THREADPOOL(...) ALOG(LOG_DEBUG, "threadpool", __VA_ARGS__) +#define LOG_ONEWAY(...) ALOG(LOG_DEBUG, "ipc", __VA_ARGS__) #endif @@ -493,7 +493,7 @@ void IPCThreadState::joinThreadPool(bool isMain) void IPCThreadState::stopProcess(bool immediate) { - //LOGI("**** STOPPING PROCESS"); + //ALOGI("**** STOPPING PROCESS"); flushCommands(); int fd = mProcess->mDriverFD; mProcess->mDriverFD = -1; @@ -530,9 +530,9 @@ status_t IPCThreadState::transact(int32_t handle, if ((flags & TF_ONE_WAY) == 0) { #if 0 if (code == 4) { // relayout - LOGI(">>>>>> CALLING transaction 4"); + ALOGI(">>>>>> CALLING transaction 4"); } else { - LOGI(">>>>>> CALLING transaction %d", code); + ALOGI(">>>>>> CALLING transaction %d", code); } #endif if (reply) { @@ -543,9 +543,9 @@ status_t IPCThreadState::transact(int32_t handle, } #if 0 if (code == 4) { // relayout - LOGI("<<<<<< RETURNING transaction 4"); + ALOGI("<<<<<< RETURNING transaction 4"); } else { - LOGI("<<<<<< RETURNING transaction %d", code); + ALOGI("<<<<<< RETURNING transaction %d", code); } #endif @@ -692,7 +692,7 @@ status_t IPCThreadState::waitForResponse(Parcel *reply, status_t *acquireResult) case BR_ACQUIRE_RESULT: { - LOG_ASSERT(acquireResult != NULL, "Unexpected brACQUIRE_RESULT"); + ALOG_ASSERT(acquireResult != NULL, "Unexpected brACQUIRE_RESULT"); const int32_t result = mIn.readInt32(); if (!acquireResult) continue; *acquireResult = result ? NO_ERROR : INVALID_OPERATION; @@ -703,7 +703,7 @@ status_t IPCThreadState::waitForResponse(Parcel *reply, status_t *acquireResult) { binder_transaction_data tr; err = mIn.read(&tr, sizeof(tr)); - LOG_ASSERT(err == NO_ERROR, "Not enough command data for brREPLY"); + ALOG_ASSERT(err == NO_ERROR, "Not enough command data for brREPLY"); if (err != NO_ERROR) goto finish; if (reply) { @@ -752,7 +752,7 @@ finish: status_t IPCThreadState::talkWithDriver(bool doReceive) { - LOG_ASSERT(mProcess->mDriverFD >= 0, "Binder driver is not opened"); + ALOG_ASSERT(mProcess->mDriverFD >= 0, "Binder driver is not opened"); binder_write_read bwr; @@ -905,7 +905,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd) case BR_ACQUIRE: refs = (RefBase::weakref_type*)mIn.readInt32(); obj = (BBinder*)mIn.readInt32(); - LOG_ASSERT(refs->refBase() == obj, + ALOG_ASSERT(refs->refBase() == obj, "BR_ACQUIRE: object %p does not match cookie %p (expected %p)", refs, obj, refs->refBase()); obj->incStrong(mProcess.get()); @@ -921,7 +921,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd) case BR_RELEASE: refs = (RefBase::weakref_type*)mIn.readInt32(); obj = (BBinder*)mIn.readInt32(); - LOG_ASSERT(refs->refBase() == obj, + ALOG_ASSERT(refs->refBase() == obj, "BR_RELEASE: object %p does not match cookie %p (expected %p)", refs, obj, refs->refBase()); IF_LOG_REMOTEREFS() { @@ -946,7 +946,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd) // NOTE: This assertion is not valid, because the object may no // longer exist (thus the (BBinder*)cast above resulting in a different // memory address). - //LOG_ASSERT(refs->refBase() == obj, + //ALOG_ASSERT(refs->refBase() == obj, // "BR_DECREFS: object %p does not match cookie %p (expected %p)", // refs, obj, refs->refBase()); mPendingWeakDerefs.push(refs); @@ -958,7 +958,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd) { const bool success = refs->attemptIncStrong(mProcess.get()); - LOG_ASSERT(success && refs->refBase() == obj, + ALOG_ASSERT(success && refs->refBase() == obj, "BR_ATTEMPT_ACQUIRE: object %p does not match cookie %p (expected %p)", refs, obj, refs->refBase()); @@ -971,7 +971,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd) { binder_transaction_data tr; result = mIn.read(&tr, sizeof(tr)); - LOG_ASSERT(result == NO_ERROR, + ALOG_ASSERT(result == NO_ERROR, "Not enough command data for brTRANSACTION"); if (result != NO_ERROR) break; @@ -1009,7 +1009,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd) } } - //LOGI(">>>> TRANSACT from pid %d uid %d\n", mCallingPid, mCallingUid); + //ALOGI(">>>> TRANSACT from pid %d uid %d\n", mCallingPid, mCallingUid); Parcel reply; IF_LOG_TRANSACTIONS() { @@ -1033,7 +1033,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd) if (error < NO_ERROR) reply.setError(error); } - //LOGI("<<<< TRANSACT from pid %d restore pid %d uid %d\n", + //ALOGI("<<<< TRANSACT from pid %d restore pid %d uid %d\n", // mCallingPid, origPid, origUid); if ((tr.flags & TF_ONE_WAY) == 0) { @@ -1110,11 +1110,11 @@ void IPCThreadState::freeBuffer(Parcel* parcel, const uint8_t* data, size_t data const size_t* objects, size_t objectsSize, void* cookie) { - //LOGI("Freeing parcel %p", &parcel); + //ALOGI("Freeing parcel %p", &parcel); IF_LOG_COMMANDS() { alog << "Writing BC_FREE_BUFFER for " << data << endl; } - LOG_ASSERT(data != NULL, "Called with NULL data"); + ALOG_ASSERT(data != NULL, "Called with NULL data"); if (parcel != NULL) parcel->closeFileDescriptors(); IPCThreadState* state = self(); state->mOut.writeInt32(BC_FREE_BUFFER); diff --git a/libs/binder/IServiceManager.cpp b/libs/binder/IServiceManager.cpp index 1fa4c35..33b305d 100644 --- a/libs/binder/IServiceManager.cpp +++ b/libs/binder/IServiceManager.cpp @@ -78,7 +78,7 @@ bool checkPermission(const String16& permission, pid_t pid, uid_t uid) bool res = pc->checkPermission(permission, pid, uid); if (res) { if (startTime != 0) { - LOGI("Check passed after %d seconds for %s from uid=%d pid=%d", + ALOGI("Check passed after %d seconds for %s from uid=%d pid=%d", (int)((uptimeMillis()-startTime)/1000), String8(permission).string(), uid, pid); } @@ -87,7 +87,7 @@ bool checkPermission(const String16& permission, pid_t pid, uid_t uid) // Is this a permission failure, or did the controller go away? if (pc->asBinder()->isBinderAlive()) { - LOGW("Permission failure: %s from uid=%d pid=%d", + ALOGW("Permission failure: %s from uid=%d pid=%d", String8(permission).string(), uid, pid); return false; } @@ -106,7 +106,7 @@ bool checkPermission(const String16& permission, pid_t pid, uid_t uid) // Wait for the permission controller to come back... if (startTime == 0) { startTime = uptimeMillis(); - LOGI("Waiting to check permission %s from uid=%d pid=%d", + ALOGI("Waiting to check permission %s from uid=%d pid=%d", String8(permission).string(), uid, pid); } sleep(1); @@ -136,7 +136,7 @@ public: for (n = 0; n < 5; n++){ sp<IBinder> svc = checkService(name); if (svc != NULL) return svc; - LOGI("Waiting for service %s...\n", String8(name).string()); + ALOGI("Waiting for service %s...\n", String8(name).string()); sleep(1); } return NULL; diff --git a/libs/binder/MemoryDealer.cpp b/libs/binder/MemoryDealer.cpp index 18669f7..ff5e6bd 100644 --- a/libs/binder/MemoryDealer.cpp +++ b/libs/binder/MemoryDealer.cpp @@ -211,7 +211,7 @@ Allocation::~Allocation() #ifdef MADV_REMOVE if (size) { int err = madvise(start_ptr, size, MADV_REMOVE); - LOGW_IF(err, "madvise(%p, %u, MADV_REMOVE) returned %s", + ALOGW_IF(err, "madvise(%p, %u, MADV_REMOVE) returned %s", start_ptr, size, err<0 ? strerror(errno) : "Ok"); } #endif @@ -344,7 +344,7 @@ ssize_t SimpleBestFitAllocator::alloc(size_t size, uint32_t flags) mList.insertBefore(free_chunk, split); } - LOGE_IF((flags&PAGE_ALIGNED) && + ALOGE_IF((flags&PAGE_ALIGNED) && ((free_chunk->start*kMemoryAlign)&(pagesize-1)), "PAGE_ALIGNED requested, but page is not aligned!!!"); @@ -411,7 +411,7 @@ void SimpleBestFitAllocator::dump_l(const char* what) const { String8 result; dump_l(result, what); - LOGD("%s", result.string()); + ALOGD("%s", result.string()); } void SimpleBestFitAllocator::dump(String8& result, diff --git a/libs/binder/MemoryHeapBase.cpp b/libs/binder/MemoryHeapBase.cpp index bf4a73f..d1cbf1c 100644 --- a/libs/binder/MemoryHeapBase.cpp +++ b/libs/binder/MemoryHeapBase.cpp @@ -53,7 +53,7 @@ MemoryHeapBase::MemoryHeapBase(size_t size, uint32_t flags, char const * name) const size_t pagesize = getpagesize(); size = ((size + pagesize-1) & ~(pagesize-1)); int fd = ashmem_create_region(name == NULL ? "MemoryHeapBase" : name, size); - LOGE_IF(fd<0, "error creating ashmem region: %s", strerror(errno)); + ALOGE_IF(fd<0, "error creating ashmem region: %s", strerror(errno)); if (fd >= 0) { if (mapfd(fd, size) == NO_ERROR) { if (flags & READ_ONLY) { @@ -72,7 +72,7 @@ MemoryHeapBase::MemoryHeapBase(const char* device, size_t size, uint32_t flags) open_flags |= O_SYNC; int fd = open(device, open_flags); - LOGE_IF(fd<0, "error opening %s: %s", device, strerror(errno)); + ALOGE_IF(fd<0, "error opening %s: %s", device, strerror(errno)); if (fd >= 0) { const size_t pagesize = getpagesize(); size = ((size + pagesize-1) & ~(pagesize-1)); @@ -127,12 +127,12 @@ status_t MemoryHeapBase::mapfd(int fd, size_t size, uint32_t offset) void* base = (uint8_t*)mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, offset); if (base == MAP_FAILED) { - LOGE("mmap(fd=%d, size=%u) failed (%s)", + ALOGE("mmap(fd=%d, size=%u) failed (%s)", fd, uint32_t(size), strerror(errno)); close(fd); return -errno; } - //LOGD("mmap(fd=%d, base=%p, size=%lu)", fd, base, size); + //ALOGD("mmap(fd=%d, base=%p, size=%lu)", fd, base, size); mBase = base; mNeedUnmap = true; } else { @@ -155,7 +155,7 @@ void MemoryHeapBase::dispose() int fd = android_atomic_or(-1, &mFD); if (fd >= 0) { if (mNeedUnmap) { - //LOGD("munmap(fd=%d, base=%p, size=%lu)", fd, mBase, mSize); + //ALOGD("munmap(fd=%d, base=%p, size=%lu)", fd, mBase, mSize); munmap(mBase, mSize); } mBase = 0; diff --git a/libs/binder/MemoryHeapPmem.cpp b/libs/binder/MemoryHeapPmem.cpp index 03322ea..66bcf4d 100644 --- a/libs/binder/MemoryHeapPmem.cpp +++ b/libs/binder/MemoryHeapPmem.cpp @@ -79,7 +79,7 @@ SubRegionMemory::SubRegionMemory(const sp<MemoryHeapPmem>& heap, int our_fd = heap->heapID(); struct pmem_region sub = { offset, size }; int err = ioctl(our_fd, PMEM_MAP, &sub); - LOGE_IF(err<0, "PMEM_MAP failed (%s), " + ALOGE_IF(err<0, "PMEM_MAP failed (%s), " "mFD=%d, sub.offset=%lu, sub.size=%lu", strerror(errno), our_fd, sub.offset, sub.len); } @@ -115,7 +115,7 @@ void SubRegionMemory::revoke() sub.offset = mOffset; sub.len = mSize; int err = ioctl(our_fd, PMEM_UNMAP, &sub); - LOGE_IF(err<0, "PMEM_UNMAP failed (%s), " + ALOGE_IF(err<0, "PMEM_UNMAP failed (%s), " "mFD=%d, sub.offset=%lu, sub.size=%lu", strerror(errno), our_fd, sub.offset, sub.len); mSize = 0; @@ -133,11 +133,11 @@ MemoryHeapPmem::MemoryHeapPmem(const sp<MemoryHeapBase>& pmemHeap, #ifdef HAVE_ANDROID_OS if (device) { int fd = open(device, O_RDWR | (flags & NO_CACHING ? O_SYNC : 0)); - LOGE_IF(fd<0, "couldn't open %s (%s)", device, strerror(errno)); + ALOGE_IF(fd<0, "couldn't open %s (%s)", device, strerror(errno)); if (fd >= 0) { int err = ioctl(fd, PMEM_CONNECT, pmemHeap->heapID()); if (err < 0) { - LOGE("PMEM_CONNECT failed (%s), mFD=%d, sub-fd=%d", + ALOGE("PMEM_CONNECT failed (%s), mFD=%d, sub-fd=%d", strerror(errno), fd, pmemHeap->heapID()); close(fd); } else { @@ -194,7 +194,7 @@ status_t MemoryHeapPmem::slap() int our_fd = getHeapID(); struct pmem_region sub = { 0, size }; int err = ioctl(our_fd, PMEM_MAP, &sub); - LOGE_IF(err<0, "PMEM_MAP failed (%s), " + ALOGE_IF(err<0, "PMEM_MAP failed (%s), " "mFD=%d, sub.offset=%lu, sub.size=%lu", strerror(errno), our_fd, sub.offset, sub.len); return -errno; @@ -212,7 +212,7 @@ status_t MemoryHeapPmem::unslap() int our_fd = getHeapID(); struct pmem_region sub = { 0, size }; int err = ioctl(our_fd, PMEM_UNMAP, &sub); - LOGE_IF(err<0, "PMEM_UNMAP failed (%s), " + ALOGE_IF(err<0, "PMEM_UNMAP failed (%s), " "mFD=%d, sub.offset=%lu, sub.size=%lu", strerror(errno), our_fd, sub.offset, sub.len); return -errno; diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index 6b4c1a6..3400e97 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -44,7 +44,7 @@ #endif #define LOG_REFS(...) -//#define LOG_REFS(...) LOG(LOG_DEBUG, "Parcel", __VA_ARGS__) +//#define LOG_REFS(...) ALOG(LOG_DEBUG, "Parcel", __VA_ARGS__) // --------------------------------------------------------------------------- @@ -103,7 +103,7 @@ void acquire_object(const sp<ProcessState>& proc, } } - LOGD("Invalid object type 0x%08lx", obj.type); + ALOGD("Invalid object type 0x%08lx", obj.type); } void release_object(const sp<ProcessState>& proc, @@ -139,7 +139,7 @@ void release_object(const sp<ProcessState>& proc, } } - LOGE("Invalid object type 0x%08lx", obj.type); + ALOGE("Invalid object type 0x%08lx", obj.type); } inline static status_t finish_flatten_binder( @@ -159,7 +159,7 @@ status_t flatten_binder(const sp<ProcessState>& proc, if (!local) { BpBinder *proxy = binder->remoteBinder(); if (proxy == NULL) { - LOGE("null proxy"); + ALOGE("null proxy"); } const int32_t handle = proxy ? proxy->handle() : 0; obj.type = BINDER_TYPE_HANDLE; @@ -192,7 +192,7 @@ status_t flatten_binder(const sp<ProcessState>& proc, if (!local) { BpBinder *proxy = real->remoteBinder(); if (proxy == NULL) { - LOGE("null proxy"); + ALOGE("null proxy"); } const int32_t handle = proxy ? proxy->handle() : 0; obj.type = BINDER_TYPE_WEAK_HANDLE; @@ -213,7 +213,7 @@ status_t flatten_binder(const sp<ProcessState>& proc, // The OpenBinder implementation uses a dynamic_cast<> here, // but we can't do that with the different reference counting // implementation we are using. - LOGE("Unable to unflatten Binder weak reference!"); + ALOGE("Unable to unflatten Binder weak reference!"); obj.type = BINDER_TYPE_BINDER; obj.binder = NULL; obj.cookie = NULL; @@ -330,7 +330,7 @@ status_t Parcel::setDataSize(size_t size) err = continueWrite(size); if (err == NO_ERROR) { mDataSize = size; - LOGV("setDataSize Setting data size of %p to %d\n", this, mDataSize); + ALOGV("setDataSize Setting data size of %p to %d\n", this, mDataSize); } return err; } @@ -504,7 +504,7 @@ bool Parcel::enforceInterface(const String16& interface, if (str == interface) { return true; } else { - LOGW("**** enforceInterface() expected '%s' but read '%s'\n", + ALOGW("**** enforceInterface() expected '%s' but read '%s'\n", String8(interface).string(), String8(str).string()); return false; } @@ -534,10 +534,10 @@ status_t Parcel::finishWrite(size_t len) { //printf("Finish write of %d\n", len); mDataPos += len; - LOGV("finishWrite Setting data pos of %p to %d\n", this, mDataPos); + ALOGV("finishWrite Setting data pos of %p to %d\n", this, mDataPos); if (mDataPos > mDataSize) { mDataSize = mDataPos; - LOGV("finishWrite Setting data size of %p to %d\n", this, mDataSize); + ALOGV("finishWrite Setting data size of %p to %d\n", this, mDataSize); } //printf("New pos=%d, size=%d\n", mDataPos, mDataSize); return NO_ERROR; @@ -703,7 +703,7 @@ status_t Parcel::writeNativeHandle(const native_handle* handle) err = writeDupFileDescriptor(handle->data[i]); if (err != NO_ERROR) { - LOGD("write native handle, write dup fd failed"); + ALOGD("write native handle, write dup fd failed"); return err; } err = write(handle->data + handle->numFds, sizeof(int)*handle->numInts); @@ -730,7 +730,7 @@ status_t Parcel::writeBlob(size_t len, WritableBlob* outBlob) status_t status; if (!mAllowFds || len <= IN_PLACE_BLOB_LIMIT) { - LOGV("writeBlob: write in place"); + ALOGV("writeBlob: write in place"); status = writeInt32(0); if (status) return status; @@ -741,7 +741,7 @@ status_t Parcel::writeBlob(size_t len, WritableBlob* outBlob) return NO_ERROR; } - LOGV("writeBlob: write to ashmem"); + ALOGV("writeBlob: write to ashmem"); int fd = ashmem_create_region("Parcel Blob", len); if (fd < 0) return NO_MEMORY; @@ -865,7 +865,7 @@ status_t Parcel::read(void* outData, size_t len) const if ((mDataPos+PAD_SIZE(len)) >= mDataPos && (mDataPos+PAD_SIZE(len)) <= mDataSize) { memcpy(outData, mData+mDataPos, len); mDataPos += PAD_SIZE(len); - LOGV("read Setting data pos of %p to %d\n", this, mDataPos); + ALOGV("read Setting data pos of %p to %d\n", this, mDataPos); return NO_ERROR; } return NOT_ENOUGH_DATA; @@ -876,7 +876,7 @@ const void* Parcel::readInplace(size_t len) const if ((mDataPos+PAD_SIZE(len)) >= mDataPos && (mDataPos+PAD_SIZE(len)) <= mDataSize) { const void* data = mData+mDataPos; mDataPos += PAD_SIZE(len); - LOGV("readInplace Setting data pos of %p to %d\n", this, mDataPos); + ALOGV("readInplace Setting data pos of %p to %d\n", this, mDataPos); return data; } return NULL; @@ -987,7 +987,7 @@ const char* Parcel::readCString() const if (eos) { const size_t len = eos - str; mDataPos += PAD_SIZE(len+1); - LOGV("readCString Setting data pos of %p to %d\n", this, mDataPos); + ALOGV("readCString Setting data pos of %p to %d\n", this, mDataPos); return str; } } @@ -1010,7 +1010,7 @@ String16 Parcel::readString16() const size_t len; const char16_t* str = readString16Inplace(&len); if (str) return String16(str, len); - LOGE("Reading a NULL string not supported here."); + ALOGE("Reading a NULL string not supported here."); return String16(); } @@ -1088,7 +1088,7 @@ int Parcel::readFileDescriptor() const if (flat) { switch (flat->type) { case BINDER_TYPE_FD: - //LOGI("Returning file descriptor %ld from parcel %p\n", flat->handle, this); + //ALOGI("Returning file descriptor %ld from parcel %p\n", flat->handle, this); return flat->handle; } } @@ -1102,7 +1102,7 @@ status_t Parcel::readBlob(size_t len, ReadableBlob* outBlob) const if (status) return status; if (!useAshmem) { - LOGV("readBlob: read in place"); + ALOGV("readBlob: read in place"); const void* ptr = readInplace(len); if (!ptr) return BAD_VALUE; @@ -1110,7 +1110,7 @@ status_t Parcel::readBlob(size_t len, ReadableBlob* outBlob) const return NO_ERROR; } - LOGV("readBlob: read from ashmem"); + ALOGV("readBlob: read from ashmem"); int fd = readFileDescriptor(); if (fd == int(BAD_TYPE)) return BAD_VALUE; @@ -1164,7 +1164,7 @@ const flat_binder_object* Parcel::readObject(bool nullMetaData) const // When transferring a NULL object, we don't write it into // the object list, so we don't want to check for it when // reading. - LOGV("readObject Setting data pos of %p to %d\n", this, mDataPos); + ALOGV("readObject Setting data pos of %p to %d\n", this, mDataPos); return obj; } @@ -1174,7 +1174,7 @@ const flat_binder_object* Parcel::readObject(bool nullMetaData) const size_t opos = mNextObjectHint; if (N > 0) { - LOGV("Parcel %p looking for obj at %d, hint=%d\n", + ALOGV("Parcel %p looking for obj at %d, hint=%d\n", this, DPOS, opos); // Start at the current hint position, looking for an object at @@ -1188,10 +1188,10 @@ const flat_binder_object* Parcel::readObject(bool nullMetaData) const } if (OBJS[opos] == DPOS) { // Found it! - LOGV("Parcel found obj %d at index %d with forward search", + ALOGV("Parcel found obj %d at index %d with forward search", this, DPOS, opos); mNextObjectHint = opos+1; - LOGV("readObject Setting data pos of %p to %d\n", this, mDataPos); + ALOGV("readObject Setting data pos of %p to %d\n", this, mDataPos); return obj; } @@ -1201,14 +1201,14 @@ const flat_binder_object* Parcel::readObject(bool nullMetaData) const } if (OBJS[opos] == DPOS) { // Found it! - LOGV("Parcel found obj %d at index %d with backward search", + ALOGV("Parcel found obj %d at index %d with backward search", this, DPOS, opos); mNextObjectHint = opos+1; - LOGV("readObject Setting data pos of %p to %d\n", this, mDataPos); + ALOGV("readObject Setting data pos of %p to %d\n", this, mDataPos); return obj; } } - LOGW("Attempt to read object from Parcel %p at offset %d that is not in the object list", + ALOGW("Attempt to read object from Parcel %p at offset %d that is not in the object list", this, DPOS); } return NULL; @@ -1218,14 +1218,14 @@ void Parcel::closeFileDescriptors() { size_t i = mObjectsSize; if (i > 0) { - //LOGI("Closing file descriptors for %d objects...", mObjectsSize); + //ALOGI("Closing file descriptors for %d objects...", mObjectsSize); } while (i > 0) { i--; const flat_binder_object* flat = reinterpret_cast<flat_binder_object*>(mData+mObjects[i]); if (flat->type == BINDER_TYPE_FD) { - //LOGI("Closing fd: %ld\n", flat->handle); + //ALOGI("Closing fd: %ld\n", flat->handle); close(flat->handle); } } @@ -1258,9 +1258,9 @@ void Parcel::ipcSetDataReference(const uint8_t* data, size_t dataSize, mError = NO_ERROR; mData = const_cast<uint8_t*>(data); mDataSize = mDataCapacity = dataSize; - //LOGI("setDataReference Setting data size of %p to %lu (pid=%d)\n", this, mDataSize, getpid()); + //ALOGI("setDataReference Setting data size of %p to %lu (pid=%d)\n", this, mDataSize, getpid()); mDataPos = 0; - LOGV("setDataReference Setting data pos of %p to %d\n", this, mDataPos); + ALOGV("setDataReference Setting data pos of %p to %d\n", this, mDataPos); mObjects = const_cast<size_t*>(objects); mObjectsSize = mObjectsCapacity = objectsCount; mNextObjectHint = 0; @@ -1332,7 +1332,7 @@ void Parcel::freeData() void Parcel::freeDataNoInit() { if (mOwner) { - //LOGI("Freeing data ref of %p (pid=%d)\n", this, getpid()); + //ALOGI("Freeing data ref of %p (pid=%d)\n", this, getpid()); mOwner(this, mData, mDataSize, mObjects, mObjectsSize, mOwnerCookie); } else { releaseObjects(); @@ -1370,8 +1370,8 @@ status_t Parcel::restartWrite(size_t desired) } mDataSize = mDataPos = 0; - LOGV("restartWrite Setting data size of %p to %d\n", this, mDataSize); - LOGV("restartWrite Setting data pos of %p to %d\n", this, mDataPos); + ALOGV("restartWrite Setting data size of %p to %d\n", this, mDataSize); + ALOGV("restartWrite Setting data pos of %p to %d\n", this, mDataPos); free(mObjects); mObjects = NULL; @@ -1438,14 +1438,14 @@ status_t Parcel::continueWrite(size_t desired) if (objects && mObjects) { memcpy(objects, mObjects, objectsSize*sizeof(size_t)); } - //LOGI("Freeing data ref of %p (pid=%d)\n", this, getpid()); + //ALOGI("Freeing data ref of %p (pid=%d)\n", this, getpid()); mOwner(this, mData, mDataSize, mObjects, mObjectsSize, mOwnerCookie); mOwner = NULL; mData = data; mObjects = objects; mDataSize = (mDataSize < desired) ? mDataSize : desired; - LOGV("continueWrite Setting data size of %p to %d\n", this, mDataSize); + ALOGV("continueWrite Setting data size of %p to %d\n", this, mDataSize); mDataCapacity = desired; mObjectsSize = mObjectsCapacity = objectsSize; mNextObjectHint = 0; @@ -1485,11 +1485,11 @@ status_t Parcel::continueWrite(size_t desired) } else { if (mDataSize > desired) { mDataSize = desired; - LOGV("continueWrite Setting data size of %p to %d\n", this, mDataSize); + ALOGV("continueWrite Setting data size of %p to %d\n", this, mDataSize); } if (mDataPos > desired) { mDataPos = desired; - LOGV("continueWrite Setting data pos of %p to %d\n", this, mDataPos); + ALOGV("continueWrite Setting data pos of %p to %d\n", this, mDataPos); } } @@ -1503,13 +1503,13 @@ status_t Parcel::continueWrite(size_t desired) if(!(mDataCapacity == 0 && mObjects == NULL && mObjectsCapacity == 0)) { - LOGE("continueWrite: %d/%p/%d/%d", mDataCapacity, mObjects, mObjectsCapacity, desired); + ALOGE("continueWrite: %d/%p/%d/%d", mDataCapacity, mObjects, mObjectsCapacity, desired); } mData = data; mDataSize = mDataPos = 0; - LOGV("continueWrite Setting data size of %p to %d\n", this, mDataSize); - LOGV("continueWrite Setting data pos of %p to %d\n", this, mDataPos); + ALOGV("continueWrite Setting data size of %p to %d\n", this, mDataSize); + ALOGV("continueWrite Setting data pos of %p to %d\n", this, mDataPos); mDataCapacity = desired; } @@ -1523,8 +1523,8 @@ void Parcel::initState() mDataSize = 0; mDataCapacity = 0; mDataPos = 0; - LOGV("initState Setting data size of %p to %d\n", this, mDataSize); - LOGV("initState Setting data pos of %p to %d\n", this, mDataPos); + ALOGV("initState Setting data size of %p to %d\n", this, mDataSize); + ALOGV("initState Setting data pos of %p to %d\n", this, mDataPos); mObjects = NULL; mObjectsSize = 0; mObjectsCapacity = 0; diff --git a/libs/binder/PermissionCache.cpp b/libs/binder/PermissionCache.cpp index 7278187..a503be8 100644 --- a/libs/binder/PermissionCache.cpp +++ b/libs/binder/PermissionCache.cpp @@ -101,7 +101,7 @@ bool PermissionCache::checkPermission( nsecs_t t = -systemTime(); granted = android::checkPermission(permission, pid, uid); t += systemTime(); - LOGD("checking %s for uid=%d => %s (%d us)", + ALOGD("checking %s for uid=%d => %s (%d us)", String8(permission).string(), uid, granted?"granted":"denied", (int)ns2us(t)); pc.cache(permission, uid, granted); diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp index f5288c8..f96fe50 100644 --- a/libs/binder/ProcessState.cpp +++ b/libs/binder/ProcessState.cpp @@ -109,7 +109,7 @@ sp<IBinder> ProcessState::getContextObject(const String16& name, const sp<IBinde // Don't attempt to retrieve contexts if we manage them if (mManagesContexts) { - LOGE("getContextObject(%s) failed, but we manage the contexts!\n", + ALOGE("getContextObject(%s) failed, but we manage the contexts!\n", String8(name).string()); return NULL; } @@ -160,7 +160,7 @@ bool ProcessState::becomeContextManager(context_check_func checkFunc, void* user } else if (result == -1) { mBinderContextCheckFunc = NULL; mBinderContextUserData = NULL; - LOGE("Binder ioctl to become context manager failed: %s\n", strerror(errno)); + ALOGE("Binder ioctl to become context manager failed: %s\n", strerror(errno)); } } return mManagesContexts; @@ -288,7 +288,7 @@ void ProcessState::spawnPooledThread(bool isMain) int32_t s = android_atomic_add(1, &mThreadPoolSeq); char buf[32]; sprintf(buf, "Binder Thread #%d", s); - LOGV("Spawning new pooled thread, name=%s\n", buf); + ALOGV("Spawning new pooled thread, name=%s\n", buf); sp<Thread> t = new PoolThread(isMain); t->run(buf); } @@ -302,22 +302,22 @@ static int open_driver() int vers; status_t result = ioctl(fd, BINDER_VERSION, &vers); if (result == -1) { - LOGE("Binder ioctl to obtain version failed: %s", strerror(errno)); + ALOGE("Binder ioctl to obtain version failed: %s", strerror(errno)); close(fd); fd = -1; } if (result != 0 || vers != BINDER_CURRENT_PROTOCOL_VERSION) { - LOGE("Binder driver protocol does not match user space protocol!"); + ALOGE("Binder driver protocol does not match user space protocol!"); close(fd); fd = -1; } size_t maxThreads = 15; result = ioctl(fd, BINDER_SET_MAX_THREADS, &maxThreads); if (result == -1) { - LOGE("Binder ioctl to set max threads failed: %s", strerror(errno)); + ALOGE("Binder ioctl to set max threads failed: %s", strerror(errno)); } } else { - LOGW("Opening '/dev/binder' failed: %s\n", strerror(errno)); + ALOGW("Opening '/dev/binder' failed: %s\n", strerror(errno)); } return fd; } @@ -340,7 +340,7 @@ ProcessState::ProcessState() mVMStart = mmap(0, BINDER_VM_SIZE, PROT_READ, MAP_PRIVATE | MAP_NORESERVE, mDriverFD, 0); if (mVMStart == MAP_FAILED) { // *sigh* - LOGE("Using /dev/binder failed: unable to mmap transaction memory.\n"); + ALOGE("Using /dev/binder failed: unable to mmap transaction memory.\n"); close(mDriverFD); mDriverFD = -1; } diff --git a/libs/camera/Camera.cpp b/libs/camera/Camera.cpp index 7ac3cc1..ee458f1 100644 --- a/libs/camera/Camera.cpp +++ b/libs/camera/Camera.cpp @@ -47,7 +47,7 @@ const sp<ICameraService>& Camera::getCameraService() binder = sm->getService(String16("media.camera")); if (binder != 0) break; - LOGW("CameraService not published, waiting..."); + ALOGW("CameraService not published, waiting..."); usleep(500000); // 0.5 s } while(true); if (mDeathNotifier == NULL) { @@ -56,7 +56,7 @@ const sp<ICameraService>& Camera::getCameraService() binder->linkToDeath(mDeathNotifier); mCameraService = interface_cast<ICameraService>(binder); } - LOGE_IF(mCameraService==0, "no CameraService!?"); + ALOGE_IF(mCameraService==0, "no CameraService!?"); return mCameraService; } @@ -70,9 +70,9 @@ Camera::Camera() // construct a camera client from an existing camera remote sp<Camera> Camera::create(const sp<ICamera>& camera) { - LOGV("create"); + ALOGV("create"); if (camera == 0) { - LOGE("camera remote is a NULL pointer"); + ALOGE("camera remote is a NULL pointer"); return 0; } @@ -117,7 +117,7 @@ status_t Camera::getCameraInfo(int cameraId, sp<Camera> Camera::connect(int cameraId) { - LOGV("connect"); + ALOGV("connect"); sp<Camera> c = new Camera(); const sp<ICameraService>& cs = getCameraService(); if (cs != 0) { @@ -134,7 +134,7 @@ sp<Camera> Camera::connect(int cameraId) void Camera::disconnect() { - LOGV("disconnect"); + ALOGV("disconnect"); if (mCamera != 0) { mCamera->disconnect(); mCamera->asBinder()->unlinkToDeath(this); @@ -144,7 +144,7 @@ void Camera::disconnect() status_t Camera::reconnect() { - LOGV("reconnect"); + ALOGV("reconnect"); sp <ICamera> c = mCamera; if (c == 0) return NO_INIT; return c->connect(this); @@ -172,13 +172,13 @@ status_t Camera::unlock() // pass the buffered Surface to the camera service status_t Camera::setPreviewDisplay(const sp<Surface>& surface) { - LOGV("setPreviewDisplay(%p)", surface.get()); + ALOGV("setPreviewDisplay(%p)", surface.get()); sp <ICamera> c = mCamera; if (c == 0) return NO_INIT; if (surface != 0) { return c->setPreviewDisplay(surface); } else { - LOGD("app passed NULL surface"); + ALOGD("app passed NULL surface"); return c->setPreviewDisplay(0); } } @@ -186,13 +186,13 @@ status_t Camera::setPreviewDisplay(const sp<Surface>& surface) // pass the buffered ISurfaceTexture to the camera service status_t Camera::setPreviewTexture(const sp<ISurfaceTexture>& surfaceTexture) { - LOGV("setPreviewTexture(%p)", surfaceTexture.get()); + ALOGV("setPreviewTexture(%p)", surfaceTexture.get()); sp <ICamera> c = mCamera; if (c == 0) return NO_INIT; if (surfaceTexture != 0) { return c->setPreviewTexture(surfaceTexture); } else { - LOGD("app passed NULL surface"); + ALOGD("app passed NULL surface"); return c->setPreviewTexture(0); } } @@ -200,7 +200,7 @@ status_t Camera::setPreviewTexture(const sp<ISurfaceTexture>& surfaceTexture) // start preview mode status_t Camera::startPreview() { - LOGV("startPreview"); + ALOGV("startPreview"); sp <ICamera> c = mCamera; if (c == 0) return NO_INIT; return c->startPreview(); @@ -208,7 +208,7 @@ status_t Camera::startPreview() status_t Camera::storeMetaDataInBuffers(bool enabled) { - LOGV("storeMetaDataInBuffers: %s", + ALOGV("storeMetaDataInBuffers: %s", enabled? "true": "false"); sp <ICamera> c = mCamera; if (c == 0) return NO_INIT; @@ -218,7 +218,7 @@ status_t Camera::storeMetaDataInBuffers(bool enabled) // start recording mode, must call setPreviewDisplay first status_t Camera::startRecording() { - LOGV("startRecording"); + ALOGV("startRecording"); sp <ICamera> c = mCamera; if (c == 0) return NO_INIT; return c->startRecording(); @@ -227,7 +227,7 @@ status_t Camera::startRecording() // stop preview mode void Camera::stopPreview() { - LOGV("stopPreview"); + ALOGV("stopPreview"); sp <ICamera> c = mCamera; if (c == 0) return; c->stopPreview(); @@ -236,7 +236,7 @@ void Camera::stopPreview() // stop recording mode void Camera::stopRecording() { - LOGV("stopRecording"); + ALOGV("stopRecording"); { Mutex::Autolock _l(mLock); mRecordingProxyListener.clear(); @@ -249,7 +249,7 @@ void Camera::stopRecording() // release a recording frame void Camera::releaseRecordingFrame(const sp<IMemory>& mem) { - LOGV("releaseRecordingFrame"); + ALOGV("releaseRecordingFrame"); sp <ICamera> c = mCamera; if (c == 0) return; c->releaseRecordingFrame(mem); @@ -258,7 +258,7 @@ void Camera::releaseRecordingFrame(const sp<IMemory>& mem) // get preview state bool Camera::previewEnabled() { - LOGV("previewEnabled"); + ALOGV("previewEnabled"); sp <ICamera> c = mCamera; if (c == 0) return false; return c->previewEnabled(); @@ -267,7 +267,7 @@ bool Camera::previewEnabled() // get recording state bool Camera::recordingEnabled() { - LOGV("recordingEnabled"); + ALOGV("recordingEnabled"); sp <ICamera> c = mCamera; if (c == 0) return false; return c->recordingEnabled(); @@ -275,7 +275,7 @@ bool Camera::recordingEnabled() status_t Camera::autoFocus() { - LOGV("autoFocus"); + ALOGV("autoFocus"); sp <ICamera> c = mCamera; if (c == 0) return NO_INIT; return c->autoFocus(); @@ -283,7 +283,7 @@ status_t Camera::autoFocus() status_t Camera::cancelAutoFocus() { - LOGV("cancelAutoFocus"); + ALOGV("cancelAutoFocus"); sp <ICamera> c = mCamera; if (c == 0) return NO_INIT; return c->cancelAutoFocus(); @@ -292,7 +292,7 @@ status_t Camera::cancelAutoFocus() // take a picture status_t Camera::takePicture(int msgType) { - LOGV("takePicture: 0x%x", msgType); + ALOGV("takePicture: 0x%x", msgType); sp <ICamera> c = mCamera; if (c == 0) return NO_INIT; return c->takePicture(msgType); @@ -301,7 +301,7 @@ status_t Camera::takePicture(int msgType) // set preview/capture parameters - key/value pairs status_t Camera::setParameters(const String8& params) { - LOGV("setParameters"); + ALOGV("setParameters"); sp <ICamera> c = mCamera; if (c == 0) return NO_INIT; return c->setParameters(params); @@ -310,7 +310,7 @@ status_t Camera::setParameters(const String8& params) // get preview/capture parameters - key/value pairs String8 Camera::getParameters() const { - LOGV("getParameters"); + ALOGV("getParameters"); String8 params; sp <ICamera> c = mCamera; if (c != 0) params = mCamera->getParameters(); @@ -320,7 +320,7 @@ String8 Camera::getParameters() const // send command to camera driver status_t Camera::sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) { - LOGV("sendCommand"); + ALOGV("sendCommand"); sp <ICamera> c = mCamera; if (c == 0) return NO_INIT; return c->sendCommand(cmd, arg1, arg2); @@ -340,7 +340,7 @@ void Camera::setRecordingProxyListener(const sp<ICameraRecordingProxyListener>& void Camera::setPreviewCallbackFlags(int flag) { - LOGV("setPreviewCallbackFlags"); + ALOGV("setPreviewCallbackFlags"); sp <ICamera> c = mCamera; if (c == 0) return; mCamera->setPreviewCallbackFlag(flag); @@ -397,31 +397,31 @@ void Camera::dataCallbackTimestamp(nsecs_t timestamp, int32_t msgType, const sp< if (listener != NULL) { listener->postDataTimestamp(timestamp, msgType, dataPtr); } else { - LOGW("No listener was set. Drop a recording frame."); + ALOGW("No listener was set. Drop a recording frame."); releaseRecordingFrame(dataPtr); } } void Camera::binderDied(const wp<IBinder>& who) { - LOGW("ICamera died"); + ALOGW("ICamera died"); notifyCallback(CAMERA_MSG_ERROR, CAMERA_ERROR_SERVER_DIED, 0); } void Camera::DeathNotifier::binderDied(const wp<IBinder>& who) { - LOGV("binderDied"); + ALOGV("binderDied"); Mutex::Autolock _l(Camera::mLock); Camera::mCameraService.clear(); - LOGW("Camera server died!"); + ALOGW("Camera server died!"); } sp<ICameraRecordingProxy> Camera::getRecordingProxy() { - LOGV("getProxy"); + ALOGV("getProxy"); return new RecordingProxy(this); } status_t Camera::RecordingProxy::startRecording(const sp<ICameraRecordingProxyListener>& listener) { - LOGV("RecordingProxy::startRecording"); + ALOGV("RecordingProxy::startRecording"); mCamera->setRecordingProxyListener(listener); mCamera->reconnect(); return mCamera->startRecording(); @@ -429,13 +429,13 @@ status_t Camera::RecordingProxy::startRecording(const sp<ICameraRecordingProxyLi void Camera::RecordingProxy::stopRecording() { - LOGV("RecordingProxy::stopRecording"); + ALOGV("RecordingProxy::stopRecording"); mCamera->stopRecording(); } void Camera::RecordingProxy::releaseRecordingFrame(const sp<IMemory>& mem) { - LOGV("RecordingProxy::releaseRecordingFrame"); + ALOGV("RecordingProxy::releaseRecordingFrame"); mCamera->releaseRecordingFrame(mem); } diff --git a/libs/camera/CameraParameters.cpp b/libs/camera/CameraParameters.cpp index c6087b4..059a8a5 100644 --- a/libs/camera/CameraParameters.cpp +++ b/libs/camera/CameraParameters.cpp @@ -231,12 +231,12 @@ void CameraParameters::set(const char *key, const char *value) { // XXX i think i can do this with strspn() if (strchr(key, '=') || strchr(key, ';')) { - //XXX LOGE("Key \"%s\"contains invalid character (= or ;)", key); + //XXX ALOGE("Key \"%s\"contains invalid character (= or ;)", key); return; } if (strchr(value, '=') || strchr(key, ';')) { - //XXX LOGE("Value \"%s\"contains invalid character (= or ;)", value); + //XXX ALOGE("Value \"%s\"contains invalid character (= or ;)", value); return; } @@ -294,7 +294,7 @@ static int parse_pair(const char *str, int *first, int *second, char delim, int w = (int)strtol(str, &end, 10); // If a delimeter does not immediately follow, give up. if (*end != delim) { - LOGE("Cannot find delimeter (%c) in str=%s", delim, str); + ALOGE("Cannot find delimeter (%c) in str=%s", delim, str); return -1; } @@ -324,7 +324,7 @@ static void parseSizesList(const char *sizesStr, Vector<Size> &sizes) int success = parse_pair(sizeStartPtr, &width, &height, 'x', &sizeStartPtr); if (success == -1 || (*sizeStartPtr != ',' && *sizeStartPtr != '\0')) { - LOGE("Picture sizes string \"%s\" contains invalid character.", sizesStr); + ALOGE("Picture sizes string \"%s\" contains invalid character.", sizesStr); return; } sizes.push(Size(width, height)); @@ -449,12 +449,12 @@ const char *CameraParameters::getPictureFormat() const void CameraParameters::dump() const { - LOGD("dump: mMap.size = %d", mMap.size()); + ALOGD("dump: mMap.size = %d", mMap.size()); for (size_t i = 0; i < mMap.size(); i++) { String8 k, v; k = mMap.keyAt(i); v = mMap.valueAt(i); - LOGD("%s: %s\n", k.string(), v.string()); + ALOGD("%s: %s\n", k.string(), v.string()); } } diff --git a/libs/camera/ICamera.cpp b/libs/camera/ICamera.cpp index 5f6e5ef..70f5dbc 100644 --- a/libs/camera/ICamera.cpp +++ b/libs/camera/ICamera.cpp @@ -60,7 +60,7 @@ public: // disconnect from camera service void disconnect() { - LOGV("disconnect"); + ALOGV("disconnect"); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); remote()->transact(DISCONNECT, data, &reply); @@ -69,7 +69,7 @@ public: // pass the buffered Surface to the camera service status_t setPreviewDisplay(const sp<Surface>& surface) { - LOGV("setPreviewDisplay"); + ALOGV("setPreviewDisplay"); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); Surface::writeToParcel(surface, &data); @@ -80,7 +80,7 @@ public: // pass the buffered SurfaceTexture to the camera service status_t setPreviewTexture(const sp<ISurfaceTexture>& surfaceTexture) { - LOGV("setPreviewTexture"); + ALOGV("setPreviewTexture"); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); sp<IBinder> b(surfaceTexture->asBinder()); @@ -93,7 +93,7 @@ public: // preview are handled. See Camera.h for details. void setPreviewCallbackFlag(int flag) { - LOGV("setPreviewCallbackFlag(%d)", flag); + ALOGV("setPreviewCallbackFlag(%d)", flag); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); data.writeInt32(flag); @@ -103,7 +103,7 @@ public: // start preview mode, must call setPreviewDisplay first status_t startPreview() { - LOGV("startPreview"); + ALOGV("startPreview"); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); remote()->transact(START_PREVIEW, data, &reply); @@ -113,7 +113,7 @@ public: // start recording mode, must call setPreviewDisplay first status_t startRecording() { - LOGV("startRecording"); + ALOGV("startRecording"); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); remote()->transact(START_RECORDING, data, &reply); @@ -123,7 +123,7 @@ public: // stop preview mode void stopPreview() { - LOGV("stopPreview"); + ALOGV("stopPreview"); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); remote()->transact(STOP_PREVIEW, data, &reply); @@ -132,7 +132,7 @@ public: // stop recording mode void stopRecording() { - LOGV("stopRecording"); + ALOGV("stopRecording"); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); remote()->transact(STOP_RECORDING, data, &reply); @@ -140,7 +140,7 @@ public: void releaseRecordingFrame(const sp<IMemory>& mem) { - LOGV("releaseRecordingFrame"); + ALOGV("releaseRecordingFrame"); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); data.writeStrongBinder(mem->asBinder()); @@ -149,7 +149,7 @@ public: status_t storeMetaDataInBuffers(bool enabled) { - LOGV("storeMetaDataInBuffers: %s", enabled? "true": "false"); + ALOGV("storeMetaDataInBuffers: %s", enabled? "true": "false"); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); data.writeInt32(enabled); @@ -160,7 +160,7 @@ public: // check preview state bool previewEnabled() { - LOGV("previewEnabled"); + ALOGV("previewEnabled"); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); remote()->transact(PREVIEW_ENABLED, data, &reply); @@ -170,7 +170,7 @@ public: // check recording state bool recordingEnabled() { - LOGV("recordingEnabled"); + ALOGV("recordingEnabled"); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); remote()->transact(RECORDING_ENABLED, data, &reply); @@ -180,7 +180,7 @@ public: // auto focus status_t autoFocus() { - LOGV("autoFocus"); + ALOGV("autoFocus"); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); remote()->transact(AUTO_FOCUS, data, &reply); @@ -191,7 +191,7 @@ public: // cancel focus status_t cancelAutoFocus() { - LOGV("cancelAutoFocus"); + ALOGV("cancelAutoFocus"); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); remote()->transact(CANCEL_AUTO_FOCUS, data, &reply); @@ -202,7 +202,7 @@ public: // take a picture - returns an IMemory (ref-counted mmap) status_t takePicture(int msgType) { - LOGV("takePicture: 0x%x", msgType); + ALOGV("takePicture: 0x%x", msgType); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); data.writeInt32(msgType); @@ -214,7 +214,7 @@ public: // set preview/capture parameters - key/value pairs status_t setParameters(const String8& params) { - LOGV("setParameters"); + ALOGV("setParameters"); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); data.writeString8(params); @@ -225,7 +225,7 @@ public: // get preview/capture parameters - key/value pairs String8 getParameters() const { - LOGV("getParameters"); + ALOGV("getParameters"); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); remote()->transact(GET_PARAMETERS, data, &reply); @@ -233,7 +233,7 @@ public: } virtual status_t sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) { - LOGV("sendCommand"); + ALOGV("sendCommand"); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); data.writeInt32(cmd); @@ -275,116 +275,116 @@ status_t BnCamera::onTransact( { switch(code) { case DISCONNECT: { - LOGV("DISCONNECT"); + ALOGV("DISCONNECT"); CHECK_INTERFACE(ICamera, data, reply); disconnect(); return NO_ERROR; } break; case SET_PREVIEW_DISPLAY: { - LOGV("SET_PREVIEW_DISPLAY"); + ALOGV("SET_PREVIEW_DISPLAY"); CHECK_INTERFACE(ICamera, data, reply); sp<Surface> surface = Surface::readFromParcel(data); reply->writeInt32(setPreviewDisplay(surface)); return NO_ERROR; } break; case SET_PREVIEW_TEXTURE: { - LOGV("SET_PREVIEW_TEXTURE"); + ALOGV("SET_PREVIEW_TEXTURE"); CHECK_INTERFACE(ICamera, data, reply); sp<ISurfaceTexture> st = interface_cast<ISurfaceTexture>(data.readStrongBinder()); reply->writeInt32(setPreviewTexture(st)); return NO_ERROR; } break; case SET_PREVIEW_CALLBACK_FLAG: { - LOGV("SET_PREVIEW_CALLBACK_TYPE"); + ALOGV("SET_PREVIEW_CALLBACK_TYPE"); CHECK_INTERFACE(ICamera, data, reply); int callback_flag = data.readInt32(); setPreviewCallbackFlag(callback_flag); return NO_ERROR; } break; case START_PREVIEW: { - LOGV("START_PREVIEW"); + ALOGV("START_PREVIEW"); CHECK_INTERFACE(ICamera, data, reply); reply->writeInt32(startPreview()); return NO_ERROR; } break; case START_RECORDING: { - LOGV("START_RECORDING"); + ALOGV("START_RECORDING"); CHECK_INTERFACE(ICamera, data, reply); reply->writeInt32(startRecording()); return NO_ERROR; } break; case STOP_PREVIEW: { - LOGV("STOP_PREVIEW"); + ALOGV("STOP_PREVIEW"); CHECK_INTERFACE(ICamera, data, reply); stopPreview(); return NO_ERROR; } break; case STOP_RECORDING: { - LOGV("STOP_RECORDING"); + ALOGV("STOP_RECORDING"); CHECK_INTERFACE(ICamera, data, reply); stopRecording(); return NO_ERROR; } break; case RELEASE_RECORDING_FRAME: { - LOGV("RELEASE_RECORDING_FRAME"); + ALOGV("RELEASE_RECORDING_FRAME"); CHECK_INTERFACE(ICamera, data, reply); sp<IMemory> mem = interface_cast<IMemory>(data.readStrongBinder()); releaseRecordingFrame(mem); return NO_ERROR; } break; case STORE_META_DATA_IN_BUFFERS: { - LOGV("STORE_META_DATA_IN_BUFFERS"); + ALOGV("STORE_META_DATA_IN_BUFFERS"); CHECK_INTERFACE(ICamera, data, reply); bool enabled = data.readInt32(); reply->writeInt32(storeMetaDataInBuffers(enabled)); return NO_ERROR; } break; case PREVIEW_ENABLED: { - LOGV("PREVIEW_ENABLED"); + ALOGV("PREVIEW_ENABLED"); CHECK_INTERFACE(ICamera, data, reply); reply->writeInt32(previewEnabled()); return NO_ERROR; } break; case RECORDING_ENABLED: { - LOGV("RECORDING_ENABLED"); + ALOGV("RECORDING_ENABLED"); CHECK_INTERFACE(ICamera, data, reply); reply->writeInt32(recordingEnabled()); return NO_ERROR; } break; case AUTO_FOCUS: { - LOGV("AUTO_FOCUS"); + ALOGV("AUTO_FOCUS"); CHECK_INTERFACE(ICamera, data, reply); reply->writeInt32(autoFocus()); return NO_ERROR; } break; case CANCEL_AUTO_FOCUS: { - LOGV("CANCEL_AUTO_FOCUS"); + ALOGV("CANCEL_AUTO_FOCUS"); CHECK_INTERFACE(ICamera, data, reply); reply->writeInt32(cancelAutoFocus()); return NO_ERROR; } break; case TAKE_PICTURE: { - LOGV("TAKE_PICTURE"); + ALOGV("TAKE_PICTURE"); CHECK_INTERFACE(ICamera, data, reply); int msgType = data.readInt32(); reply->writeInt32(takePicture(msgType)); return NO_ERROR; } break; case SET_PARAMETERS: { - LOGV("SET_PARAMETERS"); + ALOGV("SET_PARAMETERS"); CHECK_INTERFACE(ICamera, data, reply); String8 params(data.readString8()); reply->writeInt32(setParameters(params)); return NO_ERROR; } break; case GET_PARAMETERS: { - LOGV("GET_PARAMETERS"); + ALOGV("GET_PARAMETERS"); CHECK_INTERFACE(ICamera, data, reply); reply->writeString8(getParameters()); return NO_ERROR; } break; case SEND_COMMAND: { - LOGV("SEND_COMMAND"); + ALOGV("SEND_COMMAND"); CHECK_INTERFACE(ICamera, data, reply); int command = data.readInt32(); int arg1 = data.readInt32(); diff --git a/libs/camera/ICameraClient.cpp b/libs/camera/ICameraClient.cpp index 183429a..205c8ba 100644 --- a/libs/camera/ICameraClient.cpp +++ b/libs/camera/ICameraClient.cpp @@ -41,7 +41,7 @@ public: // generic callback from camera service to app void notifyCallback(int32_t msgType, int32_t ext1, int32_t ext2) { - LOGV("notifyCallback"); + ALOGV("notifyCallback"); Parcel data, reply; data.writeInterfaceToken(ICameraClient::getInterfaceDescriptor()); data.writeInt32(msgType); @@ -54,7 +54,7 @@ public: void dataCallback(int32_t msgType, const sp<IMemory>& imageData, camera_frame_metadata_t *metadata) { - LOGV("dataCallback"); + ALOGV("dataCallback"); Parcel data, reply; data.writeInterfaceToken(ICameraClient::getInterfaceDescriptor()); data.writeInt32(msgType); @@ -69,7 +69,7 @@ public: // generic data callback from camera service to app with image data void dataCallbackTimestamp(nsecs_t timestamp, int32_t msgType, const sp<IMemory>& imageData) { - LOGV("dataCallback"); + ALOGV("dataCallback"); Parcel data, reply; data.writeInterfaceToken(ICameraClient::getInterfaceDescriptor()); data.writeInt64(timestamp); @@ -88,7 +88,7 @@ status_t BnCameraClient::onTransact( { switch(code) { case NOTIFY_CALLBACK: { - LOGV("NOTIFY_CALLBACK"); + ALOGV("NOTIFY_CALLBACK"); CHECK_INTERFACE(ICameraClient, data, reply); int32_t msgType = data.readInt32(); int32_t ext1 = data.readInt32(); @@ -97,7 +97,7 @@ status_t BnCameraClient::onTransact( return NO_ERROR; } break; case DATA_CALLBACK: { - LOGV("DATA_CALLBACK"); + ALOGV("DATA_CALLBACK"); CHECK_INTERFACE(ICameraClient, data, reply); int32_t msgType = data.readInt32(); sp<IMemory> imageData = interface_cast<IMemory>(data.readStrongBinder()); @@ -113,7 +113,7 @@ status_t BnCameraClient::onTransact( return NO_ERROR; } break; case DATA_CALLBACK_TIMESTAMP: { - LOGV("DATA_CALLBACK_TIMESTAMP"); + ALOGV("DATA_CALLBACK_TIMESTAMP"); CHECK_INTERFACE(ICameraClient, data, reply); nsecs_t timestamp = data.readInt64(); int32_t msgType = data.readInt32(); diff --git a/libs/camera/ICameraRecordingProxy.cpp b/libs/camera/ICameraRecordingProxy.cpp index 64b6a5c..7223b6d 100644 --- a/libs/camera/ICameraRecordingProxy.cpp +++ b/libs/camera/ICameraRecordingProxy.cpp @@ -42,7 +42,7 @@ public: status_t startRecording(const sp<ICameraRecordingProxyListener>& listener) { - LOGV("startRecording"); + ALOGV("startRecording"); Parcel data, reply; data.writeInterfaceToken(ICameraRecordingProxy::getInterfaceDescriptor()); data.writeStrongBinder(listener->asBinder()); @@ -52,7 +52,7 @@ public: void stopRecording() { - LOGV("stopRecording"); + ALOGV("stopRecording"); Parcel data, reply; data.writeInterfaceToken(ICameraRecordingProxy::getInterfaceDescriptor()); remote()->transact(STOP_RECORDING, data, &reply); @@ -60,7 +60,7 @@ public: void releaseRecordingFrame(const sp<IMemory>& mem) { - LOGV("releaseRecordingFrame"); + ALOGV("releaseRecordingFrame"); Parcel data, reply; data.writeInterfaceToken(ICameraRecordingProxy::getInterfaceDescriptor()); data.writeStrongBinder(mem->asBinder()); @@ -77,7 +77,7 @@ status_t BnCameraRecordingProxy::onTransact( { switch(code) { case START_RECORDING: { - LOGV("START_RECORDING"); + ALOGV("START_RECORDING"); CHECK_INTERFACE(ICameraRecordingProxy, data, reply); sp<ICameraRecordingProxyListener> listener = interface_cast<ICameraRecordingProxyListener>(data.readStrongBinder()); @@ -85,13 +85,13 @@ status_t BnCameraRecordingProxy::onTransact( return NO_ERROR; } break; case STOP_RECORDING: { - LOGV("STOP_RECORDING"); + ALOGV("STOP_RECORDING"); CHECK_INTERFACE(ICameraRecordingProxy, data, reply); stopRecording(); return NO_ERROR; } break; case RELEASE_RECORDING_FRAME: { - LOGV("RELEASE_RECORDING_FRAME"); + ALOGV("RELEASE_RECORDING_FRAME"); CHECK_INTERFACE(ICameraRecordingProxy, data, reply); sp<IMemory> mem = interface_cast<IMemory>(data.readStrongBinder()); releaseRecordingFrame(mem); diff --git a/libs/camera/ICameraRecordingProxyListener.cpp b/libs/camera/ICameraRecordingProxyListener.cpp index f8cece5..cb17f19 100644 --- a/libs/camera/ICameraRecordingProxyListener.cpp +++ b/libs/camera/ICameraRecordingProxyListener.cpp @@ -37,7 +37,7 @@ public: void dataCallbackTimestamp(nsecs_t timestamp, int32_t msgType, const sp<IMemory>& imageData) { - LOGV("dataCallback"); + ALOGV("dataCallback"); Parcel data, reply; data.writeInterfaceToken(ICameraRecordingProxyListener::getInterfaceDescriptor()); data.writeInt64(timestamp); @@ -56,7 +56,7 @@ status_t BnCameraRecordingProxyListener::onTransact( { switch(code) { case DATA_CALLBACK_TIMESTAMP: { - LOGV("DATA_CALLBACK_TIMESTAMP"); + ALOGV("DATA_CALLBACK_TIMESTAMP"); CHECK_INTERFACE(ICameraRecordingProxyListener, data, reply); nsecs_t timestamp = data.readInt64(); int32_t msgType = data.readInt32(); diff --git a/libs/cpustats/ThreadCpuUsage.cpp b/libs/cpustats/ThreadCpuUsage.cpp index 4bfbdf3..ffee039 100644 --- a/libs/cpustats/ThreadCpuUsage.cpp +++ b/libs/cpustats/ThreadCpuUsage.cpp @@ -31,7 +31,7 @@ bool ThreadCpuUsage::setEnabled(bool isEnabled) if (isEnabled) { rc = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &mPreviousTs); if (rc) { - LOGE("clock_gettime(CLOCK_THREAD_CPUTIME_ID) errno=%d", errno); + ALOGE("clock_gettime(CLOCK_THREAD_CPUTIME_ID) errno=%d", errno); isEnabled = false; } else { mWasEverEnabled = true; @@ -39,7 +39,7 @@ bool ThreadCpuUsage::setEnabled(bool isEnabled) if (!mMonotonicKnown) { rc = clock_gettime(CLOCK_MONOTONIC, &mMonotonicTs); if (rc) { - LOGE("clock_gettime(CLOCK_MONOTONIC) errno=%d", errno); + ALOGE("clock_gettime(CLOCK_MONOTONIC) errno=%d", errno); } else { mMonotonicKnown = true; } @@ -50,7 +50,7 @@ bool ThreadCpuUsage::setEnabled(bool isEnabled) struct timespec ts; rc = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts); if (rc) { - LOGE("clock_gettime(CLOCK_THREAD_CPUTIME_ID) errno=%d", errno); + ALOGE("clock_gettime(CLOCK_THREAD_CPUTIME_ID) errno=%d", errno); } else { long long delta = (ts.tv_sec - mPreviousTs.tv_sec) * 1000000000LL + (ts.tv_nsec - mPreviousTs.tv_nsec); @@ -86,7 +86,7 @@ void ThreadCpuUsage::sample() int rc; rc = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts); if (rc) { - LOGE("clock_gettime(CLOCK_THREAD_CPUTIME_ID) errno=%d", errno); + ALOGE("clock_gettime(CLOCK_THREAD_CPUTIME_ID) errno=%d", errno); } else { long long delta = (ts.tv_sec - mPreviousTs.tv_sec) * 1000000000LL + (ts.tv_nsec - mPreviousTs.tv_nsec); @@ -99,7 +99,7 @@ void ThreadCpuUsage::sample() mStatistics.sample((double) mAccumulator); mAccumulator = 0; } else { - LOGW("Can't add sample because measurements have never been enabled"); + ALOGW("Can't add sample because measurements have never been enabled"); } } @@ -111,7 +111,7 @@ long long ThreadCpuUsage::elapsed() const int rc; rc = clock_gettime(CLOCK_MONOTONIC, &ts); if (rc) { - LOGE("clock_gettime(CLOCK_MONOTONIC) errno=%d", errno); + ALOGE("clock_gettime(CLOCK_MONOTONIC) errno=%d", errno); elapsed = 0; } else { // mMonotonicTs is updated only at first enable and resetStatistics @@ -119,7 +119,7 @@ long long ThreadCpuUsage::elapsed() const (ts.tv_nsec - mMonotonicTs.tv_nsec); } } else { - LOGW("Can't compute elapsed time because measurements have never been enabled"); + ALOGW("Can't compute elapsed time because measurements have never been enabled"); elapsed = 0; } return elapsed; @@ -132,7 +132,7 @@ void ThreadCpuUsage::resetStatistics() int rc; rc = clock_gettime(CLOCK_MONOTONIC, &mMonotonicTs); if (rc) { - LOGE("clock_gettime(CLOCK_MONOTONIC) errno=%d", errno); + ALOGE("clock_gettime(CLOCK_MONOTONIC) errno=%d", errno); mMonotonicKnown = false; } } diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp index 86bc62a..b1b9adb 100644 --- a/libs/gui/ISurfaceComposer.cpp +++ b/libs/gui/ISurfaceComposer.cpp @@ -148,27 +148,27 @@ public: err = data.writeInterfaceToken( ISurfaceComposer::getInterfaceDescriptor()); if (err != NO_ERROR) { - LOGE("ISurfaceComposer::authenticateSurfaceTexture: error writing " + ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error writing " "interface descriptor: %s (%d)", strerror(-err), -err); return false; } err = data.writeStrongBinder(surfaceTexture->asBinder()); if (err != NO_ERROR) { - LOGE("ISurfaceComposer::authenticateSurfaceTexture: error writing " + ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error writing " "strong binder to parcel: %s (%d)", strerror(-err), -err); return false; } err = remote()->transact(BnSurfaceComposer::AUTHENTICATE_SURFACE, data, &reply); if (err != NO_ERROR) { - LOGE("ISurfaceComposer::authenticateSurfaceTexture: error " + ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error " "performing transaction: %s (%d)", strerror(-err), -err); return false; } int32_t result = 0; err = reply.readInt32(&result); if (err != NO_ERROR) { - LOGE("ISurfaceComposer::authenticateSurfaceTexture: error " + ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error " "retrieving result: %s (%d)", strerror(-err), -err); return false; } diff --git a/libs/gui/SensorEventQueue.cpp b/libs/gui/SensorEventQueue.cpp index f935524..ac362fc 100644 --- a/libs/gui/SensorEventQueue.cpp +++ b/libs/gui/SensorEventQueue.cpp @@ -70,12 +70,12 @@ ssize_t SensorEventQueue::write(ASensorEvent const* events, size_t numEvents) ssize_t SensorEventQueue::read(ASensorEvent* events, size_t numEvents) { ssize_t size = mSensorChannel->read(events, numEvents*sizeof(events[0])); - LOGE_IF(size<0 && size!=-EAGAIN, + ALOGE_IF(size<0 && size!=-EAGAIN, "SensorChannel::read error (%s)", strerror(-size)); if (size >= 0) { if (size % sizeof(events[0])) { // partial read!!! should never happen. - LOGE("SensorEventQueue partial read (event-size=%u, read=%d)", + ALOGE("SensorEventQueue partial read (event-size=%u, read=%d)", sizeof(events[0]), int(size)); return -EINVAL; } @@ -104,7 +104,7 @@ status_t SensorEventQueue::waitForEvent() const do { result = looper->pollOnce(-1); if (result == ALOOPER_EVENT_ERROR) { - LOGE("SensorChannel::waitForEvent error (errno=%d)", errno); + ALOGE("SensorChannel::waitForEvent error (errno=%d)", errno); result = -EPIPE; // unknown error, so we make up one break; } diff --git a/libs/gui/SensorManager.cpp b/libs/gui/SensorManager.cpp index dafcdea..b80da56 100644 --- a/libs/gui/SensorManager.cpp +++ b/libs/gui/SensorManager.cpp @@ -78,7 +78,7 @@ status_t SensorManager::assertStateLocked() const { class DeathObserver : public IBinder::DeathRecipient { SensorManager& mSensorManger; virtual void binderDied(const wp<IBinder>& who) { - LOGW("sensorservice died [%p]", who.unsafe_get()); + ALOGW("sensorservice died [%p]", who.unsafe_get()); mSensorManger.sensorManagerDied(); } public: @@ -137,7 +137,7 @@ sp<SensorEventQueue> SensorManager::createEventQueue() mSensorServer->createSensorEventConnection(); if (connection == NULL) { // SensorService just died. - LOGE("createEventQueue: connection is NULL. SensorService died."); + ALOGE("createEventQueue: connection is NULL. SensorService died."); continue; } queue = new SensorEventQueue(connection); diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index ff45fa3..337950c 100644 --- a/libs/gui/Surface.cpp +++ b/libs/gui/Surface.cpp @@ -167,7 +167,7 @@ status_t SurfaceControl::setFreezeTint(uint32_t tint) { status_t SurfaceControl::validate() const { if (mToken<0 || mClient==0) { - LOGE("invalid token (%d, identity=%u) or client (%p)", + ALOGE("invalid token (%d, identity=%u) or client (%p)", mToken, mIdentity, mClient.get()); return NO_INIT; } @@ -254,7 +254,7 @@ status_t Surface::writeToParcel( } else if (surface != 0 && (surface->mSurface != NULL || surface->getISurfaceTexture() != NULL)) { - LOGE("Parceling invalid surface with non-NULL ISurface/ISurfaceTexture as NULL: " + ALOGE("Parceling invalid surface with non-NULL ISurface/ISurfaceTexture as NULL: " "mSurface = %p, surfaceTexture = %p, mIdentity = %d, ", surface->mSurface.get(), surface->getISurfaceTexture().get(), surface->mIdentity); @@ -304,7 +304,7 @@ void Surface::cleanCachedSurfacesLocked() { void Surface::init(const sp<ISurfaceTexture>& surfaceTexture) { if (mSurface != NULL || surfaceTexture != NULL) { - LOGE_IF(surfaceTexture==0, "got a NULL ISurfaceTexture from ISurface"); + ALOGE_IF(surfaceTexture==0, "got a NULL ISurfaceTexture from ISurface"); if (surfaceTexture != NULL) { setISurfaceTexture(surfaceTexture); setUsage(GraphicBuffer::USAGE_HW_RENDER); diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp index 4772189..c80d93d 100644 --- a/libs/gui/SurfaceTexture.cpp +++ b/libs/gui/SurfaceTexture.cpp @@ -60,11 +60,11 @@ #endif // Macros for including the SurfaceTexture name in log messages -#define ST_LOGV(x, ...) LOGV("[%s] "x, mName.string(), ##__VA_ARGS__) -#define ST_LOGD(x, ...) LOGD("[%s] "x, mName.string(), ##__VA_ARGS__) -#define ST_LOGI(x, ...) LOGI("[%s] "x, mName.string(), ##__VA_ARGS__) -#define ST_LOGW(x, ...) LOGW("[%s] "x, mName.string(), ##__VA_ARGS__) -#define ST_LOGE(x, ...) LOGE("[%s] "x, mName.string(), ##__VA_ARGS__) +#define ST_LOGV(x, ...) ALOGV("[%s] "x, mName.string(), ##__VA_ARGS__) +#define ST_LOGD(x, ...) ALOGD("[%s] "x, mName.string(), ##__VA_ARGS__) +#define ST_LOGI(x, ...) ALOGI("[%s] "x, mName.string(), ##__VA_ARGS__) +#define ST_LOGW(x, ...) ALOGW("[%s] "x, mName.string(), ##__VA_ARGS__) +#define ST_LOGE(x, ...) ALOGE("[%s] "x, mName.string(), ##__VA_ARGS__) namespace android { @@ -350,7 +350,7 @@ status_t SurfaceTexture::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h, } // if buffer is FREE it CANNOT be current - LOGW_IF((state == BufferSlot::FREE) && (mCurrentTexture==i), + ALOGW_IF((state == BufferSlot::FREE) && (mCurrentTexture==i), "dequeueBuffer: buffer %d is both FREE and current!", i); @@ -491,9 +491,9 @@ status_t SurfaceTexture::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h, // synchronizing access to it. It's too late at this point to abort the // dequeue operation. if (result == EGL_FALSE) { - LOGE("dequeueBuffer: error waiting for fence: %#x", eglGetError()); + ALOGE("dequeueBuffer: error waiting for fence: %#x", eglGetError()); } else if (result == EGL_TIMEOUT_EXPIRED_KHR) { - LOGE("dequeueBuffer: timeout waiting for fence"); + ALOGE("dequeueBuffer: timeout waiting for fence"); } eglDestroySyncKHR(dpy, fence); } @@ -802,7 +802,7 @@ status_t SurfaceTexture::updateTexImage() { EGLSyncKHR fence = eglCreateSyncKHR(dpy, EGL_SYNC_FENCE_KHR, NULL); if (fence == EGL_NO_SYNC_KHR) { - LOGE("updateTexImage: error creating fence: %#x", + ALOGE("updateTexImage: error creating fence: %#x", eglGetError()); return -EINVAL; } @@ -990,7 +990,7 @@ void SurfaceTexture::freeBufferLocked(int i) { } void SurfaceTexture::freeAllBuffersLocked() { - LOGW_IF(!mQueue.isEmpty(), + ALOGW_IF(!mQueue.isEmpty(), "freeAllBuffersLocked called but mQueue is not empty"); mCurrentTexture = INVALID_BUFFER_SLOT; for (int i = 0; i < NUM_BUFFER_SLOTS; i++) { @@ -999,7 +999,7 @@ void SurfaceTexture::freeAllBuffersLocked() { } void SurfaceTexture::freeAllBuffersExceptHeadLocked() { - LOGW_IF(!mQueue.isEmpty(), + ALOGW_IF(!mQueue.isEmpty(), "freeAllBuffersExceptCurrentLocked called but mQueue is not empty"); int head = -1; if (!mQueue.empty()) { diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp index 48070d6..5f01ae9 100644 --- a/libs/gui/SurfaceTextureClient.cpp +++ b/libs/gui/SurfaceTextureClient.cpp @@ -136,13 +136,13 @@ int SurfaceTextureClient::setSwapInterval(int interval) { } int SurfaceTextureClient::dequeueBuffer(android_native_buffer_t** buffer) { - LOGV("SurfaceTextureClient::dequeueBuffer"); + ALOGV("SurfaceTextureClient::dequeueBuffer"); Mutex::Autolock lock(mMutex); int buf = -1; status_t result = mSurfaceTexture->dequeueBuffer(&buf, mReqWidth, mReqHeight, mReqFormat, mReqUsage); if (result < 0) { - LOGV("dequeueBuffer: ISurfaceTexture::dequeueBuffer(%d, %d, %d, %d)" + ALOGV("dequeueBuffer: ISurfaceTexture::dequeueBuffer(%d, %d, %d, %d)" "failed: %d", mReqWidth, mReqHeight, mReqFormat, mReqUsage, result); return result; @@ -155,7 +155,7 @@ int SurfaceTextureClient::dequeueBuffer(android_native_buffer_t** buffer) { if ((result & ISurfaceTexture::BUFFER_NEEDS_REALLOCATION) || gbuf == 0) { result = mSurfaceTexture->requestBuffer(buf, &gbuf); if (result != NO_ERROR) { - LOGE("dequeueBuffer: ISurfaceTexture::requestBuffer failed: %d", + ALOGE("dequeueBuffer: ISurfaceTexture::requestBuffer failed: %d", result); return result; } @@ -165,7 +165,7 @@ int SurfaceTextureClient::dequeueBuffer(android_native_buffer_t** buffer) { } int SurfaceTextureClient::cancelBuffer(android_native_buffer_t* buffer) { - LOGV("SurfaceTextureClient::cancelBuffer"); + ALOGV("SurfaceTextureClient::cancelBuffer"); Mutex::Autolock lock(mMutex); int i = getSlotFromBufferLocked(buffer); if (i < 0) { @@ -183,13 +183,13 @@ int SurfaceTextureClient::getSlotFromBufferLocked( // a buffer. if (mSlots[i] == NULL) { if (!dumpedState) { - LOGD("getSlotFromBufferLocked: encountered NULL buffer in slot %d " + ALOGD("getSlotFromBufferLocked: encountered NULL buffer in slot %d " "looking for buffer %p", i, buffer->handle); for (int j = 0; j < NUM_BUFFER_SLOTS; j++) { if (mSlots[j] == NULL) { - LOGD("getSlotFromBufferLocked: %02d: NULL", j); + ALOGD("getSlotFromBufferLocked: %02d: NULL", j); } else { - LOGD("getSlotFromBufferLocked: %02d: %p", j, mSlots[j]->handle); + ALOGD("getSlotFromBufferLocked: %02d: %p", j, mSlots[j]->handle); } } dumpedState = true; @@ -200,23 +200,23 @@ int SurfaceTextureClient::getSlotFromBufferLocked( return i; } } - LOGE("getSlotFromBufferLocked: unknown buffer: %p", buffer->handle); + ALOGE("getSlotFromBufferLocked: unknown buffer: %p", buffer->handle); return BAD_VALUE; } int SurfaceTextureClient::lockBuffer(android_native_buffer_t* buffer) { - LOGV("SurfaceTextureClient::lockBuffer"); + ALOGV("SurfaceTextureClient::lockBuffer"); Mutex::Autolock lock(mMutex); return OK; } int SurfaceTextureClient::queueBuffer(android_native_buffer_t* buffer) { - LOGV("SurfaceTextureClient::queueBuffer"); + ALOGV("SurfaceTextureClient::queueBuffer"); Mutex::Autolock lock(mMutex); int64_t timestamp; if (mTimestamp == NATIVE_WINDOW_TIMESTAMP_AUTO) { timestamp = systemTime(SYSTEM_TIME_MONOTONIC); - LOGV("SurfaceTextureClient::queueBuffer making up timestamp: %.2f ms", + ALOGV("SurfaceTextureClient::queueBuffer making up timestamp: %.2f ms", timestamp / 1000000.f); } else { timestamp = mTimestamp; @@ -228,13 +228,13 @@ int SurfaceTextureClient::queueBuffer(android_native_buffer_t* buffer) { status_t err = mSurfaceTexture->queueBuffer(i, timestamp, &mDefaultWidth, &mDefaultHeight, &mTransformHint); if (err != OK) { - LOGE("queueBuffer: error queuing buffer to SurfaceTexture, %d", err); + ALOGE("queueBuffer: error queuing buffer to SurfaceTexture, %d", err); } return err; } int SurfaceTextureClient::query(int what, int* value) const { - LOGV("SurfaceTextureClient::query"); + ALOGV("SurfaceTextureClient::query"); { // scope for the lock Mutex::Autolock lock(mMutex); switch (what) { @@ -402,7 +402,7 @@ int SurfaceTextureClient::dispatchUnlockAndPost(va_list args) { int SurfaceTextureClient::connect(int api) { - LOGV("SurfaceTextureClient::connect"); + ALOGV("SurfaceTextureClient::connect"); Mutex::Autolock lock(mMutex); int err = mSurfaceTexture->connect(api, &mDefaultWidth, &mDefaultHeight, &mTransformHint); @@ -413,7 +413,7 @@ int SurfaceTextureClient::connect(int api) { } int SurfaceTextureClient::disconnect(int api) { - LOGV("SurfaceTextureClient::disconnect"); + ALOGV("SurfaceTextureClient::disconnect"); Mutex::Autolock lock(mMutex); freeAllBuffers(); int err = mSurfaceTexture->disconnect(api); @@ -431,7 +431,7 @@ int SurfaceTextureClient::disconnect(int api) { int SurfaceTextureClient::setUsage(uint32_t reqUsage) { - LOGV("SurfaceTextureClient::setUsage"); + ALOGV("SurfaceTextureClient::setUsage"); Mutex::Autolock lock(mMutex); mReqUsage = reqUsage; return OK; @@ -439,7 +439,7 @@ int SurfaceTextureClient::setUsage(uint32_t reqUsage) int SurfaceTextureClient::setCrop(Rect const* rect) { - LOGV("SurfaceTextureClient::setCrop"); + ALOGV("SurfaceTextureClient::setCrop"); Mutex::Autolock lock(mMutex); Rect realRect; @@ -450,18 +450,18 @@ int SurfaceTextureClient::setCrop(Rect const* rect) } status_t err = mSurfaceTexture->setCrop(*rect); - LOGE_IF(err, "ISurfaceTexture::setCrop(...) returned %s", strerror(-err)); + ALOGE_IF(err, "ISurfaceTexture::setCrop(...) returned %s", strerror(-err)); return err; } int SurfaceTextureClient::setBufferCount(int bufferCount) { - LOGV("SurfaceTextureClient::setBufferCount"); + ALOGV("SurfaceTextureClient::setBufferCount"); Mutex::Autolock lock(mMutex); status_t err = mSurfaceTexture->setBufferCount(bufferCount); - LOGE_IF(err, "ISurfaceTexture::setBufferCount(%d) returned %s", + ALOGE_IF(err, "ISurfaceTexture::setBufferCount(%d) returned %s", bufferCount, strerror(-err)); if (err == NO_ERROR) { @@ -473,7 +473,7 @@ int SurfaceTextureClient::setBufferCount(int bufferCount) int SurfaceTextureClient::setBuffersDimensions(int w, int h) { - LOGV("SurfaceTextureClient::setBuffersDimensions"); + ALOGV("SurfaceTextureClient::setBuffersDimensions"); Mutex::Autolock lock(mMutex); if (w<0 || h<0) @@ -486,14 +486,14 @@ int SurfaceTextureClient::setBuffersDimensions(int w, int h) mReqHeight = h; status_t err = mSurfaceTexture->setCrop(Rect(0, 0)); - LOGE_IF(err, "ISurfaceTexture::setCrop(...) returned %s", strerror(-err)); + ALOGE_IF(err, "ISurfaceTexture::setCrop(...) returned %s", strerror(-err)); return err; } int SurfaceTextureClient::setBuffersFormat(int format) { - LOGV("SurfaceTextureClient::setBuffersFormat"); + ALOGV("SurfaceTextureClient::setBuffersFormat"); Mutex::Autolock lock(mMutex); if (format<0) @@ -506,11 +506,11 @@ int SurfaceTextureClient::setBuffersFormat(int format) int SurfaceTextureClient::setScalingMode(int mode) { - LOGV("SurfaceTextureClient::setScalingMode(%d)", mode); + ALOGV("SurfaceTextureClient::setScalingMode(%d)", mode); Mutex::Autolock lock(mMutex); // mode is validated on the server status_t err = mSurfaceTexture->setScalingMode(mode); - LOGE_IF(err, "ISurfaceTexture::setScalingMode(%d) returned %s", + ALOGE_IF(err, "ISurfaceTexture::setScalingMode(%d) returned %s", mode, strerror(-err)); return err; @@ -518,7 +518,7 @@ int SurfaceTextureClient::setScalingMode(int mode) int SurfaceTextureClient::setBuffersTransform(int transform) { - LOGV("SurfaceTextureClient::setBuffersTransform"); + ALOGV("SurfaceTextureClient::setBuffersTransform"); Mutex::Autolock lock(mMutex); status_t err = mSurfaceTexture->setTransform(transform); return err; @@ -526,7 +526,7 @@ int SurfaceTextureClient::setBuffersTransform(int transform) int SurfaceTextureClient::setBuffersTimestamp(int64_t timestamp) { - LOGV("SurfaceTextureClient::setBuffersTimestamp"); + ALOGV("SurfaceTextureClient::setBuffersTimestamp"); Mutex::Autolock lock(mMutex); mTimestamp = timestamp; return NO_ERROR; @@ -551,11 +551,11 @@ static status_t copyBlt( status_t err; uint8_t const * src_bits = NULL; err = src->lock(GRALLOC_USAGE_SW_READ_OFTEN, reg.bounds(), (void**)&src_bits); - LOGE_IF(err, "error locking src buffer %s", strerror(-err)); + ALOGE_IF(err, "error locking src buffer %s", strerror(-err)); uint8_t* dst_bits = NULL; err = dst->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, reg.bounds(), (void**)&dst_bits); - LOGE_IF(err, "error locking dst buffer %s", strerror(-err)); + ALOGE_IF(err, "error locking dst buffer %s", strerror(-err)); Region::const_iterator head(reg.begin()); Region::const_iterator tail(reg.end()); @@ -598,7 +598,7 @@ status_t SurfaceTextureClient::lock( ANativeWindow_Buffer* outBuffer, ARect* inOutDirtyBounds) { if (mLockedBuffer != 0) { - LOGE("Surface::lock failed, already locked"); + ALOGE("Surface::lock failed, already locked"); return INVALID_OPERATION; } @@ -613,11 +613,11 @@ status_t SurfaceTextureClient::lock( ANativeWindowBuffer* out; status_t err = dequeueBuffer(&out); - LOGE_IF(err, "dequeueBuffer failed (%s)", strerror(-err)); + ALOGE_IF(err, "dequeueBuffer failed (%s)", strerror(-err)); if (err == NO_ERROR) { sp<GraphicBuffer> backBuffer(GraphicBuffer::getSelf(out)); err = lockBuffer(backBuffer.get()); - LOGE_IF(err, "lockBuffer (handle=%p) failed (%s)", + ALOGE_IF(err, "lockBuffer (handle=%p) failed (%s)", backBuffer->handle, strerror(-err)); if (err == NO_ERROR) { const Rect bounds(backBuffer->width, backBuffer->height); @@ -661,7 +661,7 @@ status_t SurfaceTextureClient::lock( GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN, newDirtyRegion.bounds(), &vaddr); - LOGW_IF(res, "failed locking buffer (handle = %p)", + ALOGW_IF(res, "failed locking buffer (handle = %p)", backBuffer->handle); mLockedBuffer = backBuffer; @@ -678,15 +678,15 @@ status_t SurfaceTextureClient::lock( status_t SurfaceTextureClient::unlockAndPost() { if (mLockedBuffer == 0) { - LOGE("Surface::unlockAndPost failed, no locked buffer"); + ALOGE("Surface::unlockAndPost failed, no locked buffer"); return INVALID_OPERATION; } status_t err = mLockedBuffer->unlock(); - LOGE_IF(err, "failed unlocking buffer (%p)", mLockedBuffer->handle); + ALOGE_IF(err, "failed unlocking buffer (%p)", mLockedBuffer->handle); err = queueBuffer(mLockedBuffer.get()); - LOGE_IF(err, "queueBuffer (handle=%p) failed (%s)", + ALOGE_IF(err, "queueBuffer (handle=%p) failed (%s)", mLockedBuffer->handle, strerror(-err)); mPostedBuffer = mLockedBuffer; diff --git a/libs/gui/tests/SurfaceTexture_test.cpp b/libs/gui/tests/SurfaceTexture_test.cpp index c313904..b18e7b0 100644 --- a/libs/gui/tests/SurfaceTexture_test.cpp +++ b/libs/gui/tests/SurfaceTexture_test.cpp @@ -1399,12 +1399,12 @@ protected: // test. void waitForFrame() { Mutex::Autolock lock(mMutex); - LOGV("+waitForFrame"); + ALOGV("+waitForFrame"); while (!mFrameAvailable) { mFrameAvailableCondition.wait(mMutex); } mFrameAvailable = false; - LOGV("-waitForFrame"); + ALOGV("-waitForFrame"); } // Allow the producer to return from its swapBuffers call and continue @@ -1412,23 +1412,23 @@ protected: // thread once for every frame expected by the test. void finishFrame() { Mutex::Autolock lock(mMutex); - LOGV("+finishFrame"); + ALOGV("+finishFrame"); mFrameFinished = true; mFrameFinishCondition.signal(); - LOGV("-finishFrame"); + ALOGV("-finishFrame"); } // This should be called by SurfaceTexture on the producer thread. virtual void onFrameAvailable() { Mutex::Autolock lock(mMutex); - LOGV("+onFrameAvailable"); + ALOGV("+onFrameAvailable"); mFrameAvailable = true; mFrameAvailableCondition.signal(); while (!mFrameFinished) { mFrameFinishCondition.wait(mMutex); } mFrameFinished = false; - LOGV("-onFrameAvailable"); + ALOGV("-onFrameAvailable"); } protected: @@ -1514,9 +1514,9 @@ TEST_F(SurfaceTextureGLThreadToGLTest, for (int i = 0; i < NUM_ITERATIONS; i++) { glClearColor(0.0f, 1.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); - LOGV("+swapBuffers"); + ALOGV("+swapBuffers"); swapBuffers(); - LOGV("-swapBuffers"); + ALOGV("-swapBuffers"); } } }; @@ -1525,9 +1525,9 @@ TEST_F(SurfaceTextureGLThreadToGLTest, for (int i = 0; i < NUM_ITERATIONS; i++) { mFC->waitForFrame(); - LOGV("+updateTexImage"); + ALOGV("+updateTexImage"); mST->updateTexImage(); - LOGV("-updateTexImage"); + ALOGV("-updateTexImage"); mFC->finishFrame(); // TODO: Add frame verification once RGB TEX_EXTERNAL_OES is supported! @@ -1543,9 +1543,9 @@ TEST_F(SurfaceTextureGLThreadToGLTest, for (int i = 0; i < NUM_ITERATIONS; i++) { glClearColor(0.0f, 1.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); - LOGV("+swapBuffers"); + ALOGV("+swapBuffers"); swapBuffers(); - LOGV("-swapBuffers"); + ALOGV("-swapBuffers"); } } }; @@ -1555,9 +1555,9 @@ TEST_F(SurfaceTextureGLThreadToGLTest, for (int i = 0; i < NUM_ITERATIONS; i++) { mFC->waitForFrame(); mFC->finishFrame(); - LOGV("+updateTexImage"); + ALOGV("+updateTexImage"); mST->updateTexImage(); - LOGV("-updateTexImage"); + ALOGV("-updateTexImage"); // TODO: Add frame verification once RGB TEX_EXTERNAL_OES is supported! } @@ -1573,9 +1573,9 @@ TEST_F(SurfaceTextureGLThreadToGLTest, for (int i = 0; i < NUM_ITERATIONS; i++) { glClearColor(0.0f, 1.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); - LOGV("+swapBuffers"); + ALOGV("+swapBuffers"); swapBuffers(); - LOGV("-swapBuffers"); + ALOGV("-swapBuffers"); } } }; @@ -1624,9 +1624,9 @@ TEST_F(SurfaceTextureGLThreadToGLTest, for (int i = 0; i < NUM_ITERATIONS-3; i++) { mFC->waitForFrame(); mFC->finishFrame(); - LOGV("+updateTexImage"); + ALOGV("+updateTexImage"); mST->updateTexImage(); - LOGV("-updateTexImage"); + ALOGV("-updateTexImage"); } } diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp index f293cba..b6b35ea 100644 --- a/libs/hwui/Caches.cpp +++ b/libs/hwui/Caches.cpp @@ -37,7 +37,7 @@ namespace uirenderer { /////////////////////////////////////////////////////////////////////////////// #if DEBUG_CACHE_FLUSH - #define FLUSH_LOGD(...) LOGD(__VA_ARGS__) + #define FLUSH_LOGD(...) ALOGD(__VA_ARGS__) #else #define FLUSH_LOGD(...) #endif @@ -50,7 +50,7 @@ Caches::Caches(): Singleton<Caches>(), mInitialized(false) { GLint maxTextureUnits; glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxTextureUnits); if (maxTextureUnits < REQUIRED_TEXTURE_UNITS_COUNT) { - LOGW("At least %d texture units are required!", REQUIRED_TEXTURE_UNITS_COUNT); + ALOGW("At least %d texture units are required!", REQUIRED_TEXTURE_UNITS_COUNT); } glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize); @@ -58,7 +58,7 @@ Caches::Caches(): Singleton<Caches>(), mInitialized(false) { init(); mDebugLevel = readDebugLevel(); - LOGD("Enabling debug mode %d", mDebugLevel); + ALOGD("Enabling debug mode %d", mDebugLevel); #if RENDER_LAYERS_AS_REGIONS INIT_LOGD("Layers will be composited as regions"); @@ -108,7 +108,7 @@ void Caches::terminate() { void Caches::dumpMemoryUsage() { String8 stringLog; dumpMemoryUsage(stringLog); - LOGD("%s", stringLog.string()); + ALOGD("%s", stringLog.string()); } void Caches::dumpMemoryUsage(String8 &log) { diff --git a/libs/hwui/Debug.h b/libs/hwui/Debug.h index 7cbb39d..0ad0c2a 100644 --- a/libs/hwui/Debug.h +++ b/libs/hwui/Debug.h @@ -66,7 +66,7 @@ #define DEBUG_DISPLAY_LIST 0 #if DEBUG_INIT - #define INIT_LOGD(...) LOGD(__VA_ARGS__) + #define INIT_LOGD(...) ALOGD(__VA_ARGS__) #else #define INIT_LOGD(...) #endif diff --git a/libs/hwui/DisplayListRenderer.cpp b/libs/hwui/DisplayListRenderer.cpp index 3372d1c..751da44 100644 --- a/libs/hwui/DisplayListRenderer.cpp +++ b/libs/hwui/DisplayListRenderer.cpp @@ -214,7 +214,7 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { indent[i] = ' '; } indent[count] = '\0'; - LOGD("%sStart display list (%p)", (char*) indent + 2, this); + ALOGD("%sStart display list (%p)", (char*) indent + 2, this); int saveCount = renderer.getSaveCount() - 1; @@ -226,21 +226,21 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { switch (op) { case DrawGLFunction: { Functor *functor = (Functor *) getInt(); - LOGD("%s%s %p", (char*) indent, OP_NAMES[op], functor); + ALOGD("%s%s %p", (char*) indent, OP_NAMES[op], functor); } break; case Save: { int rendererNum = getInt(); - LOGD("%s%s %d", (char*) indent, OP_NAMES[op], rendererNum); + ALOGD("%s%s %d", (char*) indent, OP_NAMES[op], rendererNum); } break; case Restore: { - LOGD("%s%s", (char*) indent, OP_NAMES[op]); + ALOGD("%s%s", (char*) indent, OP_NAMES[op]); } break; case RestoreToCount: { int restoreCount = saveCount + getInt(); - LOGD("%s%s %d", (char*) indent, OP_NAMES[op], restoreCount); + ALOGD("%s%s %d", (char*) indent, OP_NAMES[op], restoreCount); } break; case SaveLayer: { @@ -250,7 +250,7 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { float f4 = getFloat(); SkPaint* paint = getPaint(); int flags = getInt(); - LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p, 0x%x", (char*) indent, + ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p, 0x%x", (char*) indent, OP_NAMES[op], f1, f2, f3, f4, paint, flags); } break; @@ -261,41 +261,41 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { float f4 = getFloat(); int alpha = getInt(); int flags = getInt(); - LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %d, 0x%x", (char*) indent, + ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %d, 0x%x", (char*) indent, OP_NAMES[op], f1, f2, f3, f4, alpha, flags); } break; case Translate: { float f1 = getFloat(); float f2 = getFloat(); - LOGD("%s%s %.2f, %.2f", (char*) indent, OP_NAMES[op], f1, f2); + ALOGD("%s%s %.2f, %.2f", (char*) indent, OP_NAMES[op], f1, f2); } break; case Rotate: { float rotation = getFloat(); - LOGD("%s%s %.2f", (char*) indent, OP_NAMES[op], rotation); + ALOGD("%s%s %.2f", (char*) indent, OP_NAMES[op], rotation); } break; case Scale: { float sx = getFloat(); float sy = getFloat(); - LOGD("%s%s %.2f, %.2f", (char*) indent, OP_NAMES[op], sx, sy); + ALOGD("%s%s %.2f, %.2f", (char*) indent, OP_NAMES[op], sx, sy); } break; case Skew: { float sx = getFloat(); float sy = getFloat(); - LOGD("%s%s %.2f, %.2f", (char*) indent, OP_NAMES[op], sx, sy); + ALOGD("%s%s %.2f, %.2f", (char*) indent, OP_NAMES[op], sx, sy); } break; case SetMatrix: { SkMatrix* matrix = getMatrix(); - LOGD("%s%s %p", (char*) indent, OP_NAMES[op], matrix); + ALOGD("%s%s %p", (char*) indent, OP_NAMES[op], matrix); } break; case ConcatMatrix: { SkMatrix* matrix = getMatrix(); - LOGD("%s%s %p", (char*) indent, OP_NAMES[op], matrix); + ALOGD("%s%s %p", (char*) indent, OP_NAMES[op], matrix); } break; case ClipRect: { @@ -304,7 +304,7 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { float f3 = getFloat(); float f4 = getFloat(); int regionOp = getInt(); - LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %d", (char*) indent, OP_NAMES[op], + ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %d", (char*) indent, OP_NAMES[op], f1, f2, f3, f4, regionOp); } break; @@ -312,7 +312,7 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { DisplayList* displayList = getDisplayList(); uint32_t width = getUInt(); uint32_t height = getUInt(); - LOGD("%s%s %p, %dx%d, %d", (char*) indent, OP_NAMES[op], + ALOGD("%s%s %p, %dx%d, %d", (char*) indent, OP_NAMES[op], displayList, width, height, level + 1); renderer.outputDisplayList(displayList, level + 1); } @@ -322,7 +322,7 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { float x = getFloat(); float y = getFloat(); SkPaint* paint = getPaint(); - LOGD("%s%s %p, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op], + ALOGD("%s%s %p, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op], layer, x, y, paint); } break; @@ -331,7 +331,7 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { float x = getFloat(); float y = getFloat(); SkPaint* paint = getPaint(); - LOGD("%s%s %p, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op], + ALOGD("%s%s %p, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op], bitmap, x, y, paint); } break; @@ -339,7 +339,7 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { SkBitmap* bitmap = getBitmap(); SkMatrix* matrix = getMatrix(); SkPaint* paint = getPaint(); - LOGD("%s%s %p, %p, %p", (char*) indent, OP_NAMES[op], + ALOGD("%s%s %p, %p, %p", (char*) indent, OP_NAMES[op], bitmap, matrix, paint); } break; @@ -354,7 +354,7 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { float f7 = getFloat(); float f8 = getFloat(); SkPaint* paint = getPaint(); - LOGD("%s%s %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %p", + ALOGD("%s%s %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op], bitmap, f1, f2, f3, f4, f5, f6, f7, f8, paint); } break; @@ -368,7 +368,7 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { bool hasColors = getInt(); int* colors = hasColors ? getInts(colorsCount) : NULL; SkPaint* paint = getPaint(); - LOGD("%s%s", (char*) indent, OP_NAMES[op]); + ALOGD("%s%s", (char*) indent, OP_NAMES[op]); } break; case DrawPatch: { @@ -387,14 +387,14 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { float right = getFloat(); float bottom = getFloat(); SkPaint* paint = getPaint(); - LOGD("%s%s %.2f, %.2f, %.2f, %.2f", (char*) indent, OP_NAMES[op], + ALOGD("%s%s %.2f, %.2f, %.2f, %.2f", (char*) indent, OP_NAMES[op], left, top, right, bottom); } break; case DrawColor: { int color = getInt(); int xferMode = getInt(); - LOGD("%s%s 0x%x %d", (char*) indent, OP_NAMES[op], color, xferMode); + ALOGD("%s%s 0x%x %d", (char*) indent, OP_NAMES[op], color, xferMode); } break; case DrawRect: { @@ -403,7 +403,7 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { float f3 = getFloat(); float f4 = getFloat(); SkPaint* paint = getPaint(); - LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op], + ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op], f1, f2, f3, f4, paint); } break; @@ -415,7 +415,7 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { float f5 = getFloat(); float f6 = getFloat(); SkPaint* paint = getPaint(); - LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %p", + ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op], f1, f2, f3, f4, f5, f6, paint); } break; @@ -424,7 +424,7 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { float f2 = getFloat(); float f3 = getFloat(); SkPaint* paint = getPaint(); - LOGD("%s%s %.2f, %.2f, %.2f, %p", + ALOGD("%s%s %.2f, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op], f1, f2, f3, paint); } break; @@ -434,7 +434,7 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { float f3 = getFloat(); float f4 = getFloat(); SkPaint* paint = getPaint(); - LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p", + ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op], f1, f2, f3, f4, paint); } break; @@ -447,28 +447,28 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { float f6 = getFloat(); int i1 = getInt(); SkPaint* paint = getPaint(); - LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %d, %p", + ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %d, %p", (char*) indent, OP_NAMES[op], f1, f2, f3, f4, f5, f6, i1, paint); } break; case DrawPath: { SkPath* path = getPath(); SkPaint* paint = getPaint(); - LOGD("%s%s %p, %p", (char*) indent, OP_NAMES[op], path, paint); + ALOGD("%s%s %p, %p", (char*) indent, OP_NAMES[op], path, paint); } break; case DrawLines: { int count = 0; float* points = getFloats(count); SkPaint* paint = getPaint(); - LOGD("%s%s", (char*) indent, OP_NAMES[op]); + ALOGD("%s%s", (char*) indent, OP_NAMES[op]); } break; case DrawPoints: { int count = 0; float* points = getFloats(count); SkPaint* paint = getPaint(); - LOGD("%s%s", (char*) indent, OP_NAMES[op]); + ALOGD("%s%s", (char*) indent, OP_NAMES[op]); } break; case DrawText: { @@ -477,30 +477,30 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { float x = getFloat(); float y = getFloat(); SkPaint* paint = getPaint(); - LOGD("%s%s %s, %d, %d, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op], + ALOGD("%s%s %s, %d, %d, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op], text.text(), text.length(), count, x, y, paint); } break; case ResetShader: { - LOGD("%s%s", (char*) indent, OP_NAMES[op]); + ALOGD("%s%s", (char*) indent, OP_NAMES[op]); } break; case SetupShader: { SkiaShader* shader = getShader(); - LOGD("%s%s %p", (char*) indent, OP_NAMES[op], shader); + ALOGD("%s%s %p", (char*) indent, OP_NAMES[op], shader); } break; case ResetColorFilter: { - LOGD("%s%s", (char*) indent, OP_NAMES[op]); + ALOGD("%s%s", (char*) indent, OP_NAMES[op]); } break; case SetupColorFilter: { SkiaColorFilter *colorFilter = getColorFilter(); - LOGD("%s%s %p", (char*) indent, OP_NAMES[op], colorFilter); + ALOGD("%s%s %p", (char*) indent, OP_NAMES[op], colorFilter); } break; case ResetShadow: { - LOGD("%s%s", (char*) indent, OP_NAMES[op]); + ALOGD("%s%s", (char*) indent, OP_NAMES[op]); } break; case SetupShadow: { @@ -508,18 +508,18 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { float dx = getFloat(); float dy = getFloat(); int color = getInt(); - LOGD("%s%s %.2f, %.2f, %.2f, 0x%x", (char*) indent, OP_NAMES[op], + ALOGD("%s%s %.2f, %.2f, %.2f, 0x%x", (char*) indent, OP_NAMES[op], radius, dx, dy, color); } break; default: - LOGD("Display List error: op not handled: %s%s", + ALOGD("Display List error: op not handled: %s%s", (char*) indent, OP_NAMES[op]); break; } } - LOGD("%sDone", (char*) indent + 2); + ALOGD("%sDone", (char*) indent + 2); } /** diff --git a/libs/hwui/DisplayListRenderer.h b/libs/hwui/DisplayListRenderer.h index ab475bf..f4ae573 100644 --- a/libs/hwui/DisplayListRenderer.h +++ b/libs/hwui/DisplayListRenderer.h @@ -43,7 +43,7 @@ namespace uirenderer { // Debug #if DEBUG_DISPLAY_LIST - #define DISPLAY_LIST_LOGD(...) LOGD(__VA_ARGS__) + #define DISPLAY_LIST_LOGD(...) ALOGD(__VA_ARGS__) #else #define DISPLAY_LIST_LOGD(...) #endif diff --git a/libs/hwui/Extensions.h b/libs/hwui/Extensions.h index 38d1130..68e33cd 100644 --- a/libs/hwui/Extensions.h +++ b/libs/hwui/Extensions.h @@ -34,7 +34,7 @@ namespace uirenderer { // Debug #if DEBUG_EXTENSIONS - #define EXT_LOGD(...) LOGD(__VA_ARGS__) + #define EXT_LOGD(...) ALOGD(__VA_ARGS__) #else #define EXT_LOGD(...) #endif @@ -87,7 +87,7 @@ public: } void dump() { - LOGD("Supported extensions:\n%s", mExtensions); + ALOGD("Supported extensions:\n%s", mExtensions); } private: diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp index 158f785..42e672b 100644 --- a/libs/hwui/FontRenderer.cpp +++ b/libs/hwui/FontRenderer.cpp @@ -126,7 +126,7 @@ void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int x, int y, for (cacheX = glyph->mStartX, bX = nPenX; cacheX < endX; cacheX++, bX++) { for (cacheY = glyph->mStartY, bY = nPenY; cacheY < endY; cacheY++, bY++) { if (bX < 0 || bY < 0 || bX >= (int32_t) bitmapW || bY >= (int32_t) bitmapH) { - LOGE("Skipping invalid index"); + ALOGE("Skipping invalid index"); continue; } uint8_t tempCol = cacheBuffer[cacheY * cacheWidth + cacheX]; @@ -168,7 +168,7 @@ void Font::render(SkPaint* paint, const char* text, uint32_t start, uint32_t len void Font::measure(SkPaint* paint, const char* text, uint32_t start, uint32_t len, int numGlyphs, Rect *bounds) { if (bounds == NULL) { - LOGE("No return rectangle provided to measure text"); + ALOGE("No return rectangle provided to measure text"); return; } bounds->set(1e6, -1e6, -1e6, 1e6); @@ -401,7 +401,7 @@ bool FontRenderer::cacheBitmap(const SkGlyph& glyph, uint32_t* retOriginX, uint3 initTextTexture(true); } if (glyph.fHeight + 2 > mCacheLines[mCacheLines.size() - 1]->mMaxHeight) { - LOGE("Font size to large to fit in cache. width, height = %i, %i", + ALOGE("Font size to large to fit in cache. width, height = %i, %i", (int) glyph.fWidth, (int) glyph.fHeight); return false; } @@ -433,7 +433,7 @@ bool FontRenderer::cacheBitmap(const SkGlyph& glyph, uint32_t* retOriginX, uint3 // if we still don't fit, something is wrong and we shouldn't draw if (!bitmapFit) { - LOGE("Bitmap doesn't fit in cache. width, height = %i, %i", + ALOGE("Bitmap doesn't fit in cache. width, height = %i, %i", (int) glyph.fWidth, (int) glyph.fHeight); return false; } @@ -758,12 +758,12 @@ bool FontRenderer::renderText(SkPaint* paint, const Rect* clip, const char *text checkInit(); if (!mCurrentFont) { - LOGE("No font set"); + ALOGE("No font set"); return false; } if (mPositionAttrSlot < 0 || mTexcoordAttrSlot < 0) { - LOGE("Font renderer unable to draw, attribute slots undefined"); + ALOGE("Font renderer unable to draw, attribute slots undefined"); return false; } diff --git a/libs/hwui/GradientCache.cpp b/libs/hwui/GradientCache.cpp index aacf22a..27c2677 100644 --- a/libs/hwui/GradientCache.cpp +++ b/libs/hwui/GradientCache.cpp @@ -154,7 +154,7 @@ Texture* GradientCache::addLinearGradient(GradientCacheEntry& gradient, void GradientCache::generateTexture(SkBitmap* bitmap, Texture* texture) { SkAutoLockPixels autoLock(*bitmap); if (!bitmap->readyToDraw()) { - LOGE("Cannot generate texture from shader"); + ALOGE("Cannot generate texture from shader"); return; } diff --git a/libs/hwui/LayerCache.h b/libs/hwui/LayerCache.h index c14c9ca..fd698e2 100644 --- a/libs/hwui/LayerCache.h +++ b/libs/hwui/LayerCache.h @@ -31,7 +31,7 @@ namespace uirenderer { // Debug #if DEBUG_LAYERS - #define LAYER_LOGD(...) LOGD(__VA_ARGS__) + #define LAYER_LOGD(...) ALOGD(__VA_ARGS__) #else #define LAYER_LOGD(...) #endif diff --git a/libs/hwui/LayerRenderer.cpp b/libs/hwui/LayerRenderer.cpp index e38b479..60c9d60 100644 --- a/libs/hwui/LayerRenderer.cpp +++ b/libs/hwui/LayerRenderer.cpp @@ -184,14 +184,14 @@ Layer* LayerRenderer::createLayer(uint32_t width, uint32_t height, bool isOpaque GLuint fbo = Caches::getInstance().fboCache.get(); if (!fbo) { - LOGW("Could not obtain an FBO"); + ALOGW("Could not obtain an FBO"); return NULL; } glActiveTexture(GL_TEXTURE0); Layer* layer = Caches::getInstance().layerCache.get(width, height); if (!layer) { - LOGW("Could not obtain a layer"); + ALOGW("Could not obtain a layer"); return NULL; } @@ -216,7 +216,7 @@ Layer* LayerRenderer::createLayer(uint32_t width, uint32_t height, bool isOpaque layer->allocateTexture(GL_RGBA, GL_UNSIGNED_BYTE); if (glGetError() != GL_NO_ERROR) { - LOGD("Could not allocate texture for layer (fbo=%d %dx%d)", + ALOGD("Could not allocate texture for layer (fbo=%d %dx%d)", fbo, width, height); glBindFramebuffer(GL_FRAMEBUFFER, previousFbo); @@ -338,7 +338,7 @@ bool LayerRenderer::copyLayer(Layer* layer, SkBitmap* bitmap) { GLuint fbo = caches.fboCache.get(); if (!fbo) { - LOGW("Could not obtain an FBO"); + ALOGW("Could not obtain an FBO"); return false; } @@ -439,7 +439,7 @@ bool LayerRenderer::copyLayer(Layer* layer, SkBitmap* bitmap) { error: #if DEBUG_OPENGL if (error != GL_NO_ERROR) { - LOGD("GL error while copying layer into bitmap = 0x%x", error); + ALOGD("GL error while copying layer into bitmap = 0x%x", error); } #endif diff --git a/libs/hwui/LayerRenderer.h b/libs/hwui/LayerRenderer.h index 6104301..fe28e31 100644 --- a/libs/hwui/LayerRenderer.h +++ b/libs/hwui/LayerRenderer.h @@ -33,7 +33,7 @@ namespace uirenderer { // Debug #if DEBUG_LAYER_RENDERER - #define LAYER_RENDERER_LOGD(...) LOGD(__VA_ARGS__) + #define LAYER_RENDERER_LOGD(...) ALOGD(__VA_ARGS__) #else #define LAYER_RENDERER_LOGD(...) #endif diff --git a/libs/hwui/Matrix.cpp b/libs/hwui/Matrix.cpp index 769c99c..a8f937d 100644 --- a/libs/hwui/Matrix.cpp +++ b/libs/hwui/Matrix.cpp @@ -374,12 +374,12 @@ void Matrix4::mapRect(Rect& r) const { } void Matrix4::dump() const { - LOGD("Matrix4[simple=%d", mSimpleMatrix); - LOGD(" %f %f %f %f", data[kScaleX], data[kSkewX], data[8], data[kTranslateX]); - LOGD(" %f %f %f %f", data[kSkewY], data[kScaleY], data[9], data[kTranslateY]); - LOGD(" %f %f %f %f", data[2], data[6], data[kScaleZ], data[kTranslateZ]); - LOGD(" %f %f %f %f", data[kPerspective0], data[kPerspective1], data[11], data[kPerspective2]); - LOGD("]"); + ALOGD("Matrix4[simple=%d", mSimpleMatrix); + ALOGD(" %f %f %f %f", data[kScaleX], data[kSkewX], data[8], data[kTranslateX]); + ALOGD(" %f %f %f %f", data[kSkewY], data[kScaleY], data[9], data[kTranslateY]); + ALOGD(" %f %f %f %f", data[2], data[6], data[kScaleZ], data[kTranslateZ]); + ALOGD(" %f %f %f %f", data[kPerspective0], data[kPerspective1], data[11], data[kPerspective2]); + ALOGD("]"); } }; // namespace uirenderer diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 4d22646..5089c5c 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -173,10 +173,10 @@ void OpenGLRenderer::finish() { #if DEBUG_OPENGL GLenum status = GL_NO_ERROR; while ((status = glGetError()) != GL_NO_ERROR) { - LOGD("GL error from OpenGLRenderer: 0x%x", status); + ALOGD("GL error from OpenGLRenderer: 0x%x", status); switch (status) { case GL_OUT_OF_MEMORY: - LOGE(" OpenGLRenderer is out of memory!"); + ALOGE(" OpenGLRenderer is out of memory!"); break; } } @@ -539,7 +539,7 @@ bool OpenGLRenderer::createFboLayer(Layer* layer, Rect& bounds, sp<Snapshot> sna #if DEBUG_LAYERS_AS_REGIONS GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); if (status != GL_FRAMEBUFFER_COMPLETE) { - LOGE("Framebuffer incomplete (GL error code 0x%x)", status); + ALOGE("Framebuffer incomplete (GL error code 0x%x)", status); glBindFramebuffer(GL_FRAMEBUFFER, previousFbo); layer->deleteTexture(); @@ -571,7 +571,7 @@ bool OpenGLRenderer::createFboLayer(Layer* layer, Rect& bounds, sp<Snapshot> sna */ void OpenGLRenderer::composeLayer(sp<Snapshot> current, sp<Snapshot> previous) { if (!current->layer) { - LOGE("Attempting to compose a layer that does not exist"); + ALOGE("Attempting to compose a layer that does not exist"); return; } diff --git a/libs/hwui/PatchCache.h b/libs/hwui/PatchCache.h index 91b603f..505798a 100644 --- a/libs/hwui/PatchCache.h +++ b/libs/hwui/PatchCache.h @@ -32,7 +32,7 @@ namespace uirenderer { // Debug #if DEBUG_PATCHES - #define PATCH_LOGD(...) LOGD(__VA_ARGS__) + #define PATCH_LOGD(...) ALOGD(__VA_ARGS__) #else #define PATCH_LOGD(...) #endif diff --git a/libs/hwui/Program.cpp b/libs/hwui/Program.cpp index 972dd87..043a092 100644 --- a/libs/hwui/Program.cpp +++ b/libs/hwui/Program.cpp @@ -42,13 +42,13 @@ Program::Program(const char* vertex, const char* fragment) { GLint status; glGetProgramiv(id, GL_LINK_STATUS, &status); if (status != GL_TRUE) { - LOGE("Error while linking shaders:"); + ALOGE("Error while linking shaders:"); GLint infoLen = 0; glGetProgramiv(id, GL_INFO_LOG_LENGTH, &infoLen); if (infoLen > 1) { GLchar log[infoLen]; glGetProgramInfoLog(id, infoLen, 0, &log[0]); - LOGE("%s", log); + ALOGE("%s", log); } glDeleteShader(vertexShader); glDeleteShader(fragmentShader); @@ -115,7 +115,7 @@ GLuint Program::buildShader(const char* source, GLenum type) { // use a fixed size instead GLchar log[512]; glGetShaderInfoLog(shader, sizeof(log), 0, &log[0]); - LOGE("Error while compiling shader: %s", log); + ALOGE("Error while compiling shader: %s", log); glDeleteShader(shader); return 0; } diff --git a/libs/hwui/ProgramCache.h b/libs/hwui/ProgramCache.h index 5c7197b..0ff2148 100644 --- a/libs/hwui/ProgramCache.h +++ b/libs/hwui/ProgramCache.h @@ -37,7 +37,7 @@ namespace uirenderer { // Debug #if DEBUG_PROGRAMS - #define PROGRAM_LOGD(...) LOGD(__VA_ARGS__) + #define PROGRAM_LOGD(...) ALOGD(__VA_ARGS__) #else #define PROGRAM_LOGD(...) #endif diff --git a/libs/hwui/Rect.h b/libs/hwui/Rect.h index edc90e1..5baada3 100644 --- a/libs/hwui/Rect.h +++ b/libs/hwui/Rect.h @@ -169,7 +169,7 @@ public: } void dump() const { - LOGD("Rect[l=%f t=%f r=%f b=%f]", left, top, right, bottom); + ALOGD("Rect[l=%f t=%f r=%f b=%f]", left, top, right, bottom); } }; // class Rect diff --git a/libs/hwui/ResourceCache.cpp b/libs/hwui/ResourceCache.cpp index ee73983..9ffad88 100644 --- a/libs/hwui/ResourceCache.cpp +++ b/libs/hwui/ResourceCache.cpp @@ -26,12 +26,12 @@ namespace uirenderer { /////////////////////////////////////////////////////////////////////////////// void ResourceCache::logCache() { - LOGD("ResourceCache: cacheReport:"); + ALOGD("ResourceCache: cacheReport:"); for (size_t i = 0; i < mCache->size(); ++i) { ResourceReference* ref = mCache->valueAt(i); - LOGD(" ResourceCache: mCache(%d): resource, ref = 0x%p, 0x%p", + ALOGD(" ResourceCache: mCache(%d): resource, ref = 0x%p, 0x%p", i, mCache->keyAt(i), mCache->valueAt(i)); - LOGD(" ResourceCache: mCache(%d): refCount, recycled, destroyed, type = %d, %d, %d, %d", + ALOGD(" ResourceCache: mCache(%d): refCount, recycled, destroyed, type = %d, %d, %d, %d", i, ref->refCount, ref->recycled, ref->destroyed, ref->resourceType); } } diff --git a/libs/hwui/ShapeCache.h b/libs/hwui/ShapeCache.h index 0660b69..c07a6c9 100644 --- a/libs/hwui/ShapeCache.h +++ b/libs/hwui/ShapeCache.h @@ -40,7 +40,7 @@ namespace uirenderer { // Debug #if DEBUG_SHAPES - #define SHAPE_LOGD(...) LOGD(__VA_ARGS__) + #define SHAPE_LOGD(...) ALOGD(__VA_ARGS__) #else #define SHAPE_LOGD(...) #endif @@ -481,7 +481,7 @@ void ShapeCache<Entry>::removeTexture(PathTexture* texture) { SHAPE_LOGD("ShapeCache::callback: delete %s: name, size, mSize = %d, %d, %d", mName, texture->id, size, mSize); if (mDebugEnabled) { - LOGD("Shape %s deleted, size = %d", mName, size); + ALOGD("Shape %s deleted, size = %d", mName, size); } glDeleteTextures(1, &texture->id); @@ -503,7 +503,7 @@ PathTexture* ShapeCache<Entry>::addTexture(const Entry& entry, const SkPath *pat const uint32_t height = uint32_t(pathHeight + offset * 2.0 + 0.5); if (width > mMaxTextureSize || height > mMaxTextureSize) { - LOGW("Shape %s too large to be rendered into a texture", mName); + ALOGW("Shape %s too large to be rendered into a texture", mName); return NULL; } @@ -551,7 +551,7 @@ PathTexture* ShapeCache<Entry>::addTexture(const Entry& entry, const SkPath *pat SHAPE_LOGD("ShapeCache::get: create %s: name, size, mSize = %d, %d, %d", mName, texture->id, size, mSize); if (mDebugEnabled) { - LOGD("Shape %s created, size = %d", mName, size); + ALOGD("Shape %s created, size = %d", mName, size); } mCache.put(entry, texture); } else { @@ -570,7 +570,7 @@ template<class Entry> void ShapeCache<Entry>::generateTexture(SkBitmap& bitmap, Texture* texture) { SkAutoLockPixels alp(bitmap); if (!bitmap.readyToDraw()) { - LOGE("Cannot generate texture from bitmap"); + ALOGE("Cannot generate texture from bitmap"); return; } diff --git a/libs/hwui/TextDropShadowCache.cpp b/libs/hwui/TextDropShadowCache.cpp index a3ee63b..ee8d828 100644 --- a/libs/hwui/TextDropShadowCache.cpp +++ b/libs/hwui/TextDropShadowCache.cpp @@ -85,7 +85,7 @@ void TextDropShadowCache::operator()(ShadowText& text, ShadowTexture*& texture) mSize -= texture->bitmapSize; if (mDebugEnabled) { - LOGD("Shadow texture deleted, size = %d", texture->bitmapSize); + ALOGD("Shadow texture deleted, size = %d", texture->bitmapSize); } glDeleteTextures(1, &texture->id); @@ -142,7 +142,7 @@ ShadowTexture* TextDropShadowCache::get(SkPaint* paint, const char* text, uint32 if (size < mMaxSize) { if (mDebugEnabled) { - LOGD("Shadow texture created, size = %d", texture->bitmapSize); + ALOGD("Shadow texture created, size = %d", texture->bitmapSize); } entry.copyTextLocally(); diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp index 018ce3e..7a88f2a 100644 --- a/libs/hwui/TextureCache.cpp +++ b/libs/hwui/TextureCache.cpp @@ -109,7 +109,7 @@ void TextureCache::operator()(SkBitmap*& bitmap, Texture*& texture) { TEXTURE_LOGD("TextureCache::callback: name, removed size, mSize = %d, %d, %d", texture->id, texture->bitmapSize, mSize); if (mDebugEnabled) { - LOGD("Texture deleted, size = %d", texture->bitmapSize); + ALOGD("Texture deleted, size = %d", texture->bitmapSize); } glDeleteTextures(1, &texture->id); delete texture; @@ -125,7 +125,7 @@ Texture* TextureCache::get(SkBitmap* bitmap) { if (!texture) { if (bitmap->width() > mMaxTextureSize || bitmap->height() > mMaxTextureSize) { - LOGW("Bitmap too large to be uploaded into a texture"); + ALOGW("Bitmap too large to be uploaded into a texture"); return NULL; } @@ -146,7 +146,7 @@ Texture* TextureCache::get(SkBitmap* bitmap) { TEXTURE_LOGD("TextureCache::get: create texture(%p): name, size, mSize = %d, %d, %d", bitmap, texture->id, size, mSize); if (mDebugEnabled) { - LOGD("Texture created, size = %d", size); + ALOGD("Texture created, size = %d", size); } mCache.put(bitmap, texture); } else { @@ -201,7 +201,7 @@ void TextureCache::generateTexture(SkBitmap* bitmap, Texture* texture, bool rege SkAutoLockPixels alp(*bitmap); if (!bitmap->readyToDraw()) { - LOGE("Cannot generate texture from bitmap"); + ALOGE("Cannot generate texture from bitmap"); return; } @@ -244,7 +244,7 @@ void TextureCache::generateTexture(SkBitmap* bitmap, Texture* texture, bool rege texture->blend = !bitmap->isOpaque(); break; default: - LOGW("Unsupported bitmap config: %d", bitmap->getConfig()); + ALOGW("Unsupported bitmap config: %d", bitmap->getConfig()); break; } diff --git a/libs/hwui/TextureCache.h b/libs/hwui/TextureCache.h index ce924b4..d879392 100644 --- a/libs/hwui/TextureCache.h +++ b/libs/hwui/TextureCache.h @@ -34,7 +34,7 @@ namespace uirenderer { // Debug #if DEBUG_TEXTURES - #define TEXTURE_LOGD(...) LOGD(__VA_ARGS__) + #define TEXTURE_LOGD(...) ALOGD(__VA_ARGS__) #else #define TEXTURE_LOGD(...) #endif diff --git a/libs/hwui/Vector.h b/libs/hwui/Vector.h index 46dded5..497924e 100644 --- a/libs/hwui/Vector.h +++ b/libs/hwui/Vector.h @@ -103,7 +103,7 @@ struct Vector2 { } void dump() { - LOGD("Vector2[%.2f, %.2f]", x, y); + ALOGD("Vector2[%.2f, %.2f]", x, y); } }; // class Vector2 diff --git a/libs/rs/driver/rsdAllocation.cpp b/libs/rs/driver/rsdAllocation.cpp index 2ebfe0a..1f70e66 100644 --- a/libs/rs/driver/rsdAllocation.cpp +++ b/libs/rs/driver/rsdAllocation.cpp @@ -172,7 +172,7 @@ static void AllocateRenderTarget(const Context *rsc, const Allocation *alloc) { if (!drv->renderTargetID) { // This should generally not happen - LOGE("allocateRenderTarget failed to gen mRenderTargetID"); + ALOGE("allocateRenderTarget failed to gen mRenderTargetID"); rsc->dumpDebug(); return; } @@ -195,7 +195,7 @@ static void UploadToBufferObject(const Context *rsc, const Allocation *alloc) { RSD_CALL_GL(glGenBuffers, 1, &drv->bufferID); } if (!drv->bufferID) { - LOGE("Upload to buffer object failed"); + ALOGE("Upload to buffer object failed"); drv->uploadDeferred = true; return; } @@ -256,7 +256,7 @@ void rsdAllocationDestroy(const Context *rsc, Allocation *alloc) { if (drv->bufferID) { // Causes a SW crash.... - //LOGV(" mBufferID %i", mBufferID); + //ALOGV(" mBufferID %i", mBufferID); //glDeleteBuffers(1, &mBufferID); //mBufferID = 0; } @@ -460,7 +460,7 @@ void rsdAllocationData2D_alloc_script(const android::renderscript::Context *rsc, uint8_t *srcPtr = getOffsetPtr(srcAlloc, srcXoff, srcYoff + i, srcLod, srcFace); memcpy(dstPtr, srcPtr, w * elementSize); - //LOGE("COPIED dstXoff(%u), dstYoff(%u), dstLod(%u), dstFace(%u), w(%u), h(%u), srcXoff(%u), srcYoff(%u), srcLod(%u), srcFace(%u)", + //ALOGE("COPIED dstXoff(%u), dstYoff(%u), dstLod(%u), dstFace(%u), w(%u), h(%u), srcXoff(%u), srcYoff(%u), srcLod(%u), srcFace(%u)", // dstXoff, dstYoff, dstLod, dstFace, w, h, srcXoff, srcYoff, srcLod, srcFace); } } diff --git a/libs/rs/driver/rsdBcc.cpp b/libs/rs/driver/rsdBcc.cpp index 4ecf8e8..a36bae9 100644 --- a/libs/rs/driver/rsdBcc.cpp +++ b/libs/rs/driver/rsdBcc.cpp @@ -69,7 +69,7 @@ bool rsdScriptInit(const Context *rsc, uint8_t const *bitcode, size_t bitcodeSize, uint32_t flags) { - //LOGE("rsdScriptCreate %p %p %p %p %i %i %p", rsc, resName, cacheDir, bitcode, bitcodeSize, flags, lookupFunc); + //ALOGE("rsdScriptCreate %p %p %p %p %i %i %p", rsc, resName, cacheDir, bitcode, bitcodeSize, flags, lookupFunc); pthread_mutex_lock(&rsdgInitMutex); char *cachePath = NULL; @@ -93,14 +93,14 @@ bool rsdScriptInit(const Context *rsc, drv->ME = new bcinfo::MetadataExtractor((const char*)drv->mScriptText, drv->mScriptTextLength); if (!drv->ME->extract()) { - LOGE("bcinfo: failed to read script metadata"); + ALOGE("bcinfo: failed to read script metadata"); goto error; } - //LOGE("mBccScript %p", script->mBccScript); + //ALOGE("mBccScript %p", script->mBccScript); if (bccRegisterSymbolCallback(drv->mBccScript, &rsdLookupRuntimeStub, script) != 0) { - LOGE("bcc: FAILS to register symbol callback"); + ALOGE("bcc: FAILS to register symbol callback"); goto error; } @@ -108,17 +108,17 @@ bool rsdScriptInit(const Context *rsc, resName, (char const *)drv->mScriptText, drv->mScriptTextLength, 0) != 0) { - LOGE("bcc: FAILS to read bitcode"); + ALOGE("bcc: FAILS to read bitcode"); goto error; } if (bccLinkFile(drv->mBccScript, "/system/lib/libclcore.bc", 0) != 0) { - LOGE("bcc: FAILS to link bitcode"); + ALOGE("bcc: FAILS to link bitcode"); goto error; } if (bccPrepareExecutable(drv->mBccScript, cacheDir, resName, 0) != 0) { - LOGE("bcc: FAILS to prepare executable"); + ALOGE("bcc: FAILS to prepare executable"); goto error; } @@ -236,8 +236,8 @@ static void wc_xy(void *usr, uint32_t idx) { return; } - //LOGE("usr idx %i, x %i,%i y %i,%i", idx, mtls->xStart, mtls->xEnd, yStart, yEnd); - //LOGE("usr ptr in %p, out %p", mtls->ptrIn, mtls->ptrOut); + //ALOGE("usr idx %i, x %i,%i y %i,%i", idx, mtls->xStart, mtls->xEnd, yStart, yEnd); + //ALOGE("usr ptr in %p, out %p", mtls->ptrIn, mtls->ptrOut); for (p.y = yStart; p.y < yEnd; p.y++) { uint32_t offset = mtls->dimX * p.y; p.out = mtls->ptrOut + (mtls->eStrideOut * offset); @@ -267,8 +267,8 @@ static void wc_x(void *usr, uint32_t idx) { return; } - //LOGE("usr slice %i idx %i, x %i,%i", slice, idx, xStart, xEnd); - //LOGE("usr ptr in %p, out %p", mtls->ptrIn, mtls->ptrOut); + //ALOGE("usr slice %i idx %i, x %i,%i", slice, idx, xStart, xEnd); + //ALOGE("usr ptr in %p, out %p", mtls->ptrIn, mtls->ptrOut); p.out = mtls->ptrOut + (mtls->eStrideOut * xStart); p.in = mtls->ptrIn + (mtls->eStrideIn * xStart); @@ -374,7 +374,7 @@ void rsdScriptInvokeForEach(const Context *rsc, rsdLaunchThreads(mrsc, wc_x, &mtls); } - //LOGE("launch 1"); + //ALOGE("launch 1"); } else { RsForEachStubParamStruct p; memset(&p, 0, sizeof(p)); @@ -382,7 +382,7 @@ void rsdScriptInvokeForEach(const Context *rsc, p.usr_len = mtls.usrLen; uint32_t sig = mtls.sig; - //LOGE("launch 3"); + //ALOGE("launch 3"); outer_foreach_t fn = dc->mForEachLaunch[sig]; for (p.ar[0] = mtls.arrayStart; p.ar[0] < mtls.arrayEnd; p.ar[0]++) { for (p.z = mtls.zStart; p.z < mtls.zEnd; p.z++) { @@ -434,7 +434,7 @@ void rsdScriptInvokeFunction(const Context *dc, Script *script, const void *params, size_t paramLength) { DrvScript *drv = (DrvScript *)script->mHal.drv; - //LOGE("invoke %p %p %i %p %i", dc, script, slot, params, paramLength); + //ALOGE("invoke %p %p %i %p %i", dc, script, slot, params, paramLength); Script * oldTLS = setTLS(script); ((void (*)(const void *, uint32_t)) @@ -446,11 +446,11 @@ void rsdScriptSetGlobalVar(const Context *dc, const Script *script, uint32_t slot, void *data, size_t dataLength) { DrvScript *drv = (DrvScript *)script->mHal.drv; //rsAssert(!script->mFieldIsObject[slot]); - //LOGE("setGlobalVar %p %p %i %p %i", dc, script, slot, data, dataLength); + //ALOGE("setGlobalVar %p %p %i %p %i", dc, script, slot, data, dataLength); int32_t *destPtr = ((int32_t **)drv->mFieldAddress)[slot]; if (!destPtr) { - //LOGV("Calling setVar on slot = %i which is null", slot); + //ALOGV("Calling setVar on slot = %i which is null", slot); return; } @@ -460,11 +460,11 @@ void rsdScriptSetGlobalVar(const Context *dc, const Script *script, void rsdScriptSetGlobalBind(const Context *dc, const Script *script, uint32_t slot, void *data) { DrvScript *drv = (DrvScript *)script->mHal.drv; //rsAssert(!script->mFieldIsObject[slot]); - //LOGE("setGlobalBind %p %p %i %p", dc, script, slot, data); + //ALOGE("setGlobalBind %p %p %i %p", dc, script, slot, data); int32_t *destPtr = ((int32_t **)drv->mFieldAddress)[slot]; if (!destPtr) { - //LOGV("Calling setVar on slot = %i which is null", slot); + //ALOGV("Calling setVar on slot = %i which is null", slot); return; } @@ -474,11 +474,11 @@ void rsdScriptSetGlobalBind(const Context *dc, const Script *script, uint32_t sl void rsdScriptSetGlobalObj(const Context *dc, const Script *script, uint32_t slot, ObjectBase *data) { DrvScript *drv = (DrvScript *)script->mHal.drv; //rsAssert(script->mFieldIsObject[slot]); - //LOGE("setGlobalObj %p %p %i %p", dc, script, slot, data); + //ALOGE("setGlobalObj %p %p %i %p", dc, script, slot, data); int32_t *destPtr = ((int32_t **)drv->mFieldAddress)[slot]; if (!destPtr) { - //LOGV("Calling setVar on slot = %i which is null", slot); + //ALOGV("Calling setVar on slot = %i which is null", slot); return; } diff --git a/libs/rs/driver/rsdCore.cpp b/libs/rs/driver/rsdCore.cpp index 247f4dc..b514e21 100644 --- a/libs/rs/driver/rsdCore.cpp +++ b/libs/rs/driver/rsdCore.cpp @@ -139,14 +139,14 @@ static void * HelperThreadProc(void *vrsc) { uint32_t idx = (uint32_t)android_atomic_inc(&dc->mWorkers.mLaunchCount); - //LOGV("RS helperThread starting %p idx=%i", rsc, idx); + //ALOGV("RS helperThread starting %p idx=%i", rsc, idx); dc->mWorkers.mLaunchSignals[idx].init(); dc->mWorkers.mNativeThreadId[idx] = gettid(); int status = pthread_setspecific(rsdgThreadTLSKey, &dc->mTlsStruct); if (status) { - LOGE("pthread_setspecific %i", status); + ALOGE("pthread_setspecific %i", status); } #if 0 @@ -156,7 +156,7 @@ static void * HelperThreadProc(void *vrsc) { cpuset.bits[idx / 64] |= 1ULL << (idx % 64); int ret = syscall(241, rsc->mWorkers.mNativeThreadId[idx], sizeof(cpuset), &cpuset); - LOGE("SETAFFINITY ret = %i %s", ret, EGLUtils::strerror(ret)); + ALOGE("SETAFFINITY ret = %i %s", ret, EGLUtils::strerror(ret)); #endif while (!dc->mExit) { @@ -168,7 +168,7 @@ static void * HelperThreadProc(void *vrsc) { dc->mWorkers.mCompleteSignal.set(); } - //LOGV("RS helperThread exited %p idx=%i", rsc, idx); + //ALOGV("RS helperThread exited %p idx=%i", rsc, idx); return NULL; } @@ -191,7 +191,7 @@ bool rsdHalInit(Context *rsc, uint32_t version_major, uint32_t version_minor) { RsdHal *dc = (RsdHal *)calloc(1, sizeof(RsdHal)); if (!dc) { - LOGE("Calloc for driver hal failed."); + ALOGE("Calloc for driver hal failed."); return false; } rsc->mHal.drv = dc; @@ -200,7 +200,7 @@ bool rsdHalInit(Context *rsc, uint32_t version_major, uint32_t version_minor) { if (!rsdgThreadTLSKeyCount) { int status = pthread_key_create(&rsdgThreadTLSKey, NULL); if (status) { - LOGE("Failed to init thread tls key."); + ALOGE("Failed to init thread tls key."); pthread_mutex_unlock(&rsdgInitMutex); return false; } @@ -214,12 +214,12 @@ bool rsdHalInit(Context *rsc, uint32_t version_major, uint32_t version_minor) { dc->mTlsStruct.mScript = NULL; int status = pthread_setspecific(rsdgThreadTLSKey, &dc->mTlsStruct); if (status) { - LOGE("pthread_setspecific %i", status); + ALOGE("pthread_setspecific %i", status); } int cpu = sysconf(_SC_NPROCESSORS_ONLN); - LOGV("%p Launching thread(s), CPUs %i", rsc, cpu); + ALOGV("%p Launching thread(s), CPUs %i", rsc, cpu); if (cpu < 2) cpu = 0; dc->mWorkers.mCount = (uint32_t)cpu; @@ -236,7 +236,7 @@ bool rsdHalInit(Context *rsc, uint32_t version_major, uint32_t version_minor) { pthread_attr_t threadAttr; status = pthread_attr_init(&threadAttr); if (status) { - LOGE("Failed to init thread attribute."); + ALOGE("Failed to init thread attribute."); return false; } @@ -244,7 +244,7 @@ bool rsdHalInit(Context *rsc, uint32_t version_major, uint32_t version_minor) { status = pthread_create(&dc->mWorkers.mThreadId[ct], &threadAttr, HelperThreadProc, rsc); if (status) { dc->mWorkers.mCount = ct; - LOGE("Created fewer than expected number of RS threads."); + ALOGE("Created fewer than expected number of RS threads."); break; } } diff --git a/libs/rs/driver/rsdGL.cpp b/libs/rs/driver/rsdGL.cpp index 98d9486..b53a68c 100644 --- a/libs/rs/driver/rsdGL.cpp +++ b/libs/rs/driver/rsdGL.cpp @@ -101,27 +101,27 @@ static void printEGLConfiguration(EGLDisplay dpy, EGLConfig config) { EGLint value = -1; EGLBoolean returnVal = eglGetConfigAttrib(dpy, config, names[j].attribute, &value); if (returnVal) { - LOGV(" %s: %d (0x%x)", names[j].name, value, value); + ALOGV(" %s: %d (0x%x)", names[j].name, value, value); } } } static void DumpDebug(RsdHal *dc) { - LOGE(" EGL ver %i %i", dc->gl.egl.majorVersion, dc->gl.egl.minorVersion); - LOGE(" EGL context %p surface %p, Display=%p", dc->gl.egl.context, dc->gl.egl.surface, + ALOGE(" EGL ver %i %i", dc->gl.egl.majorVersion, dc->gl.egl.minorVersion); + ALOGE(" EGL context %p surface %p, Display=%p", dc->gl.egl.context, dc->gl.egl.surface, dc->gl.egl.display); - LOGE(" GL vendor: %s", dc->gl.gl.vendor); - LOGE(" GL renderer: %s", dc->gl.gl.renderer); - LOGE(" GL Version: %s", dc->gl.gl.version); - LOGE(" GL Extensions: %s", dc->gl.gl.extensions); - LOGE(" GL int Versions %i %i", dc->gl.gl.majorVersion, dc->gl.gl.minorVersion); + ALOGE(" GL vendor: %s", dc->gl.gl.vendor); + ALOGE(" GL renderer: %s", dc->gl.gl.renderer); + ALOGE(" GL Version: %s", dc->gl.gl.version); + ALOGE(" GL Extensions: %s", dc->gl.gl.extensions); + ALOGE(" GL int Versions %i %i", dc->gl.gl.majorVersion, dc->gl.gl.minorVersion); - LOGV("MAX Textures %i, %i %i", dc->gl.gl.maxVertexTextureUnits, + ALOGV("MAX Textures %i, %i %i", dc->gl.gl.maxVertexTextureUnits, dc->gl.gl.maxFragmentTextureImageUnits, dc->gl.gl.maxTextureImageUnits); - LOGV("MAX Attribs %i", dc->gl.gl.maxVertexAttribs); - LOGV("MAX Uniforms %i, %i", dc->gl.gl.maxVertexUniformVectors, + ALOGV("MAX Attribs %i", dc->gl.gl.maxVertexAttribs); + ALOGV("MAX Uniforms %i, %i", dc->gl.gl.maxVertexUniformVectors, dc->gl.gl.maxFragmentUniformVectors); - LOGV("MAX Varyings %i", dc->gl.gl.maxVaryingVectors); + ALOGV("MAX Varyings %i", dc->gl.gl.maxVaryingVectors); } void rsdGLShutdown(const Context *rsc) { @@ -199,7 +199,7 @@ bool rsdGLInit(const Context *rsc) { configAttribsPtr[0] = EGL_NONE; rsAssert(configAttribsPtr < (configAttribs + (sizeof(configAttribs) / sizeof(EGLint)))); - LOGV("%p initEGL start", rsc); + ALOGV("%p initEGL start", rsc); rsc->setWatchdogGL("eglGetDisplay", __LINE__, __FILE__); dc->gl.egl.display = eglGetDisplay(EGL_DEFAULT_DISPLAY); checkEglError("eglGetDisplay"); @@ -223,7 +223,7 @@ bool rsdGLInit(const Context *rsc) { configAttribs, configs, numConfigs, &n); if (!ret || !n) { checkEglError("eglChooseConfig", ret); - LOGE("%p, couldn't find an EGLConfig matching the screen format\n", rsc); + ALOGE("%p, couldn't find an EGLConfig matching the screen format\n", rsc); } // The first config is guaranteed to over-satisfy the constraints @@ -268,7 +268,7 @@ bool rsdGLInit(const Context *rsc) { EGL_NO_CONTEXT, context_attribs2); checkEglError("eglCreateContext"); if (dc->gl.egl.context == EGL_NO_CONTEXT) { - LOGE("%p, eglCreateContext returned EGL_NO_CONTEXT", rsc); + ALOGE("%p, eglCreateContext returned EGL_NO_CONTEXT", rsc); rsc->setWatchdogGL(NULL, 0, NULL); return false; } @@ -281,7 +281,7 @@ bool rsdGLInit(const Context *rsc) { pbuffer_attribs); checkEglError("eglCreatePbufferSurface"); if (dc->gl.egl.surfaceDefault == EGL_NO_SURFACE) { - LOGE("eglCreatePbufferSurface returned EGL_NO_SURFACE"); + ALOGE("eglCreatePbufferSurface returned EGL_NO_SURFACE"); rsdGLShutdown(rsc); rsc->setWatchdogGL(NULL, 0, NULL); return false; @@ -291,7 +291,7 @@ bool rsdGLInit(const Context *rsc) { ret = eglMakeCurrent(dc->gl.egl.display, dc->gl.egl.surfaceDefault, dc->gl.egl.surfaceDefault, dc->gl.egl.context); if (ret == EGL_FALSE) { - LOGE("eglMakeCurrent returned EGL_FALSE"); + ALOGE("eglMakeCurrent returned EGL_FALSE"); checkEglError("eglMakeCurrent", ret); rsdGLShutdown(rsc); rsc->setWatchdogGL(NULL, 0, NULL); @@ -303,11 +303,11 @@ bool rsdGLInit(const Context *rsc) { dc->gl.gl.renderer = glGetString(GL_RENDERER); dc->gl.gl.extensions = glGetString(GL_EXTENSIONS); - //LOGV("EGL Version %i %i", mEGL.mMajorVersion, mEGL.mMinorVersion); - //LOGV("GL Version %s", mGL.mVersion); - //LOGV("GL Vendor %s", mGL.mVendor); - //LOGV("GL Renderer %s", mGL.mRenderer); - //LOGV("GL Extensions %s", mGL.mExtensions); + //ALOGV("EGL Version %i %i", mEGL.mMajorVersion, mEGL.mMinorVersion); + //ALOGV("GL Version %s", mGL.mVersion); + //ALOGV("GL Vendor %s", mGL.mVendor); + //ALOGV("GL Renderer %s", mGL.mRenderer); + //ALOGV("GL Extensions %s", mGL.mExtensions); const char *verptr = NULL; if (strlen((const char *)dc->gl.gl.version) > 9) { @@ -320,7 +320,7 @@ bool rsdGLInit(const Context *rsc) { } if (!verptr) { - LOGE("Error, OpenGL ES Lite not supported"); + ALOGE("Error, OpenGL ES Lite not supported"); rsdGLShutdown(rsc); rsc->setWatchdogGL(NULL, 0, NULL); return false; @@ -360,7 +360,7 @@ bool rsdGLInit(const Context *rsc) { dc->gl.vertexArrayState->init(dc->gl.gl.maxVertexAttribs); dc->gl.currentFrameBuffer = NULL; - LOGV("%p initGLThread end", rsc); + ALOGV("%p initGLThread end", rsc); rsc->setWatchdogGL(NULL, 0, NULL); return true; } @@ -402,7 +402,7 @@ bool rsdGLSetSurface(const Context *rsc, uint32_t w, uint32_t h, RsNativeWindow dc->gl.wndSurface, NULL); checkEglError("eglCreateWindowSurface"); if (dc->gl.egl.surface == EGL_NO_SURFACE) { - LOGE("eglCreateWindowSurface returned EGL_NO_SURFACE"); + ALOGE("eglCreateWindowSurface returned EGL_NO_SURFACE"); } rsc->setWatchdogGL("eglMakeCurrent", __LINE__, __FILE__); @@ -439,7 +439,7 @@ void rsdGLCheckError(const android::renderscript::Context *rsc, } } - LOGE("%p, %s", rsc, buf); + ALOGE("%p, %s", rsc, buf); } } diff --git a/libs/rs/driver/rsdMeshObj.cpp b/libs/rs/driver/rsdMeshObj.cpp index 24a7183..99d79dc 100644 --- a/libs/rs/driver/rsdMeshObj.cpp +++ b/libs/rs/driver/rsdMeshObj.cpp @@ -133,7 +133,7 @@ bool RsdMeshObj::init() { void RsdMeshObj::renderPrimitiveRange(const Context *rsc, uint32_t primIndex, uint32_t start, uint32_t len) const { if (len < 1 || primIndex >= mRSMesh->mHal.state.primitivesCount || mAttribCount == 0) { - LOGE("Invalid mesh or parameters"); + ALOGE("Invalid mesh or parameters"); return; } diff --git a/libs/rs/driver/rsdProgram.cpp b/libs/rs/driver/rsdProgram.cpp index 7556e50..54484df 100644 --- a/libs/rs/driver/rsdProgram.cpp +++ b/libs/rs/driver/rsdProgram.cpp @@ -68,7 +68,7 @@ void rsdProgramVertexDestroy(const Context *rsc, const ProgramVertex *pv) { if(pv->mHal.drv) { drv = (RsdShader*)pv->mHal.drv; if (rsc->props.mLogShaders) { - LOGV("Destroying vertex shader with ID %u", drv->getShaderID()); + ALOGV("Destroying vertex shader with ID %u", drv->getShaderID()); } if (drv->getShaderID()) { dc->gl.shaderCache->cleanupVertex(drv->getShaderID()); @@ -99,7 +99,7 @@ void rsdProgramFragmentDestroy(const Context *rsc, const ProgramFragment *pf) { if(pf->mHal.drv) { drv = (RsdShader*)pf->mHal.drv; if (rsc->props.mLogShaders) { - LOGV("Destroying fragment shader with ID %u", drv->getShaderID()); + ALOGV("Destroying fragment shader with ID %u", drv->getShaderID()); } if (drv->getShaderID()) { dc->gl.shaderCache->cleanupFragment(drv->getShaderID()); diff --git a/libs/rs/driver/rsdProgramStore.cpp b/libs/rs/driver/rsdProgramStore.cpp index af44b02..fca9ba9 100644 --- a/libs/rs/driver/rsdProgramStore.cpp +++ b/libs/rs/driver/rsdProgramStore.cpp @@ -70,7 +70,7 @@ bool rsdProgramStoreInit(const Context *rsc, const ProgramStore *ps) { drv->depthFunc = GL_NOTEQUAL; break; default: - LOGE("Unknown depth function."); + ALOGE("Unknown depth function."); goto error; } @@ -111,7 +111,7 @@ bool rsdProgramStoreInit(const Context *rsc, const ProgramStore *ps) { drv->blendSrc = GL_SRC_ALPHA_SATURATE; break; default: - LOGE("Unknown blend src mode."); + ALOGE("Unknown blend src mode."); goto error; } @@ -141,7 +141,7 @@ bool rsdProgramStoreInit(const Context *rsc, const ProgramStore *ps) { drv->blendDst = GL_ONE_MINUS_DST_ALPHA; break; default: - LOGE("Unknown blend dst mode."); + ALOGE("Unknown blend dst mode."); goto error; } diff --git a/libs/rs/driver/rsdRuntimeMath.cpp b/libs/rs/driver/rsdRuntimeMath.cpp index d29da7e..4c300b7 100644 --- a/libs/rs/driver/rsdRuntimeMath.cpp +++ b/libs/rs/driver/rsdRuntimeMath.cpp @@ -120,7 +120,7 @@ static float SC_min_f32(float v, float v2) { } static float SC_mix_f32(float start, float stop, float amount) { - //LOGE("lerpf %f %f %f", start, stop, amount); + //ALOGE("lerpf %f %f %f", start, stop, amount); return start + (stop - start) * amount; } diff --git a/libs/rs/driver/rsdRuntimeStubs.cpp b/libs/rs/driver/rsdRuntimeStubs.cpp index 90c8928..14c2970 100644 --- a/libs/rs/driver/rsdRuntimeStubs.cpp +++ b/libs/rs/driver/rsdRuntimeStubs.cpp @@ -439,51 +439,51 @@ unsigned int SC_umodsi3(unsigned int a, unsigned int b) { } static void SC_debugF(const char *s, float f) { - LOGD("%s %f, 0x%08x", s, f, *((int *) (&f))); + ALOGD("%s %f, 0x%08x", s, f, *((int *) (&f))); } static void SC_debugFv2(const char *s, float f1, float f2) { - LOGD("%s {%f, %f}", s, f1, f2); + ALOGD("%s {%f, %f}", s, f1, f2); } static void SC_debugFv3(const char *s, float f1, float f2, float f3) { - LOGD("%s {%f, %f, %f}", s, f1, f2, f3); + ALOGD("%s {%f, %f, %f}", s, f1, f2, f3); } static void SC_debugFv4(const char *s, float f1, float f2, float f3, float f4) { - LOGD("%s {%f, %f, %f, %f}", s, f1, f2, f3, f4); + ALOGD("%s {%f, %f, %f, %f}", s, f1, f2, f3, f4); } static void SC_debugD(const char *s, double d) { - LOGD("%s %f, 0x%08llx", s, d, *((long long *) (&d))); + ALOGD("%s %f, 0x%08llx", s, d, *((long long *) (&d))); } static void SC_debugFM4v4(const char *s, const float *f) { - LOGD("%s {%f, %f, %f, %f", s, f[0], f[4], f[8], f[12]); - LOGD("%s %f, %f, %f, %f", s, f[1], f[5], f[9], f[13]); - LOGD("%s %f, %f, %f, %f", s, f[2], f[6], f[10], f[14]); - LOGD("%s %f, %f, %f, %f}", s, f[3], f[7], f[11], f[15]); + ALOGD("%s {%f, %f, %f, %f", s, f[0], f[4], f[8], f[12]); + ALOGD("%s %f, %f, %f, %f", s, f[1], f[5], f[9], f[13]); + ALOGD("%s %f, %f, %f, %f", s, f[2], f[6], f[10], f[14]); + ALOGD("%s %f, %f, %f, %f}", s, f[3], f[7], f[11], f[15]); } static void SC_debugFM3v3(const char *s, const float *f) { - LOGD("%s {%f, %f, %f", s, f[0], f[3], f[6]); - LOGD("%s %f, %f, %f", s, f[1], f[4], f[7]); - LOGD("%s %f, %f, %f}",s, f[2], f[5], f[8]); + ALOGD("%s {%f, %f, %f", s, f[0], f[3], f[6]); + ALOGD("%s %f, %f, %f", s, f[1], f[4], f[7]); + ALOGD("%s %f, %f, %f}",s, f[2], f[5], f[8]); } static void SC_debugFM2v2(const char *s, const float *f) { - LOGD("%s {%f, %f", s, f[0], f[2]); - LOGD("%s %f, %f}",s, f[1], f[3]); + ALOGD("%s {%f, %f", s, f[0], f[2]); + ALOGD("%s %f, %f}",s, f[1], f[3]); } static void SC_debugI32(const char *s, int32_t i) { - LOGD("%s %i 0x%x", s, i, i); + ALOGD("%s %i 0x%x", s, i, i); } static void SC_debugU32(const char *s, uint32_t i) { - LOGD("%s %u 0x%x", s, i, i); + ALOGD("%s %u 0x%x", s, i, i); } static void SC_debugLL64(const char *s, long long ll) { - LOGD("%s %lld 0x%llx", s, ll, ll); + ALOGD("%s %lld 0x%llx", s, ll, ll); } static void SC_debugULL64(const char *s, unsigned long long ll) { - LOGD("%s %llu 0x%llx", s, ll, ll); + ALOGD("%s %llu 0x%llx", s, ll, ll); } static void SC_debugP(const char *s, const void *p) { - LOGD("%s %p", s, p); + ALOGD("%s %p", s, p); } @@ -686,7 +686,7 @@ void* rsdLookupRuntimeStub(void* pContext, char const* name) { s->mHal.info.isThreadable &= sym->threadable; return sym->mPtr; } - LOGE("ScriptC sym lookup failed for %s", name); + ALOGE("ScriptC sym lookup failed for %s", name); return NULL; } diff --git a/libs/rs/driver/rsdShader.cpp b/libs/rs/driver/rsdShader.cpp index bdb60c2..a10deb4 100644 --- a/libs/rs/driver/rsdShader.cpp +++ b/libs/rs/driver/rsdShader.cpp @@ -172,8 +172,8 @@ bool RsdShader::loadShader(const Context *rsc) { rsAssert(mShaderID); if (rsc->props.mLogShaders) { - LOGV("Loading shader type %x, ID %i", mType, mShaderID); - LOGV("%s", mShader.string()); + ALOGV("Loading shader type %x, ID %i", mType, mShaderID); + ALOGV("%s", mShader.string()); } if (mShaderID) { @@ -190,7 +190,7 @@ bool RsdShader::loadShader(const Context *rsc) { char* buf = (char*) malloc(infoLen); if (buf) { RSD_CALL_GL(glGetShaderInfoLog, mShaderID, infoLen, NULL, buf); - LOGE("Could not compile shader \n%s\n", buf); + ALOGE("Could not compile shader \n%s\n", buf); free(buf); } RSD_CALL_GL(glDeleteShader, mShaderID); @@ -202,7 +202,7 @@ bool RsdShader::loadShader(const Context *rsc) { } if (rsc->props.mLogShaders) { - LOGV("--Shader load result %x ", glGetError()); + ALOGV("--Shader load result %x ", glGetError()); } mIsValid = true; return true; @@ -252,44 +252,44 @@ void RsdShader::logUniform(const Element *field, const float *fd, uint32_t array uint32_t elementSize = field->getSizeBytes() / sizeof(float); for (uint32_t i = 0; i < arraySize; i ++) { if (arraySize > 1) { - LOGV("Array Element [%u]", i); + ALOGV("Array Element [%u]", i); } if (dataType == RS_TYPE_MATRIX_4X4) { - LOGV("Matrix4x4"); - LOGV("{%f, %f, %f, %f", fd[0], fd[4], fd[8], fd[12]); - LOGV(" %f, %f, %f, %f", fd[1], fd[5], fd[9], fd[13]); - LOGV(" %f, %f, %f, %f", fd[2], fd[6], fd[10], fd[14]); - LOGV(" %f, %f, %f, %f}", fd[3], fd[7], fd[11], fd[15]); + ALOGV("Matrix4x4"); + ALOGV("{%f, %f, %f, %f", fd[0], fd[4], fd[8], fd[12]); + ALOGV(" %f, %f, %f, %f", fd[1], fd[5], fd[9], fd[13]); + ALOGV(" %f, %f, %f, %f", fd[2], fd[6], fd[10], fd[14]); + ALOGV(" %f, %f, %f, %f}", fd[3], fd[7], fd[11], fd[15]); } else if (dataType == RS_TYPE_MATRIX_3X3) { - LOGV("Matrix3x3"); - LOGV("{%f, %f, %f", fd[0], fd[3], fd[6]); - LOGV(" %f, %f, %f", fd[1], fd[4], fd[7]); - LOGV(" %f, %f, %f}", fd[2], fd[5], fd[8]); + ALOGV("Matrix3x3"); + ALOGV("{%f, %f, %f", fd[0], fd[3], fd[6]); + ALOGV(" %f, %f, %f", fd[1], fd[4], fd[7]); + ALOGV(" %f, %f, %f}", fd[2], fd[5], fd[8]); } else if (dataType == RS_TYPE_MATRIX_2X2) { - LOGV("Matrix2x2"); - LOGV("{%f, %f", fd[0], fd[2]); - LOGV(" %f, %f}", fd[1], fd[3]); + ALOGV("Matrix2x2"); + ALOGV("{%f, %f", fd[0], fd[2]); + ALOGV(" %f, %f}", fd[1], fd[3]); } else { switch (field->getComponent().getVectorSize()) { case 1: - LOGV("Uniform 1 = %f", fd[0]); + ALOGV("Uniform 1 = %f", fd[0]); break; case 2: - LOGV("Uniform 2 = %f %f", fd[0], fd[1]); + ALOGV("Uniform 2 = %f %f", fd[0], fd[1]); break; case 3: - LOGV("Uniform 3 = %f %f %f", fd[0], fd[1], fd[2]); + ALOGV("Uniform 3 = %f %f %f", fd[0], fd[1], fd[2]); break; case 4: - LOGV("Uniform 4 = %f %f %f %f", fd[0], fd[1], fd[2], fd[3]); + ALOGV("Uniform 4 = %f %f %f %f", fd[0], fd[1], fd[2], fd[3]); break; default: rsAssert(0); } } - LOGE("Element size %u data=%p", elementSize, fd); + ALOGE("Element size %u data=%p", elementSize, fd); fd += elementSize; - LOGE("New data=%p", fd); + ALOGE("New data=%p", fd); } } @@ -404,7 +404,7 @@ void RsdShader::setupTextures(const Context *rsc, RsdShaderCache *sc) { uint32_t numTexturesToBind = mRSProgram->mHal.state.texturesCount; uint32_t numTexturesAvailable = dc->gl.gl.maxFragmentTextureImageUnits; if (numTexturesToBind >= numTexturesAvailable) { - LOGE("Attempting to bind %u textures on shader id %u, but only %u are available", + ALOGE("Attempting to bind %u textures on shader id %u, but only %u are available", mRSProgram->mHal.state.texturesCount, (uint32_t)this, numTexturesAvailable); rsc->setError(RS_ERROR_BAD_SHADER, "Cannot bind more textuers than available"); numTexturesToBind = numTexturesAvailable; @@ -422,7 +422,7 @@ void RsdShader::setupTextures(const Context *rsc, RsdShaderCache *sc) { DrvAllocation *drvTex = (DrvAllocation *)mRSProgram->mHal.state.textures[ct]->mHal.drv; if (drvTex->glTarget != GL_TEXTURE_2D && drvTex->glTarget != GL_TEXTURE_CUBE_MAP) { - LOGE("Attempting to bind unknown texture to shader id %u, texture unit %u", (uint)this, ct); + ALOGE("Attempting to bind unknown texture to shader id %u, texture unit %u", (uint)this, ct); rsc->setError(RS_ERROR_BAD_SHADER, "Non-texture allocation bound to a shader"); } RSD_CALL_GL(glBindTexture, drvTex->glTarget, drvTex->textureID); @@ -450,7 +450,7 @@ void RsdShader::setupUserConstants(const Context *rsc, RsdShaderCache *sc, bool for (uint32_t ct=0; ct < mRSProgram->mHal.state.constantsCount; ct++) { Allocation *alloc = mRSProgram->mHal.state.constants[ct]; if (!alloc) { - LOGE("Attempting to set constants on shader id %u, but alloc at slot %u is not set", + ALOGE("Attempting to set constants on shader id %u, but alloc at slot %u is not set", (uint32_t)this, ct); rsc->setError(RS_ERROR_BAD_SHADER, "No constant allocation bound"); continue; @@ -479,7 +479,7 @@ void RsdShader::setupUserConstants(const Context *rsc, RsdShaderCache *sc, bool arraySize = sc->fragUniformSize(uidx); } if (rsc->props.mLogShadersUniforms) { - LOGV("Uniform slot=%i, offset=%i, constant=%i, field=%i, uidx=%i, name=%s", + ALOGV("Uniform slot=%i, offset=%i, constant=%i, field=%i, uidx=%i, name=%s", slot, offset, ct, field, uidx, fieldName); } uidx ++; diff --git a/libs/rs/driver/rsdShaderCache.cpp b/libs/rs/driver/rsdShaderCache.cpp index d11490c..f6236e7 100644 --- a/libs/rs/driver/rsdShaderCache.cpp +++ b/libs/rs/driver/rsdShaderCache.cpp @@ -54,7 +54,7 @@ void RsdShaderCache::updateUniformArrayData(const Context *rsc, RsdShader *prog, } if (rsc->props.mLogShaders) { - LOGV("%s U, %s = %d, arraySize = %d\n", logTag, + ALOGV("%s U, %s = %d, arraySize = %d\n", logTag, prog->getUniformName(ct).string(), data[ct].slot, data[ct].arraySize); } } @@ -119,23 +119,23 @@ bool RsdShaderCache::link(const Context *rsc) { if (!vtx->getShaderID() || !frag->getShaderID()) { return false; } - //LOGV("rsdShaderCache lookup vtx %i, frag %i", vtx->getShaderID(), frag->getShaderID()); + //ALOGV("rsdShaderCache lookup vtx %i, frag %i", vtx->getShaderID(), frag->getShaderID()); uint32_t entryCount = mEntries.size(); for (uint32_t ct = 0; ct < entryCount; ct ++) { if ((mEntries[ct]->vtx == vtx->getShaderID()) && (mEntries[ct]->frag == frag->getShaderID())) { - //LOGV("SC using program %i", mEntries[ct]->program); + //ALOGV("SC using program %i", mEntries[ct]->program); glUseProgram(mEntries[ct]->program); mCurrent = mEntries[ct]; - //LOGV("RsdShaderCache hit, using %i", ct); + //ALOGV("RsdShaderCache hit, using %i", ct); rsdGLCheckError(rsc, "RsdShaderCache::link (hit)"); return true; } } - //LOGV("RsdShaderCache miss"); - //LOGE("e0 %x", glGetError()); + //ALOGV("RsdShaderCache miss"); + //ALOGE("e0 %x", glGetError()); ProgramEntry *e = new ProgramEntry(vtx->getAttribCount(), vtx->getUniformCount(), frag->getUniformCount()); @@ -147,7 +147,7 @@ bool RsdShaderCache::link(const Context *rsc) { if (e->program) { GLuint pgm = e->program; glAttachShader(pgm, vtx->getShaderID()); - //LOGE("e1 %x", glGetError()); + //ALOGE("e1 %x", glGetError()); glAttachShader(pgm, frag->getShaderID()); glBindAttribLocation(pgm, 0, "ATTRIB_position"); @@ -155,9 +155,9 @@ bool RsdShaderCache::link(const Context *rsc) { glBindAttribLocation(pgm, 2, "ATTRIB_normal"); glBindAttribLocation(pgm, 3, "ATTRIB_texture0"); - //LOGE("e2 %x", glGetError()); + //ALOGE("e2 %x", glGetError()); glLinkProgram(pgm); - //LOGE("e3 %x", glGetError()); + //ALOGE("e3 %x", glGetError()); GLint linkStatus = GL_FALSE; glGetProgramiv(pgm, GL_LINK_STATUS, &linkStatus); if (linkStatus != GL_TRUE) { @@ -167,7 +167,7 @@ bool RsdShaderCache::link(const Context *rsc) { char* buf = (char*) malloc(bufLength); if (buf) { glGetProgramInfoLog(pgm, bufLength, NULL, buf); - LOGE("Could not link program:\n%s\n", buf); + ALOGE("Could not link program:\n%s\n", buf); free(buf); } } @@ -180,7 +180,7 @@ bool RsdShaderCache::link(const Context *rsc) { e->vtxAttrs[ct].slot = glGetAttribLocation(pgm, vtx->getAttribName(ct)); e->vtxAttrs[ct].name = vtx->getAttribName(ct).string(); if (rsc->props.mLogShaders) { - LOGV("vtx A %i, %s = %d\n", ct, vtx->getAttribName(ct).string(), e->vtxAttrs[ct].slot); + ALOGV("vtx A %i, %s = %d\n", ct, vtx->getAttribName(ct).string(), e->vtxAttrs[ct].slot); } } @@ -205,7 +205,7 @@ bool RsdShaderCache::link(const Context *rsc) { glGetActiveUniform(pgm, ct, maxNameLength, &uniformList[ct]->writtenLength, &uniformList[ct]->arraySize, &uniformList[ct]->type, uniformList[ct]->name); - //LOGE("GL UNI idx=%u, arraySize=%u, name=%s", ct, + //ALOGE("GL UNI idx=%u, arraySize=%u, name=%s", ct, // uniformList[ct]->arraySize, uniformList[ct]->name); } } @@ -229,7 +229,7 @@ bool RsdShaderCache::link(const Context *rsc) { } } - //LOGV("SC made program %i", e->program); + //ALOGV("SC made program %i", e->program); glUseProgram(e->program); rsdGLCheckError(rsc, "RsdShaderCache::link (miss)"); diff --git a/libs/rs/driver/rsdVertexArray.cpp b/libs/rs/driver/rsdVertexArray.cpp index 62ec107..1836e67 100644 --- a/libs/rs/driver/rsdVertexArray.cpp +++ b/libs/rs/driver/rsdVertexArray.cpp @@ -65,9 +65,9 @@ void RsdVertexArray::Attrib::set(uint32_t type, uint32_t size, uint32_t stride, void RsdVertexArray::logAttrib(uint32_t idx, uint32_t slot) const { if (idx == 0) { - LOGV("Starting vertex attribute binding"); + ALOGV("Starting vertex attribute binding"); } - LOGV("va %i: slot=%i name=%s buf=%i ptr=%p size=%i type=0x%x stride=0x%x norm=%i offset=0x%x", + ALOGV("va %i: slot=%i name=%s buf=%i ptr=%p size=%i type=0x%x stride=0x%x norm=%i offset=0x%x", idx, slot, mAttribs[idx].name.string(), mAttribs[idx].buffer, diff --git a/libs/rs/rsAdapter.cpp b/libs/rs/rsAdapter.cpp index 6e8ca70..177fb60 100644 --- a/libs/rs/rsAdapter.cpp +++ b/libs/rs/rsAdapter.cpp @@ -140,7 +140,7 @@ void * Adapter2D::getElement(uint32_t x, uint32_t y) const { rsAssert(mAllocation->getPtr()); rsAssert(mAllocation->getType()); if (mFace != 0 && !mAllocation->getType()->getDimFaces()) { - LOGE("Adapter wants cubemap face, but allocation has none"); + ALOGE("Adapter wants cubemap face, but allocation has none"); return NULL; } diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp index e732630..7b92b39 100644 --- a/libs/rs/rsAllocation.cpp +++ b/libs/rs/rsAllocation.cpp @@ -75,7 +75,7 @@ void Allocation::data(Context *rsc, uint32_t xoff, uint32_t lod, const uint32_t eSize = mHal.state.type->getElementSizeBytes(); if ((count * eSize) != sizeBytes) { - LOGE("Allocation::subData called with mismatched size expected %i, got %i", + ALOGE("Allocation::subData called with mismatched size expected %i, got %i", (count * eSize), sizeBytes); mHal.state.type->dumpLOGV("type info"); return; @@ -90,10 +90,10 @@ void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, const uint32_t eSize = mHal.state.elementSizeBytes; const uint32_t lineSize = eSize * w; - //LOGE("data2d %p, %i %i %i %i %i %i %p %i", this, xoff, yoff, lod, face, w, h, data, sizeBytes); + //ALOGE("data2d %p, %i %i %i %i %i %i %p %i", this, xoff, yoff, lod, face, w, h, data, sizeBytes); if ((lineSize * h) != sizeBytes) { - LOGE("Allocation size mismatch, expected %i, got %i", (lineSize * h), sizeBytes); + ALOGE("Allocation size mismatch, expected %i, got %i", (lineSize * h), sizeBytes); rsAssert(!"Allocation::subData called with mismatched size"); return; } @@ -112,20 +112,20 @@ void Allocation::elementData(Context *rsc, uint32_t x, const void *data, uint32_t eSize = mHal.state.elementSizeBytes; if (cIdx >= mHal.state.type->getElement()->getFieldCount()) { - LOGE("Error Allocation::subElementData component %i out of range.", cIdx); + ALOGE("Error Allocation::subElementData component %i out of range.", cIdx); rsc->setError(RS_ERROR_BAD_VALUE, "subElementData component out of range."); return; } if (x >= mHal.state.dimensionX) { - LOGE("Error Allocation::subElementData X offset %i out of range.", x); + ALOGE("Error Allocation::subElementData X offset %i out of range.", x); rsc->setError(RS_ERROR_BAD_VALUE, "subElementData X offset out of range."); return; } const Element * e = mHal.state.type->getElement()->getField(cIdx); if (sizeBytes != e->getSizeBytes()) { - LOGE("Error Allocation::subElementData data size %i does not match field size %zu.", sizeBytes, e->getSizeBytes()); + ALOGE("Error Allocation::subElementData data size %i does not match field size %zu.", sizeBytes, e->getSizeBytes()); rsc->setError(RS_ERROR_BAD_VALUE, "subElementData bad size."); return; } @@ -139,19 +139,19 @@ void Allocation::elementData(Context *rsc, uint32_t x, uint32_t y, uint32_t eSize = mHal.state.elementSizeBytes; if (x >= mHal.state.dimensionX) { - LOGE("Error Allocation::subElementData X offset %i out of range.", x); + ALOGE("Error Allocation::subElementData X offset %i out of range.", x); rsc->setError(RS_ERROR_BAD_VALUE, "subElementData X offset out of range."); return; } if (y >= mHal.state.dimensionY) { - LOGE("Error Allocation::subElementData X offset %i out of range.", x); + ALOGE("Error Allocation::subElementData X offset %i out of range.", x); rsc->setError(RS_ERROR_BAD_VALUE, "subElementData X offset out of range."); return; } if (cIdx >= mHal.state.type->getElement()->getFieldCount()) { - LOGE("Error Allocation::subElementData component %i out of range.", cIdx); + ALOGE("Error Allocation::subElementData component %i out of range.", cIdx); rsc->setError(RS_ERROR_BAD_VALUE, "subElementData component out of range."); return; } @@ -159,7 +159,7 @@ void Allocation::elementData(Context *rsc, uint32_t x, uint32_t y, const Element * e = mHal.state.type->getElement()->getField(cIdx); if (sizeBytes != e->getSizeBytes()) { - LOGE("Error Allocation::subElementData data size %i does not match field size %zu.", sizeBytes, e->getSizeBytes()); + ALOGE("Error Allocation::subElementData data size %i does not match field size %zu.", sizeBytes, e->getSizeBytes()); rsc->setError(RS_ERROR_BAD_VALUE, "subElementData bad size."); return; } @@ -191,7 +191,7 @@ void Allocation::dumpLOGV(const char *prefix) const { mHal.state.type->dumpLOGV(s.string()); } - LOGV("%s allocation ptr=%p mUsageFlags=0x04%x, mMipmapControl=0x%04x", + ALOGV("%s allocation ptr=%p mUsageFlags=0x04%x, mMipmapControl=0x%04x", prefix, getPtr(), mHal.state.usageFlags, mHal.state.mipmapControl); } @@ -217,7 +217,7 @@ Allocation *Allocation::createFromStream(Context *rsc, IStream *stream) { // First make sure we are reading the correct object RsA3DClassID classID = (RsA3DClassID)stream->loadU32(); if (classID != RS_A3D_CLASS_ID_ALLOCATION) { - LOGE("allocation loading skipped due to invalid class id\n"); + ALOGE("allocation loading skipped due to invalid class id\n"); return NULL; } @@ -233,7 +233,7 @@ Allocation *Allocation::createFromStream(Context *rsc, IStream *stream) { // Number of bytes we wrote out for this allocation uint32_t dataSize = stream->loadU32(); if (dataSize != type->getSizeBytes()) { - LOGE("failed to read allocation because numbytes written is not the same loaded type wants\n"); + ALOGE("failed to read allocation because numbytes written is not the same loaded type wants\n"); ObjectBase::checkDelete(type); return NULL; } @@ -319,7 +319,7 @@ void Allocation::resize1D(Context *rsc, uint32_t dimX) { } void Allocation::resize2D(Context *rsc, uint32_t dimX, uint32_t dimY) { - LOGE("not implemented"); + ALOGE("not implemented"); } ///////////////// @@ -497,7 +497,7 @@ RsAllocation rsi_AllocationCreateFromBitmap(Context *rsc, RsType vtype, RsAllocation vTexAlloc = rsi_AllocationCreateTyped(rsc, vtype, mips, usages); Allocation *texAlloc = static_cast<Allocation *>(vTexAlloc); if (texAlloc == NULL) { - LOGE("Memory allocation failure"); + ALOGE("Memory allocation failure"); return NULL; } @@ -521,7 +521,7 @@ RsAllocation rsi_AllocationCubeCreateFromBitmap(Context *rsc, RsType vtype, RsAllocation vTexAlloc = rsi_AllocationCreateTyped(rsc, vtype, mips, usages); Allocation *texAlloc = static_cast<Allocation *>(vTexAlloc); if (texAlloc == NULL) { - LOGE("Memory allocation failure"); + ALOGE("Memory allocation failure"); return NULL; } diff --git a/libs/rs/rsAnimation.cpp b/libs/rs/rsAnimation.cpp index 48b4f02..a4093d9 100644 --- a/libs/rs/rsAnimation.cpp +++ b/libs/rs/rsAnimation.cpp @@ -126,7 +126,7 @@ RsAnimation rsi_AnimationCreate(Context *rsc, RsAnimationInterpolation interp, RsAnimationEdge pre, RsAnimationEdge post) { - //LOGE("rsi_ElementCreate %i %i %i %i", dt, dk, norm, vecSize); + //ALOGE("rsi_ElementCreate %i %i %i %i", dt, dk, norm, vecSize); Animation *a = NULL;//Animation::create(rsc, inValues, outValues, valueCount, interp, pre, post); if (a != NULL) { a->incUserRef(); diff --git a/libs/rs/rsComponent.cpp b/libs/rs/rsComponent.cpp index ce06306..7d9cf0b 100644 --- a/libs/rs/rsComponent.cpp +++ b/libs/rs/rsComponent.cpp @@ -228,10 +228,10 @@ static const char * gKindStrings[] = { void Component::dumpLOGV(const char *prefix) const { if (mType >= RS_TYPE_ELEMENT) { - LOGV("%s Component: %s, %s, vectorSize=%i, bits=%i", + ALOGV("%s Component: %s, %s, vectorSize=%i, bits=%i", prefix, gTypeObjStrings[mType - RS_TYPE_ELEMENT], gKindStrings[mKind], mVectorSize, mBits); } else { - LOGV("%s Component: %s, %s, vectorSize=%i, bits=%i", + ALOGV("%s Component: %s, %s, vectorSize=%i, bits=%i", prefix, gTypeBasicStrings[mType], gKindStrings[mKind], mVectorSize, mBits); } } diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index 5291a1f..54fe529 100644 --- a/libs/rs/rsContext.cpp +++ b/libs/rs/rsContext.cpp @@ -40,7 +40,7 @@ bool Context::initGLThread() { if (!mHal.funcs.initGraphics(this)) { pthread_mutex_unlock(&gInitMutex); - LOGE("%p initGraphics failed", this); + ALOGE("%p initGraphics failed", this); return false; } @@ -152,7 +152,7 @@ void Context::timerPrint() { if (props.mLogTimes) { - LOGV("RS: Frame (%i), Script %2.1f%% (%i), Swap %2.1f%% (%i), Idle %2.1f%% (%lli), Internal %2.1f%% (%lli), Avg fps: %u", + ALOGV("RS: Frame (%i), Script %2.1f%% (%i), Swap %2.1f%% (%i), Idle %2.1f%% (%lli), Internal %2.1f%% (%lli), Avg fps: %u", mTimeMSLastFrame, 100.0 * mTimers[RS_TIMER_SCRIPT] / total, mTimeMSLastScript, 100.0 * mTimers[RS_TIMER_CLEAR_SWAP] / total, mTimeMSLastSwap, @@ -219,7 +219,7 @@ void * Context::threadProc(void *vrsc) { if (!rsdHalInit(rsc, 0, 0)) { rsc->setError(RS_ERROR_FATAL_DRIVER, "Failed initializing GL"); - LOGE("Hal init failed"); + ALOGE("Hal init failed"); return NULL; } rsc->mHal.funcs.setPriority(rsc, rsc->mThreadPriority); @@ -284,7 +284,7 @@ void * Context::threadProc(void *vrsc) { } } - LOGV("%p RS Thread exiting", rsc); + ALOGV("%p RS Thread exiting", rsc); if (rsc->mIsGraphicsContext) { pthread_mutex_lock(&gInitMutex); @@ -292,12 +292,12 @@ void * Context::threadProc(void *vrsc) { pthread_mutex_unlock(&gInitMutex); } - LOGV("%p RS Thread exited", rsc); + ALOGV("%p RS Thread exited", rsc); return NULL; } void Context::destroyWorkerThreadResources() { - //LOGV("destroyWorkerThreadResources 1"); + //ALOGV("destroyWorkerThreadResources 1"); ObjectBase::zeroAllUserRef(this); if (mIsGraphicsContext) { mRaster.clear(); @@ -315,17 +315,17 @@ void Context::destroyWorkerThreadResources() { mFBOCache.deinit(this); } ObjectBase::freeAllChildren(this); - //LOGV("destroyWorkerThreadResources 2"); + //ALOGV("destroyWorkerThreadResources 2"); mExit = true; } void Context::printWatchdogInfo(void *ctx) { Context *rsc = (Context *)ctx; if (rsc->watchdog.command && rsc->watchdog.file) { - LOGE("RS watchdog timeout: %i %s line %i %s", rsc->watchdog.inRoot, + ALOGE("RS watchdog timeout: %i %s line %i %s", rsc->watchdog.inRoot, rsc->watchdog.command, rsc->watchdog.line, rsc->watchdog.file); } else { - LOGE("RS watchdog timeout: %i", rsc->watchdog.inRoot); + ALOGE("RS watchdog timeout: %i", rsc->watchdog.inRoot); } } @@ -403,7 +403,7 @@ bool Context::initContext(Device *dev, const RsSurfaceConfig *sc) { status = pthread_attr_init(&threadAttr); if (status) { - LOGE("Failed to init thread attribute."); + ALOGE("Failed to init thread attribute."); return false; } @@ -414,7 +414,7 @@ bool Context::initContext(Device *dev, const RsSurfaceConfig *sc) { status = pthread_create(&mThreadId, &threadAttr, threadProc, this); if (status) { - LOGE("Failed to start rs context thread."); + ALOGE("Failed to start rs context thread."); return false; } while (!mRunning && (mError == RS_ERROR_NONE)) { @@ -422,7 +422,7 @@ bool Context::initContext(Device *dev, const RsSurfaceConfig *sc) { } if (mError != RS_ERROR_NONE) { - LOGE("Errors during thread init"); + ALOGE("Errors during thread init"); return false; } @@ -431,7 +431,7 @@ bool Context::initContext(Device *dev, const RsSurfaceConfig *sc) { } Context::~Context() { - LOGV("%p Context::~Context", this); + ALOGV("%p Context::~Context", this); if (!mIsContextLite) { mIO.coreFlush(); @@ -455,7 +455,7 @@ Context::~Context() { } pthread_mutex_unlock(&gInitMutex); } - LOGV("%p Context::~Context done", this); + ALOGV("%p Context::~Context done", this); } void Context::setSurface(uint32_t w, uint32_t h, RsNativeWindow sur) { @@ -578,12 +578,12 @@ void Context::setError(RsError e, const char *msg) const { void Context::dumpDebug() const { - LOGE("RS Context debug %p", this); - LOGE("RS Context debug"); + ALOGE("RS Context debug %p", this); + ALOGE("RS Context debug"); - LOGE(" RS width %i, height %i", mWidth, mHeight); - LOGE(" RS running %i, exit %i, paused %i", mRunning, mExit, mPaused); - LOGE(" RS pThreadID %li, nativeThreadID %i", (long int)mThreadId, mNativeThreadId); + ALOGE(" RS width %i, height %i", mWidth, mHeight); + ALOGE(" RS running %i, exit %i, paused %i", mRunning, mExit, mPaused); + ALOGE(" RS pThreadID %li, nativeThreadID %i", (long int)mThreadId, mNativeThreadId); } /////////////////////////////////////////////////////////////////////////////////////////// @@ -604,7 +604,7 @@ void rsi_ContextBindSampler(Context *rsc, uint32_t slot, RsSampler vs) { Sampler *s = static_cast<Sampler *>(vs); if (slot > RS_MAX_SAMPLER_SLOT) { - LOGE("Invalid sampler slot"); + ALOGE("Invalid sampler slot"); return; } @@ -672,10 +672,10 @@ void rsi_ContextDestroyWorker(Context *rsc) { } void rsi_ContextDestroy(Context *rsc) { - LOGV("%p rsContextDestroy", rsc); + ALOGV("%p rsContextDestroy", rsc); rsContextDestroyWorker(rsc); delete rsc; - LOGV("%p rsContextDestroy done", rsc); + ALOGV("%p rsContextDestroy done", rsc); } @@ -706,7 +706,7 @@ void rsi_ContextDeinitToClient(Context *rsc) { RsContext rsContextCreate(RsDevice vdev, uint32_t version, uint32_t sdkVersion) { - LOGV("rsContextCreate dev=%p", vdev); + ALOGV("rsContextCreate dev=%p", vdev); Device * dev = static_cast<Device *>(vdev); Context *rsc = Context::createContext(dev, NULL); if (rsc) { @@ -718,14 +718,14 @@ RsContext rsContextCreate(RsDevice vdev, uint32_t version, RsContext rsContextCreateGL(RsDevice vdev, uint32_t version, uint32_t sdkVersion, RsSurfaceConfig sc, uint32_t dpi) { - LOGV("rsContextCreateGL dev=%p", vdev); + ALOGV("rsContextCreateGL dev=%p", vdev); Device * dev = static_cast<Device *>(vdev); Context *rsc = Context::createContext(dev, &sc); if (rsc) { rsc->setTargetSdkVersion(sdkVersion); rsc->setDPI(dpi); } - LOGV("%p rsContextCreateGL ret", rsc); + ALOGV("%p rsContextCreateGL ret", rsc); return rsc; } diff --git a/libs/rs/rsContext.h b/libs/rs/rsContext.h index 199cc5a..35221e0 100644 --- a/libs/rs/rsContext.h +++ b/libs/rs/rsContext.h @@ -50,13 +50,13 @@ namespace renderscript { #define CHECK_OBJ(o) { \ GET_TLS(); \ if (!ObjectBase::isValid(rsc, (const ObjectBase *)o)) { \ - LOGE("Bad object %p at %s, %i", o, __FILE__, __LINE__); \ + ALOGE("Bad object %p at %s, %i", o, __FILE__, __LINE__); \ } \ } #define CHECK_OBJ_OR_NULL(o) { \ GET_TLS(); \ if (o && !ObjectBase::isValid(rsc, (const ObjectBase *)o)) { \ - LOGE("Bad object %p at %s, %i", o, __FILE__, __LINE__); \ + ALOGE("Bad object %p at %s, %i", o, __FILE__, __LINE__); \ } \ } #else diff --git a/libs/rs/rsElement.cpp b/libs/rs/rsElement.cpp index 71e1b91..b65f380 100644 --- a/libs/rs/rsElement.cpp +++ b/libs/rs/rsElement.cpp @@ -62,11 +62,11 @@ size_t Element::getSizeBits() const { void Element::dumpLOGV(const char *prefix) const { ObjectBase::dumpLOGV(prefix); - LOGV("%s Element: fieldCount: %zu, size bytes: %zu", prefix, mFieldCount, getSizeBytes()); + ALOGV("%s Element: fieldCount: %zu, size bytes: %zu", prefix, mFieldCount, getSizeBytes()); mComponent.dumpLOGV(prefix); for (uint32_t ct = 0; ct < mFieldCount; ct++) { - LOGV("%s Element field index: %u ------------------", prefix, ct); - LOGV("%s name: %s, offsetBits: %u, arraySize: %u", + ALOGV("%s Element field index: %u ------------------", prefix, ct); + ALOGV("%s name: %s, offsetBits: %u, arraySize: %u", prefix, mFields[ct].name.string(), mFields[ct].offsetBits, mFields[ct].arraySize); mFields[ct].e->dumpLOGV(prefix); } @@ -94,7 +94,7 @@ Element *Element::createFromStream(Context *rsc, IStream *stream) { // First make sure we are reading the correct object RsA3DClassID classID = (RsA3DClassID)stream->loadU32(); if (classID != RS_A3D_CLASS_ID_ELEMENT) { - LOGE("element loading skipped due to invalid class id\n"); + ALOGE("element loading skipped due to invalid class id\n"); return NULL; } diff --git a/libs/rs/rsFBOCache.cpp b/libs/rs/rsFBOCache.cpp index f4a8bc6..d50f3e0 100644 --- a/libs/rs/rsFBOCache.cpp +++ b/libs/rs/rsFBOCache.cpp @@ -46,12 +46,12 @@ void FBOCache::deinit(Context *rsc) { void FBOCache::bindColorTarget(Context *rsc, Allocation *a, uint32_t slot) { if (slot >= mHal.state.colorTargetsCount) { - LOGE("Invalid render target index"); + ALOGE("Invalid render target index"); return; } if (a != NULL) { if (!a->getIsTexture()) { - LOGE("Invalid Color Target"); + ALOGE("Invalid Color Target"); return; } } @@ -63,7 +63,7 @@ void FBOCache::bindColorTarget(Context *rsc, Allocation *a, uint32_t slot) { void FBOCache::bindDepthTarget(Context *rsc, Allocation *a) { if (a != NULL) { if (!a->getIsRenderTarget()) { - LOGE("Invalid Depth Target"); + ALOGE("Invalid Depth Target"); return; } } diff --git a/libs/rs/rsFifoSocket.cpp b/libs/rs/rsFifoSocket.cpp index 8b8008d..163a44b 100644 --- a/libs/rs/rsFifoSocket.cpp +++ b/libs/rs/rsFifoSocket.cpp @@ -48,31 +48,31 @@ void FifoSocket::writeAsync(const void *data, size_t bytes) { if (bytes == 0) { return; } - //LOGE("writeAsync %p %i", data, bytes); + //ALOGE("writeAsync %p %i", data, bytes); size_t ret = ::send(sv[0], data, bytes, 0); - //LOGE("writeAsync ret %i", ret); + //ALOGE("writeAsync ret %i", ret); rsAssert(ret == bytes); } void FifoSocket::writeWaitReturn(void *retData, size_t retBytes) { - //LOGE("writeWaitReturn %p %i", retData, retBytes); + //ALOGE("writeWaitReturn %p %i", retData, retBytes); size_t ret = ::recv(sv[0], retData, retBytes, 0); - //LOGE("writeWaitReturn %i", ret); + //ALOGE("writeWaitReturn %i", ret); rsAssert(ret == retBytes); } size_t FifoSocket::read(void *data, size_t bytes) { - //LOGE("read %p %i", data, bytes); + //ALOGE("read %p %i", data, bytes); size_t ret = ::recv(sv[1], data, bytes, 0); rsAssert(ret == bytes); - //LOGE("read ret %i", ret); + //ALOGE("read ret %i", ret); return ret; } void FifoSocket::readReturn(const void *data, size_t bytes) { - LOGE("readReturn %p %Zu", data, bytes); + ALOGE("readReturn %p %Zu", data, bytes); size_t ret = ::send(sv[1], data, bytes, 0); - LOGE("readReturn %Zu", ret); + ALOGE("readReturn %Zu", ret); rsAssert(ret == bytes); } diff --git a/libs/rs/rsFileA3D.cpp b/libs/rs/rsFileA3D.cpp index df5dc12..ac658c8 100644 --- a/libs/rs/rsFileA3D.cpp +++ b/libs/rs/rsFileA3D.cpp @@ -68,7 +68,7 @@ void FileA3D::parseHeader(IStream *headerStream) { for (uint32_t i = 0; i < numIndexEntries; i ++) { A3DIndexEntry *entry = new A3DIndexEntry(); headerStream->loadString(&entry->mObjectName); - //LOGV("Header data, entry name = %s", entry->mObjectName.string()); + //ALOGV("Header data, entry name = %s", entry->mObjectName.string()); entry->mType = (RsA3DClassID)headerStream->loadU32(); if (mUse64BitOffsets){ entry->mOffset = headerStream->loadOffset(); @@ -145,7 +145,7 @@ bool FileA3D::load(FILE *f) { char magicString[12]; size_t len; - LOGV("file open 1"); + ALOGV("file open 1"); len = fread(magicString, 1, 12, f); if ((len != 12) || memcmp(magicString, "Android3D_ff", 12)) { @@ -181,7 +181,7 @@ bool FileA3D::load(FILE *f) { return false; } - LOGV("file open size = %lli", mDataSize); + ALOGV("file open size = %lli", mDataSize); // We should know enough to read the file in at this point. mAlloc = malloc(mDataSize); @@ -196,7 +196,7 @@ bool FileA3D::load(FILE *f) { mReadStream = new IStream(mData, mUse64BitOffsets); - LOGV("Header is read an stream initialized"); + ALOGV("Header is read an stream initialized"); return true; } @@ -278,17 +278,17 @@ ObjectBase *FileA3D::initializeFromEntry(size_t index) { bool FileA3D::writeFile(const char *filename) { if (!mWriteStream) { - LOGE("No objects to write\n"); + ALOGE("No objects to write\n"); return false; } if (mWriteStream->getPos() == 0) { - LOGE("No objects to write\n"); + ALOGE("No objects to write\n"); return false; } FILE *writeHandle = fopen(filename, "wb"); if (!writeHandle) { - LOGE("Couldn't open the file for writing\n"); + ALOGE("Couldn't open the file for writing\n"); return false; } @@ -335,7 +335,7 @@ bool FileA3D::writeFile(const char *filename) { int status = fclose(writeHandle); if (status != 0) { - LOGE("Couldn't close file\n"); + ALOGE("Couldn't close file\n"); return false; } @@ -364,12 +364,12 @@ void FileA3D::appendToFile(ObjectBase *obj) { RsObjectBase rsaFileA3DGetEntryByIndex(RsContext con, uint32_t index, RsFile file) { FileA3D *fa3d = static_cast<FileA3D *>(file); if (!fa3d) { - LOGE("Can't load entry. No valid file"); + ALOGE("Can't load entry. No valid file"); return NULL; } ObjectBase *obj = fa3d->initializeFromEntry(index); - //LOGV("Returning object with name %s", obj->getName()); + //ALOGV("Returning object with name %s", obj->getName()); return obj; } @@ -389,13 +389,13 @@ void rsaFileA3DGetIndexEntries(RsContext con, RsFileIndexEntry *fileEntries, uin FileA3D *fa3d = static_cast<FileA3D *>(file); if (!fa3d) { - LOGE("Can't load index entries. No valid file"); + ALOGE("Can't load index entries. No valid file"); return; } uint32_t numFileEntries = fa3d->getNumIndexEntries(); if (numFileEntries != numEntries || numEntries == 0 || fileEntries == NULL) { - LOGE("Can't load index entries. Invalid number requested"); + ALOGE("Can't load index entries. Invalid number requested"); return; } @@ -408,7 +408,7 @@ void rsaFileA3DGetIndexEntries(RsContext con, RsFileIndexEntry *fileEntries, uin RsFile rsaFileA3DCreateFromMemory(RsContext con, const void *data, uint32_t len) { if (data == NULL) { - LOGE("File load failed. Asset stream is NULL"); + ALOGE("File load failed. Asset stream is NULL"); return NULL; } @@ -432,7 +432,7 @@ RsFile rsaFileA3DCreateFromAsset(RsContext con, void *_asset) { RsFile rsaFileA3DCreateFromFile(RsContext con, const char *path) { if (path == NULL) { - LOGE("File load failed. Path is NULL"); + ALOGE("File load failed. Path is NULL"); return NULL; } @@ -446,7 +446,7 @@ RsFile rsaFileA3DCreateFromFile(RsContext con, const char *path) { fa3d->load(f); fclose(f); } else { - LOGE("Could not open file %s", path); + ALOGE("Could not open file %s", path); } return fa3d; diff --git a/libs/rs/rsFont.cpp b/libs/rs/rsFont.cpp index 7efed9d..e09f81c 100644 --- a/libs/rs/rsFont.cpp +++ b/libs/rs/rsFont.cpp @@ -39,7 +39,7 @@ Font::Font(Context *rsc) : ObjectBase(rsc), mCachedGlyphs(NULL) { bool Font::init(const char *name, float fontSize, uint32_t dpi, const void *data, uint32_t dataLen) { #ifndef ANDROID_RS_SERIALIZE if (mInitialized) { - LOGE("Reinitialization of fonts not supported"); + ALOGE("Reinitialization of fonts not supported"); return false; } @@ -51,7 +51,7 @@ bool Font::init(const char *name, float fontSize, uint32_t dpi, const void *data } if (error) { - LOGE("Unable to initialize font %s", name); + ALOGE("Unable to initialize font %s", name); return false; } @@ -61,7 +61,7 @@ bool Font::init(const char *name, float fontSize, uint32_t dpi, const void *data error = FT_Set_Char_Size(mFace, (FT_F26Dot6)(fontSize * 64.0f), 0, dpi, 0); if (error) { - LOGE("Unable to set font size on %s", name); + ALOGE("Unable to set font size on %s", name); return false; } @@ -124,7 +124,7 @@ void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int32_t x, int32_t y, for (cacheX = glyph->mBitmapMinX, bX = nPenX; cacheX < endX; cacheX++, bX++) { for (cacheY = glyph->mBitmapMinY, bY = nPenY; cacheY < endY; cacheY++, bY++) { if (bX < 0 || bY < 0 || bX >= (int32_t) bitmapW || bY >= (int32_t) bitmapH) { - LOGE("Skipping invalid index"); + ALOGE("Skipping invalid index"); continue; } uint8_t tempCol = cacheBuffer[cacheY * cacheWidth + cacheX]; @@ -165,7 +165,7 @@ void Font::renderUTF(const char *text, uint32_t len, int32_t x, int32_t y, if (mode == Font::MEASURE) { if (bounds == NULL) { - LOGE("No return rectangle provided to measure text"); + ALOGE("No return rectangle provided to measure text"); return; } // Reset min and max of the bounding box to something large @@ -237,7 +237,7 @@ void Font::updateGlyphCache(CachedGlyphInfo *glyph) { #ifndef ANDROID_RS_SERIALIZE FT_Error error = FT_Load_Glyph( mFace, glyph->mGlyphIndex, FT_LOAD_RENDER ); if (error) { - LOGE("Couldn't load glyph."); + ALOGE("Couldn't load glyph."); return; } @@ -378,7 +378,7 @@ FT_Library FontState::getLib() { if (!mLibrary) { FT_Error error = FT_Init_FreeType(&mLibrary); if (error) { - LOGE("Unable to initialize freetype"); + ALOGE("Unable to initialize freetype"); return NULL; } } @@ -409,7 +409,7 @@ void FontState::flushAllAndInvalidate() { bool FontState::cacheBitmap(FT_Bitmap *bitmap, uint32_t *retOriginX, uint32_t *retOriginY) { // If the glyph is too tall, don't cache it if ((uint32_t)bitmap->rows > mCacheLines[mCacheLines.size()-1]->mMaxHeight) { - LOGE("Font size to large to fit in cache. width, height = %i, %i", (int)bitmap->width, (int)bitmap->rows); + ALOGE("Font size to large to fit in cache. width, height = %i, %i", (int)bitmap->width, (int)bitmap->rows); return false; } @@ -439,7 +439,7 @@ bool FontState::cacheBitmap(FT_Bitmap *bitmap, uint32_t *retOriginX, uint32_t *r // if we still don't fit, something is wrong and we shouldn't draw if (!bitmapFit) { - LOGE("Bitmap doesn't fit in cache. width, height = %i, %i", (int)bitmap->width, (int)bitmap->rows); + ALOGE("Bitmap doesn't fit in cache. width, height = %i, %i", (int)bitmap->width, (int)bitmap->rows); return false; } } @@ -471,7 +471,7 @@ bool FontState::cacheBitmap(FT_Bitmap *bitmap, uint32_t *retOriginX, uint32_t *r // Some debug code /*for (uint32_t i = 0; i < mCacheLines.size(); i ++) { - LOGE("Cache Line: H: %u Empty Space: %f", + ALOGE("Cache Line: H: %u Empty Space: %f", mCacheLines[i]->mMaxHeight, (1.0f - (float)mCacheLines[i]->mCurrentCol/(float)mCacheLines[i]->mMaxWidth)*100.0f); @@ -663,9 +663,9 @@ void FontState::appendMeshQuad(float x1, float y1, float z1, } /*LOGE("V0 x: %f y: %f z: %f", x1, y1, z1); - LOGE("V1 x: %f y: %f z: %f", x2, y2, z2); - LOGE("V2 x: %f y: %f z: %f", x3, y3, z3); - LOGE("V3 x: %f y: %f z: %f", x4, y4, z4);*/ + ALOGE("V1 x: %f y: %f z: %f", x2, y2, z2); + ALOGE("V2 x: %f y: %f z: %f", x3, y3, z3); + ALOGE("V3 x: %f y: %f z: %f", x4, y4, z4);*/ (*currentPos++) = x1; (*currentPos++) = y1; @@ -742,7 +742,7 @@ void FontState::renderText(const char *text, uint32_t len, int32_t x, int32_t y, currentFont = mDefault.get(); } if (!currentFont) { - LOGE("Unable to initialize any fonts"); + ALOGE("Unable to initialize any fonts"); return; } diff --git a/libs/rs/rsLocklessFifo.cpp b/libs/rs/rsLocklessFifo.cpp index 8879805..0466d8b 100644 --- a/libs/rs/rsLocklessFifo.cpp +++ b/libs/rs/rsLocklessFifo.cpp @@ -45,12 +45,12 @@ bool LocklessCommandFifo::init(uint32_t sizeInBytes) { // Add room for a buffer reset command mBuffer = static_cast<uint8_t *>(malloc(sizeInBytes + 4)); if (!mBuffer) { - LOGE("LocklessFifo allocation failure"); + ALOGE("LocklessFifo allocation failure"); return false; } if (!mSignalToControl.init() || !mSignalToWorker.init()) { - LOGE("Signal setup failed"); + ALOGE("Signal setup failed"); free(mBuffer); return false; } @@ -231,7 +231,7 @@ void LocklessCommandFifo::makeSpace(uint32_t bytes) { } void LocklessCommandFifo::dumpState(const char *s) const { - LOGV("%s %p put %p, get %p, buf %p, end %p", s, this, mPut, mGet, mBuffer, mEnd); + ALOGV("%s %p put %p, get %p, buf %p, end %p", s, this, mPut, mGet, mBuffer, mEnd); } void LocklessCommandFifo::printDebugData() const { @@ -244,7 +244,7 @@ void LocklessCommandFifo::printDebugData() const { for (int ct=0; ct < 16; ct++) { - LOGV("fifo %p = 0x%08x 0x%08x 0x%08x 0x%08x", pptr, pptr[0], pptr[1], pptr[2], pptr[3]); + ALOGV("fifo %p = 0x%08x 0x%08x 0x%08x 0x%08x", pptr, pptr[0], pptr[1], pptr[2], pptr[3]); pptr += 4; } diff --git a/libs/rs/rsMatrix4x4.cpp b/libs/rs/rsMatrix4x4.cpp index f34af47..c6f96d8 100644 --- a/libs/rs/rsMatrix4x4.cpp +++ b/libs/rs/rsMatrix4x4.cpp @@ -307,8 +307,8 @@ void Matrix4x4::vectorMultiply(float *out, const float *in) const { } void Matrix4x4::logv(const char *s) const { - LOGV("%s {%f, %f, %f, %f", s, m[0], m[4], m[8], m[12]); - LOGV("%s %f, %f, %f, %f", s, m[1], m[5], m[9], m[13]); - LOGV("%s %f, %f, %f, %f", s, m[2], m[6], m[10], m[14]); - LOGV("%s %f, %f, %f, %f}", s, m[3], m[7], m[11], m[15]); + ALOGV("%s {%f, %f, %f, %f", s, m[0], m[4], m[8], m[12]); + ALOGV("%s %f, %f, %f, %f", s, m[1], m[5], m[9], m[13]); + ALOGV("%s %f, %f, %f, %f", s, m[2], m[6], m[10], m[14]); + ALOGV("%s %f, %f, %f, %f}", s, m[3], m[7], m[11], m[15]); } diff --git a/libs/rs/rsMesh.cpp b/libs/rs/rsMesh.cpp index bf9284f..67c7299 100644 --- a/libs/rs/rsMesh.cpp +++ b/libs/rs/rsMesh.cpp @@ -107,7 +107,7 @@ Mesh *Mesh::createFromStream(Context *rsc, IStream *stream) { // First make sure we are reading the correct object RsA3DClassID classID = (RsA3DClassID)stream->loadU32(); if (classID != RS_A3D_CLASS_ID_MESH) { - LOGE("mesh loading skipped due to invalid class id"); + ALOGE("mesh loading skipped due to invalid class id"); return NULL; } @@ -178,7 +178,7 @@ void Mesh::render(Context *rsc) const { void Mesh::renderPrimitive(Context *rsc, uint32_t primIndex) const { if (primIndex >= mHal.state.primitivesCount) { - LOGE("Invalid primitive index"); + ALOGE("Invalid primitive index"); return; } @@ -192,7 +192,7 @@ void Mesh::renderPrimitive(Context *rsc, uint32_t primIndex) const { void Mesh::renderPrimitiveRange(Context *rsc, uint32_t primIndex, uint32_t start, uint32_t len) const { if (len < 1 || primIndex >= mHal.state.primitivesCount) { - LOGE("Invalid mesh or parameters"); + ALOGE("Invalid mesh or parameters"); return; } @@ -241,7 +241,7 @@ void Mesh::computeBBox() { mBBoxMin[0] = mBBoxMin[1] = mBBoxMin[2] = 1e6; mBBoxMax[0] = mBBoxMax[1] = mBBoxMax[2] = -1e6; if (!posPtr) { - LOGE("Unable to compute bounding box"); + ALOGE("Unable to compute bounding box"); mBBoxMin[0] = mBBoxMin[1] = mBBoxMin[2] = 0.0f; mBBoxMax[0] = mBBoxMax[1] = mBBoxMax[2] = 0.0f; return; diff --git a/libs/rs/rsMutex.cpp b/libs/rs/rsMutex.cpp index 2105288..6512372 100644 --- a/libs/rs/rsMutex.cpp +++ b/libs/rs/rsMutex.cpp @@ -30,7 +30,7 @@ Mutex::~Mutex() { bool Mutex::init() { int status = pthread_mutex_init(&mMutex, NULL); if (status) { - LOGE("Mutex::Mutex init failure"); + ALOGE("Mutex::Mutex init failure"); return false; } return true; @@ -40,7 +40,7 @@ bool Mutex::lock() { int status; status = pthread_mutex_lock(&mMutex); if (status) { - LOGE("Mutex: error %i locking.", status); + ALOGE("Mutex: error %i locking.", status); return false; } return true; @@ -50,7 +50,7 @@ bool Mutex::unlock() { int status; status = pthread_mutex_unlock(&mMutex); if (status) { - LOGE("Mutex error %i unlocking.", status); + ALOGE("Mutex error %i unlocking.", status); return false; } return true; diff --git a/libs/rs/rsObjectBase.cpp b/libs/rs/rsObjectBase.cpp index f5ced26..6a64582 100644 --- a/libs/rs/rsObjectBase.cpp +++ b/libs/rs/rsObjectBase.cpp @@ -35,11 +35,11 @@ ObjectBase::ObjectBase(Context *rsc) { rsAssert(rsc); add(); - //LOGV("ObjectBase %p con", this); + //ALOGV("ObjectBase %p con", this); } ObjectBase::~ObjectBase() { - //LOGV("~ObjectBase %p ref %i,%i", this, mUserRefCount, mSysRefCount); + //ALOGV("~ObjectBase %p ref %i,%i", this, mUserRefCount, mSysRefCount); #if RS_OBJECT_DEBUG mStack.dump(); #endif @@ -60,22 +60,22 @@ ObjectBase::~ObjectBase() { void ObjectBase::dumpLOGV(const char *op) const { if (mName.size()) { - LOGV("%s RSobj %p, name %s, refs %i,%i links %p,%p,%p", + ALOGV("%s RSobj %p, name %s, refs %i,%i links %p,%p,%p", op, this, mName.string(), mUserRefCount, mSysRefCount, mNext, mPrev, mRSC); } else { - LOGV("%s RSobj %p, no-name, refs %i,%i links %p,%p,%p", + ALOGV("%s RSobj %p, no-name, refs %i,%i links %p,%p,%p", op, this, mUserRefCount, mSysRefCount, mNext, mPrev, mRSC); } } void ObjectBase::incUserRef() const { android_atomic_inc(&mUserRefCount); - //LOGV("ObjectBase %p incU ref %i, %i", this, mUserRefCount, mSysRefCount); + //ALOGV("ObjectBase %p incU ref %i, %i", this, mUserRefCount, mSysRefCount); } void ObjectBase::incSysRef() const { android_atomic_inc(&mSysRefCount); - //LOGV("ObjectBase %p incS ref %i, %i", this, mUserRefCount, mSysRefCount); + //ALOGV("ObjectBase %p incS ref %i, %i", this, mUserRefCount, mSysRefCount); } void ObjectBase::preDestroy() const { @@ -111,7 +111,7 @@ bool ObjectBase::checkDelete(const ObjectBase *ref) { bool ObjectBase::decUserRef() const { rsAssert(mUserRefCount > 0); #if RS_OBJECT_DEBUG - LOGV("ObjectBase %p decU ref %i, %i", this, mUserRefCount, mSysRefCount); + ALOGV("ObjectBase %p decU ref %i, %i", this, mUserRefCount, mSysRefCount); if (mUserRefCount <= 0) { mStack.dump(); } @@ -126,7 +126,7 @@ bool ObjectBase::decUserRef() const { } bool ObjectBase::zeroUserRef() const { - //LOGV("ObjectBase %p zeroU ref %i, %i", this, mUserRefCount, mSysRefCount); + //ALOGV("ObjectBase %p zeroU ref %i, %i", this, mUserRefCount, mSysRefCount); android_atomic_acquire_store(0, &mUserRefCount); if (android_atomic_acquire_load(&mSysRefCount) <= 0) { return checkDelete(this); @@ -135,7 +135,7 @@ bool ObjectBase::zeroUserRef() const { } bool ObjectBase::decSysRef() const { - //LOGV("ObjectBase %p decS ref %i, %i", this, mUserRefCount, mSysRefCount); + //ALOGV("ObjectBase %p decS ref %i, %i", this, mUserRefCount, mSysRefCount); rsAssert(mSysRefCount > 0); if ((android_atomic_dec(&mSysRefCount) <= 1) && (android_atomic_acquire_load(&mUserRefCount) <= 0)) { @@ -165,7 +165,7 @@ void ObjectBase::add() const { rsAssert(!mNext); rsAssert(!mPrev); - //LOGV("calling add rsc %p", mRSC); + //ALOGV("calling add rsc %p", mRSC); mNext = mRSC->mObjHead; if (mRSC->mObjHead) { mRSC->mObjHead->mPrev = this; @@ -176,7 +176,7 @@ void ObjectBase::add() const { } void ObjectBase::remove() const { - //LOGV("calling remove rsc %p", mRSC); + //ALOGV("calling remove rsc %p", mRSC); if (!mRSC) { rsAssert(!mPrev); rsAssert(!mNext); @@ -198,32 +198,32 @@ void ObjectBase::remove() const { void ObjectBase::zeroAllUserRef(Context *rsc) { if (rsc->props.mLogObjects) { - LOGV("Forcing release of all outstanding user refs."); + ALOGV("Forcing release of all outstanding user refs."); } // This operation can be slow, only to be called during context cleanup. const ObjectBase * o = rsc->mObjHead; while (o) { - //LOGE("o %p", o); + //ALOGE("o %p", o); if (o->zeroUserRef()) { // deleted the object and possibly others, restart from head. o = rsc->mObjHead; - //LOGE("o head %p", o); + //ALOGE("o head %p", o); } else { o = o->mNext; - //LOGE("o next %p", o); + //ALOGE("o next %p", o); } } if (rsc->props.mLogObjects) { - LOGV("Objects remaining."); + ALOGV("Objects remaining."); dumpAll(rsc); } } void ObjectBase::freeAllChildren(Context *rsc) { if (rsc->props.mLogObjects) { - LOGV("Forcing release of all child objects."); + ALOGV("Forcing release of all child objects."); } // This operation can be slow, only to be called during context cleanup. @@ -238,7 +238,7 @@ void ObjectBase::freeAllChildren(Context *rsc) { } if (rsc->props.mLogObjects) { - LOGV("Objects remaining."); + ALOGV("Objects remaining."); dumpAll(rsc); } } @@ -246,10 +246,10 @@ void ObjectBase::freeAllChildren(Context *rsc) { void ObjectBase::dumpAll(Context *rsc) { asyncLock(); - LOGV("Dumping all objects"); + ALOGV("Dumping all objects"); const ObjectBase * o = rsc->mObjHead; while (o) { - LOGV(" Object %p", o); + ALOGV(" Object %p", o); o->dumpLOGV(" "); o = o->mNext; } diff --git a/libs/rs/rsProgram.cpp b/libs/rs/rsProgram.cpp index a9fd877..8061515 100644 --- a/libs/rs/rsProgram.cpp +++ b/libs/rs/rsProgram.cpp @@ -139,13 +139,13 @@ void Program::initMemberVars() { void Program::bindAllocation(Context *rsc, Allocation *alloc, uint32_t slot) { if (alloc != NULL) { if (slot >= mHal.state.constantsCount) { - LOGE("Attempt to bind alloc at slot %u, on shader id %u, but const count is %u", + ALOGE("Attempt to bind alloc at slot %u, on shader id %u, but const count is %u", slot, (uint32_t)this, mHal.state.constantsCount); rsc->setError(RS_ERROR_BAD_SHADER, "Cannot bind allocation"); return; } if (alloc->getType() != mConstantTypes[slot].get()) { - LOGE("Attempt to bind alloc at slot %u, on shader id %u, but types mismatch", + ALOGE("Attempt to bind alloc at slot %u, on shader id %u, but types mismatch", slot, (uint32_t)this); rsc->setError(RS_ERROR_BAD_SHADER, "Cannot bind allocation"); return; @@ -167,13 +167,13 @@ void Program::bindAllocation(Context *rsc, Allocation *alloc, uint32_t slot) { void Program::bindTexture(Context *rsc, uint32_t slot, Allocation *a) { if (slot >= mHal.state.texturesCount) { - LOGE("Attempt to bind texture to slot %u but tex count is %u", slot, mHal.state.texturesCount); + ALOGE("Attempt to bind texture to slot %u but tex count is %u", slot, mHal.state.texturesCount); rsc->setError(RS_ERROR_BAD_SHADER, "Cannot bind texture"); return; } if (a && a->getType()->getDimFaces() && mHal.state.textureTargets[slot] != RS_TEXTURE_CUBE) { - LOGE("Attempt to bind cubemap to slot %u but 2d texture needed", slot); + ALOGE("Attempt to bind cubemap to slot %u but 2d texture needed", slot); rsc->setError(RS_ERROR_BAD_SHADER, "Cannot bind cubemap to 2d texture slot"); return; } @@ -186,7 +186,7 @@ void Program::bindTexture(Context *rsc, uint32_t slot, Allocation *a) { void Program::bindSampler(Context *rsc, uint32_t slot, Sampler *s) { if (slot >= mHal.state.texturesCount) { - LOGE("Attempt to bind sampler to slot %u but tex count is %u", slot, mHal.state.texturesCount); + ALOGE("Attempt to bind sampler to slot %u but tex count is %u", slot, mHal.state.texturesCount); rsc->setError(RS_ERROR_BAD_SHADER, "Cannot bind sampler"); return; } diff --git a/libs/rs/rsProgramFragment.cpp b/libs/rs/rsProgramFragment.cpp index 81eedc4..4e73ca6 100644 --- a/libs/rs/rsProgramFragment.cpp +++ b/libs/rs/rsProgramFragment.cpp @@ -38,12 +38,12 @@ ProgramFragment::~ProgramFragment() { void ProgramFragment::setConstantColor(Context *rsc, float r, float g, float b, float a) { if (isUserProgram()) { - LOGE("Attempting to set fixed function emulation color on user program"); + ALOGE("Attempting to set fixed function emulation color on user program"); rsc->setError(RS_ERROR_BAD_SHADER, "Cannot set fixed function emulation color on user program"); return; } if (mHal.state.constants[0] == NULL) { - LOGE("Unable to set fixed function emulation color because allocation is missing"); + ALOGE("Unable to set fixed function emulation color because allocation is missing"); rsc->setError(RS_ERROR_BAD_SHADER, "Unable to set fixed function emulation color because allocation is missing"); return; } @@ -63,7 +63,7 @@ void ProgramFragment::setup(Context *rsc, ProgramFragmentState *state) { for (uint32_t ct=0; ct < mHal.state.texturesCount; ct++) { if (!mHal.state.textures[ct]) { - LOGE("No texture bound for shader id %u, texture unit %u", (uint)this, ct); + ALOGE("No texture bound for shader id %u, texture unit %u", (uint)this, ct); rsc->setError(RS_ERROR_BAD_SHADER, "No texture bound"); continue; } @@ -131,7 +131,7 @@ RsProgramFragment rsi_ProgramFragmentCreate(Context *rsc, const char * shaderTex size_t paramLength) { ProgramFragment *pf = new ProgramFragment(rsc, shaderText, shaderLength, params, paramLength); pf->incUserRef(); - //LOGE("rsi_ProgramFragmentCreate %p", pf); + //ALOGE("rsi_ProgramFragmentCreate %p", pf); return pf; } diff --git a/libs/rs/rsScript.cpp b/libs/rs/rsScript.cpp index 93513fe..fad9c08 100644 --- a/libs/rs/rsScript.cpp +++ b/libs/rs/rsScript.cpp @@ -39,9 +39,9 @@ Script::~Script() { } void Script::setSlot(uint32_t slot, Allocation *a) { - //LOGE("setSlot %i %p", slot, a); + //ALOGE("setSlot %i %p", slot, a); if (slot >= mHal.info.exportedVariableCount) { - LOGE("Script::setSlot unable to set allocation, invalid slot index"); + ALOGE("Script::setSlot unable to set allocation, invalid slot index"); return; } @@ -54,21 +54,21 @@ void Script::setSlot(uint32_t slot, Allocation *a) { } void Script::setVar(uint32_t slot, const void *val, size_t len) { - //LOGE("setVar %i %p %i", slot, val, len); + //ALOGE("setVar %i %p %i", slot, val, len); if (slot >= mHal.info.exportedVariableCount) { - LOGE("Script::setVar unable to set allocation, invalid slot index"); + ALOGE("Script::setVar unable to set allocation, invalid slot index"); return; } mRSC->mHal.funcs.script.setGlobalVar(mRSC, this, slot, (void *)val, len); } void Script::setVarObj(uint32_t slot, ObjectBase *val) { - //LOGE("setVarObj %i %p", slot, val); + //ALOGE("setVarObj %i %p", slot, val); if (slot >= mHal.info.exportedVariableCount) { - LOGE("Script::setVarObj unable to set allocation, invalid slot index"); + ALOGE("Script::setVarObj unable to set allocation, invalid slot index"); return; } - //LOGE("setvarobj %i %p", slot, val); + //ALOGE("setvarobj %i %p", slot, val); mRSC->mHal.funcs.script.setGlobalObj(mRSC, this, slot, val); } @@ -85,7 +85,7 @@ void rsi_ScriptBindAllocation(Context * rsc, RsScript vs, RsAllocation va, uint3 Script *s = static_cast<Script *>(vs); Allocation *a = static_cast<Allocation *>(va); s->setSlot(slot, a); - //LOGE("rsi_ScriptBindAllocation %i %p %p", slot, a, a->getPtr()); + //ALOGE("rsi_ScriptBindAllocation %i %p %p", slot, a, a->getPtr()); } void rsi_ScriptSetTimeZone(Context * rsc, RsScript vs, const char * timeZone, size_t length) { diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp index cd7b3a7..5079b63 100644 --- a/libs/rs/rsScriptC.cpp +++ b/libs/rs/rsScriptC.cpp @@ -70,7 +70,7 @@ void ScriptC::setupScript(Context *rsc) { } const Allocation *ScriptC::ptrToAllocation(const void *ptr) const { - //LOGE("ptr to alloc %p", ptr); + //ALOGE("ptr to alloc %p", ptr); if (!ptr) { return NULL; } @@ -81,7 +81,7 @@ const Allocation *ScriptC::ptrToAllocation(const void *ptr) const { return mSlots[ct].get(); } } - LOGE("ScriptC::ptrToAllocation, failed to find %p", ptr); + ALOGE("ScriptC::ptrToAllocation, failed to find %p", ptr); return NULL; } @@ -112,13 +112,13 @@ uint32_t ScriptC::run(Context *rsc) { uint32_t ret = 0; if (rsc->props.mLogScripts) { - LOGV("%p ScriptC::run invoking root, ptr %p", rsc, mHal.info.root); + ALOGV("%p ScriptC::run invoking root, ptr %p", rsc, mHal.info.root); } ret = rsc->mHal.funcs.script.invokeRoot(rsc, this); if (rsc->props.mLogScripts) { - LOGV("%p ScriptC::run invoking complete, ret=%i", rsc, ret); + ALOGV("%p ScriptC::run invoking complete, ret=%i", rsc, ret); } return ret; @@ -147,7 +147,7 @@ void ScriptC::Invoke(Context *rsc, uint32_t slot, const void *data, size_t len) setupScript(rsc); if (rsc->props.mLogScripts) { - LOGV("%p ScriptC::Invoke invoking slot %i, ptr %p", rsc, slot, this); + ALOGV("%p ScriptC::Invoke invoking slot %i, ptr %p", rsc, slot, this); } rsc->mHal.funcs.script.invokeFunction(rsc, this, slot, data, len); } @@ -179,7 +179,7 @@ static void* symbolLookup(void* pContext, char const* name) { s->mHal.info.isThreadable &= sym->threadable; return sym->mPtr; } - LOGE("ScriptC sym lookup failed for %s", name); + ALOGE("ScriptC sym lookup failed for %s", name); return NULL; } */ @@ -195,12 +195,12 @@ bool ScriptC::runCompiler(Context *rsc, const uint8_t *bitcode, size_t bitcodeLen) { - //LOGE("runCompiler %p %p %p %p %p %i", rsc, this, resName, cacheDir, bitcode, bitcodeLen); + //ALOGE("runCompiler %p %p %p %p %p %i", rsc, this, resName, cacheDir, bitcode, bitcodeLen); #ifndef ANDROID_RS_SERIALIZE uint32_t sdkVersion = 0; bcinfo::BitcodeWrapper bcWrapper((const char *)bitcode, bitcodeLen); if (!bcWrapper.unwrap()) { - LOGE("Bitcode is not in proper container format (raw or wrapper)"); + ALOGE("Bitcode is not in proper container format (raw or wrapper)"); return false; } @@ -221,7 +221,7 @@ bool ScriptC::runCompiler(Context *rsc, BT = new bcinfo::BitcodeTranslator((const char *)bitcode, bitcodeLen, sdkVersion); if (!BT->translate()) { - LOGE("Failed to translate bitcode from version: %u", sdkVersion); + ALOGE("Failed to translate bitcode from version: %u", sdkVersion); delete BT; BT = NULL; return false; @@ -242,12 +242,12 @@ bool ScriptC::runCompiler(Context *rsc, for (size_t i=0; i < mHal.info.exportedPragmaCount; ++i) { const char * key = mHal.info.exportedPragmaKeyList[i]; const char * value = mHal.info.exportedPragmaValueList[i]; - //LOGE("pragma %s %s", keys[i], values[i]); + //ALOGE("pragma %s %s", keys[i], values[i]); if (!strcmp(key, "version")) { if (!strcmp(value, "1")) { continue; } - LOGE("Invalid version pragma value: %s\n", value); + ALOGE("Invalid version pragma value: %s\n", value); return false; } @@ -259,7 +259,7 @@ bool ScriptC::runCompiler(Context *rsc, mEnviroment.mVertex.clear(); continue; } - LOGE("Unrecognized value %s passed to stateVertex", value); + ALOGE("Unrecognized value %s passed to stateVertex", value); return false; } @@ -271,7 +271,7 @@ bool ScriptC::runCompiler(Context *rsc, mEnviroment.mRaster.clear(); continue; } - LOGE("Unrecognized value %s passed to stateRaster", value); + ALOGE("Unrecognized value %s passed to stateRaster", value); return false; } @@ -283,7 +283,7 @@ bool ScriptC::runCompiler(Context *rsc, mEnviroment.mFragment.clear(); continue; } - LOGE("Unrecognized value %s passed to stateFragment", value); + ALOGE("Unrecognized value %s passed to stateFragment", value); return false; } @@ -295,7 +295,7 @@ bool ScriptC::runCompiler(Context *rsc, mEnviroment.mFragmentStore.clear(); continue; } - LOGE("Unrecognized value %s passed to stateStore", value); + ALOGE("Unrecognized value %s passed to stateStore", value); return false; } } diff --git a/libs/rs/rsScriptC_Lib.cpp b/libs/rs/rsScriptC_Lib.cpp index ec15bc0..183e207 100644 --- a/libs/rs/rsScriptC_Lib.cpp +++ b/libs/rs/rsScriptC_Lib.cpp @@ -115,7 +115,7 @@ float rsrGetDt(Context *rsc, Script *sc) { ////////////////////////////////////////////////////////////////////////////// void rsrSetObject(const Context *rsc, const Script *sc, ObjectBase **dst, ObjectBase * src) { - //LOGE("rsiSetObject %p,%p %p", vdst, *vdst, vsrc); + //ALOGE("rsiSetObject %p,%p %p", vdst, *vdst, vsrc); if (src) { CHECK_OBJ(src); src->incSysRef(); @@ -128,7 +128,7 @@ void rsrSetObject(const Context *rsc, const Script *sc, ObjectBase **dst, Object } void rsrClearObject(const Context *rsc, const Script *sc, ObjectBase **dst) { - //LOGE("rsiClearObject %p,%p", vdst, *vdst); + //ALOGE("rsiClearObject %p,%p", vdst, *vdst); if (dst[0]) { CHECK_OBJ(dst[0]); dst[0]->decSysRef(); @@ -142,12 +142,12 @@ bool rsrIsObject(const Context *rsc, const Script *sc, const ObjectBase *src) { uint32_t rsrToClient(Context *rsc, Script *sc, int cmdID, void *data, int len) { - //LOGE("SC_toClient %i %i %i", cmdID, len); + //ALOGE("SC_toClient %i %i %i", cmdID, len); return rsc->sendMessageToClient(data, RS_MESSAGE_TO_CLIENT_USER, cmdID, len, false); } uint32_t rsrToClientBlocking(Context *rsc, Script *sc, int cmdID, void *data, int len) { - //LOGE("SC_toClientBlocking %i %i", cmdID, len); + //ALOGE("SC_toClientBlocking %i %i", cmdID, len); return rsc->sendMessageToClient(data, RS_MESSAGE_TO_CLIENT_USER, cmdID, len, true); } diff --git a/libs/rs/rsScriptC_LibGL.cpp b/libs/rs/rsScriptC_LibGL.cpp index 7862f3c..a7ba7d2 100644 --- a/libs/rs/rsScriptC_LibGL.cpp +++ b/libs/rs/rsScriptC_LibGL.cpp @@ -142,11 +142,11 @@ void rsrDrawQuadTexCoords(Context *rsc, Script *sc, return; } - //LOGE("Quad"); - //LOGE("%4.2f, %4.2f, %4.2f", x1, y1, z1); - //LOGE("%4.2f, %4.2f, %4.2f", x2, y2, z2); - //LOGE("%4.2f, %4.2f, %4.2f", x3, y3, z3); - //LOGE("%4.2f, %4.2f, %4.2f", x4, y4, z4); + //ALOGE("Quad"); + //ALOGE("%4.2f, %4.2f, %4.2f", x1, y1, z1); + //ALOGE("%4.2f, %4.2f, %4.2f", x2, y2, z2); + //ALOGE("%4.2f, %4.2f, %4.2f", x3, y3, z3); + //ALOGE("%4.2f, %4.2f, %4.2f", x4, y4, z4); float vtx[] = {x1,y1,z1, x2,y2,z2, x3,y3,z3, x4,y4,z4}; const float tex[] = {u1,v1, u2,v2, u3,v3, u4,v4}; @@ -191,7 +191,7 @@ void rsrDrawSpriteScreenspace(Context *rsc, Script *sc, } void rsrDrawRect(Context *rsc, Script *sc, float x1, float y1, float x2, float y2, float z) { - //LOGE("SC_drawRect %f,%f %f,%f %f", x1, y1, x2, y2, z); + //ALOGE("SC_drawRect %f,%f %f,%f %f", x1, y1, x2, y2, z); rsrDrawQuad(rsc, sc, x1, y2, z, x2, y2, z, x2, y1, z, x1, y1, z); } diff --git a/libs/rs/rsSignal.cpp b/libs/rs/rsSignal.cpp index 413ac2b..3f6a13c 100644 --- a/libs/rs/rsSignal.cpp +++ b/libs/rs/rsSignal.cpp @@ -32,13 +32,13 @@ Signal::~Signal() { bool Signal::init() { int status = pthread_mutex_init(&mMutex, NULL); if (status) { - LOGE("LocklessFifo mutex init failure"); + ALOGE("LocklessFifo mutex init failure"); return false; } status = pthread_cond_init(&mCondition, NULL); if (status) { - LOGE("LocklessFifo condition init failure"); + ALOGE("LocklessFifo condition init failure"); pthread_mutex_destroy(&mMutex); return false; } @@ -51,7 +51,7 @@ void Signal::set() { status = pthread_mutex_lock(&mMutex); if (status) { - LOGE("LocklessCommandFifo: error %i locking for set condition.", status); + ALOGE("LocklessCommandFifo: error %i locking for set condition.", status); return; } @@ -59,12 +59,12 @@ void Signal::set() { status = pthread_cond_signal(&mCondition); if (status) { - LOGE("LocklessCommandFifo: error %i on set condition.", status); + ALOGE("LocklessCommandFifo: error %i on set condition.", status); } status = pthread_mutex_unlock(&mMutex); if (status) { - LOGE("LocklessCommandFifo: error %i unlocking for set condition.", status); + ALOGE("LocklessCommandFifo: error %i unlocking for set condition.", status); } } @@ -74,7 +74,7 @@ bool Signal::wait(uint64_t timeout) { status = pthread_mutex_lock(&mMutex); if (status) { - LOGE("LocklessCommandFifo: error %i locking for condition.", status); + ALOGE("LocklessCommandFifo: error %i locking for condition.", status); return false; } @@ -96,13 +96,13 @@ bool Signal::wait(uint64_t timeout) { ret = true; } else { if (status != ETIMEDOUT) { - LOGE("LocklessCommandFifo: error %i waiting for condition.", status); + ALOGE("LocklessCommandFifo: error %i waiting for condition.", status); } } status = pthread_mutex_unlock(&mMutex); if (status) { - LOGE("LocklessCommandFifo: error %i unlocking for condition.", status); + ALOGE("LocklessCommandFifo: error %i unlocking for condition.", status); } return ret; diff --git a/libs/rs/rsThreadIO.cpp b/libs/rs/rsThreadIO.cpp index b1a579a..8ba1a0e 100644 --- a/libs/rs/rsThreadIO.cpp +++ b/libs/rs/rsThreadIO.cpp @@ -40,22 +40,22 @@ void ThreadIO::init(bool useSocket) { } void ThreadIO::shutdown() { - //LOGE("shutdown 1"); + //ALOGE("shutdown 1"); mToCore.shutdown(); - //LOGE("shutdown 2"); + //ALOGE("shutdown 2"); } void ThreadIO::coreFlush() { - //LOGE("coreFlush 1"); + //ALOGE("coreFlush 1"); if (mUsingSocket) { } else { mToCore.flush(); } - //LOGE("coreFlush 2"); + //ALOGE("coreFlush 2"); } void * ThreadIO::coreHeader(uint32_t cmdID, size_t dataLen) { - //LOGE("coreHeader %i %i", cmdID, dataLen); + //ALOGE("coreHeader %i %i", cmdID, dataLen); if (mUsingSocket) { CoreCmdHeader hdr; hdr.bytes = dataLen; @@ -67,40 +67,40 @@ void * ThreadIO::coreHeader(uint32_t cmdID, size_t dataLen) { mCoreDataPtr = (uint8_t *)mToCore.reserve(dataLen); mCoreDataBasePtr = mCoreDataPtr; } - //LOGE("coreHeader ret %p", mCoreDataPtr); + //ALOGE("coreHeader ret %p", mCoreDataPtr); return mCoreDataPtr; } void ThreadIO::coreData(const void *data, size_t dataLen) { - //LOGE("coreData %p %i", data, dataLen); + //ALOGE("coreData %p %i", data, dataLen); mToCoreSocket.writeAsync(data, dataLen); - //LOGE("coreData ret %p", mCoreDataPtr); + //ALOGE("coreData ret %p", mCoreDataPtr); } void ThreadIO::coreCommit() { - //LOGE("coreCommit %p %p %i", mCoreDataPtr, mCoreDataBasePtr, mCoreCommandSize); + //ALOGE("coreCommit %p %p %i", mCoreDataPtr, mCoreDataBasePtr, mCoreCommandSize); if (mUsingSocket) { } else { rsAssert((size_t)(mCoreDataPtr - mCoreDataBasePtr) <= mCoreCommandSize); mToCore.commit(mCoreCommandID, mCoreCommandSize); } - //LOGE("coreCommit ret"); + //ALOGE("coreCommit ret"); } void ThreadIO::coreCommitSync() { - //LOGE("coreCommitSync %p %p %i", mCoreDataPtr, mCoreDataBasePtr, mCoreCommandSize); + //ALOGE("coreCommitSync %p %p %i", mCoreDataPtr, mCoreDataBasePtr, mCoreCommandSize); if (mUsingSocket) { } else { rsAssert((size_t)(mCoreDataPtr - mCoreDataBasePtr) <= mCoreCommandSize); mToCore.commitSync(mCoreCommandID, mCoreCommandSize); } - //LOGE("coreCommitSync ret"); + //ALOGE("coreCommitSync ret"); } void ThreadIO::clientShutdown() { - //LOGE("coreShutdown 1"); + //ALOGE("coreShutdown 1"); mToClient.shutdown(); - //LOGE("coreShutdown 2"); + //ALOGE("coreShutdown 2"); } void ThreadIO::coreSetReturn(const void *data, size_t dataLen) { @@ -145,11 +145,11 @@ bool ThreadIO::playCoreCommands(Context *con, bool waitForCommand, uint64_t time con->timerSet(Context::RS_TIMER_INTERNAL); } waitForCommand = false; - //LOGV("playCoreCommands 3 %i %i", cmdID, cmdSize); + //ALOGV("playCoreCommands 3 %i %i", cmdID, cmdSize); if (cmdID >= (sizeof(gPlaybackFuncs) / sizeof(void *))) { rsAssert(cmdID < (sizeof(gPlaybackFuncs) / sizeof(void *))); - LOGE("playCoreCommands error con %p, cmd %i", con, cmdID); + ALOGE("playCoreCommands error con %p, cmd %i", con, cmdID); mToCore.printDebugData(); } gPlaybackFuncs[cmdID](con, data, cmdSize << 2); @@ -193,8 +193,8 @@ RsMessageToClientType ThreadIO::getClientPayload(void *data, size_t *receiveLen, uint32_t bytesData = 0; uint32_t commandID = 0; const uint32_t *d = (const uint32_t *)mToClient.get(&commandID, &bytesData); - //LOGE("getMessageToClient 3 %i %i", commandID, bytesData); - //LOGE("getMessageToClient %i %i", commandID, *subID); + //ALOGE("getMessageToClient 3 %i %i", commandID, bytesData); + //ALOGE("getMessageToClient %i %i", commandID, *subID); if (bufferLen >= receiveLen[0]) { memcpy(data, d+1, receiveLen[0]); mToClient.next(); @@ -224,14 +224,14 @@ bool ThreadIO::sendToClient(RsMessageToClientType cmdID, uint32_t usrID, const v } } - //LOGE("sendMessageToClient 2"); + //ALOGE("sendMessageToClient 2"); uint32_t *p = (uint32_t *)mToClient.reserve(dataLen + sizeof(usrID)); p[0] = usrID; if (dataLen > 0) { memcpy(p+1, data, dataLen); } mToClient.commit(cmdID, dataLen + sizeof(usrID)); - //LOGE("sendMessageToClient 3"); + //ALOGE("sendMessageToClient 3"); return true; } return false; diff --git a/libs/rs/rsType.cpp b/libs/rs/rsType.cpp index 9a6a31b..7966470 100644 --- a/libs/rs/rsType.cpp +++ b/libs/rs/rsType.cpp @@ -141,7 +141,7 @@ uint32_t Type::getLODFaceOffset(uint32_t lod, RsAllocationCubemapFace face, uint void Type::dumpLOGV(const char *prefix) const { char buf[1024]; ObjectBase::dumpLOGV(prefix); - LOGV("%s Type: x=%zu y=%zu z=%zu mip=%i face=%i", prefix, mDimX, mDimY, mDimZ, mDimLOD, mFaces); + ALOGV("%s Type: x=%zu y=%zu z=%zu mip=%i face=%i", prefix, mDimX, mDimY, mDimZ, mDimLOD, mFaces); snprintf(buf, sizeof(buf), "%s element: ", prefix); mElement->dumpLOGV(buf); } @@ -167,7 +167,7 @@ Type *Type::createFromStream(Context *rsc, IStream *stream) { // First make sure we are reading the correct object RsA3DClassID classID = (RsA3DClassID)stream->loadU32(); if (classID != RS_A3D_CLASS_ID_TYPE) { - LOGE("type loading skipped due to invalid class id\n"); + ALOGE("type loading skipped due to invalid class id\n"); return NULL; } diff --git a/libs/rs/rsUtils.h b/libs/rs/rsUtils.h index 3a6c85a..db6f592 100644 --- a/libs/rs/rsUtils.h +++ b/libs/rs/rsUtils.h @@ -40,7 +40,7 @@ namespace android { namespace renderscript { #if 1 -#define rsAssert(v) do {if(!(v)) LOGE("rsAssert failed: %s, in %s at %i", #v, __FILE__, __LINE__);} while (0) +#define rsAssert(v) do {if(!(v)) ALOGE("rsAssert failed: %s, in %s at %i", #v, __FILE__, __LINE__);} while (0) #else #define rsAssert(v) while (0) #endif diff --git a/libs/rs/rsg_generator.c b/libs/rs/rsg_generator.c index b3f6c55..6b84e56 100644 --- a/libs/rs/rsg_generator.c +++ b/libs/rs/rsg_generator.c @@ -235,7 +235,7 @@ void printApiCpp(FILE *f) { } } - //fprintf(f, " LOGE(\"add command %s\\n\");\n", api->name); + //fprintf(f, " ALOGE(\"add command %s\\n\");\n", api->name); if (hasInlineDataPointers(api)) { fprintf(f, " RS_CMD_%s *cmd = NULL;\n", api->name); fprintf(f, " if (dataSize < 1024) {;\n"); @@ -441,7 +441,7 @@ void printPlaybackCpp(FILE *f) { fprintf(f, "void rsp_%s(Context *con, const void *vp, size_t cmdSizeBytes) {\n", api->name); - //fprintf(f, " LOGE(\"play command %s\\n\");\n", api->name); + //fprintf(f, " ALOGE(\"play command %s\\n\");\n", api->name); fprintf(f, " const RS_CMD_%s *cmd = static_cast<const RS_CMD_%s *>(vp);\n", api->name, api->name); fprintf(f, " "); @@ -469,7 +469,7 @@ void printPlaybackCpp(FILE *f) { fprintf(f, "void rspr_%s(Context *con, Fifo *f, uint8_t *scratch, size_t scratchSize) {\n", api->name); - //fprintf(f, " LOGE(\"play command %s\\n\");\n", api->name); + //fprintf(f, " ALOGE(\"play command %s\\n\");\n", api->name); fprintf(f, " RS_CMD_%s cmd;\n", api->name); fprintf(f, " f->read(&cmd, sizeof(cmd));\n"); diff --git a/libs/storage/IMountService.cpp b/libs/storage/IMountService.cpp index 8ddbeae..4ec8b25 100644 --- a/libs/storage/IMountService.cpp +++ b/libs/storage/IMountService.cpp @@ -66,12 +66,12 @@ public: data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeStrongBinder(listener->asBinder()); if (remote()->transact(TRANSACTION_registerListener, data, &reply) != NO_ERROR) { - LOGD("registerListener could not contact remote\n"); + ALOGD("registerListener could not contact remote\n"); return; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("registerListener caught exception %d\n", err); + ALOGD("registerListener caught exception %d\n", err); return; } } @@ -82,12 +82,12 @@ public: data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeStrongBinder(listener->asBinder()); if (remote()->transact(TRANSACTION_unregisterListener, data, &reply) != NO_ERROR) { - LOGD("unregisterListener could not contact remote\n"); + ALOGD("unregisterListener could not contact remote\n"); return; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("unregisterListener caught exception %d\n", err); + ALOGD("unregisterListener caught exception %d\n", err); return; } } @@ -97,12 +97,12 @@ public: Parcel data, reply; data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); if (remote()->transact(TRANSACTION_isUsbMassStorageConnected, data, &reply) != NO_ERROR) { - LOGD("isUsbMassStorageConnected could not contact remote\n"); + ALOGD("isUsbMassStorageConnected could not contact remote\n"); return false; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("isUsbMassStorageConnected caught exception %d\n", err); + ALOGD("isUsbMassStorageConnected caught exception %d\n", err); return false; } return reply.readInt32() != 0; @@ -114,12 +114,12 @@ public: data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeInt32(enable != 0); if (remote()->transact(TRANSACTION_setUsbMassStorageEnabled, data, &reply) != NO_ERROR) { - LOGD("setUsbMassStorageEnabled could not contact remote\n"); + ALOGD("setUsbMassStorageEnabled could not contact remote\n"); return; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("setUsbMassStorageEnabled caught exception %d\n", err); + ALOGD("setUsbMassStorageEnabled caught exception %d\n", err); return; } } @@ -129,12 +129,12 @@ public: Parcel data, reply; data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); if (remote()->transact(TRANSACTION_isUsbMassStorageEnabled, data, &reply) != NO_ERROR) { - LOGD("isUsbMassStorageEnabled could not contact remote\n"); + ALOGD("isUsbMassStorageEnabled could not contact remote\n"); return false; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("isUsbMassStorageEnabled caught exception %d\n", err); + ALOGD("isUsbMassStorageEnabled caught exception %d\n", err); return false; } return reply.readInt32() != 0; @@ -146,12 +146,12 @@ public: data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeString16(mountPoint); if (remote()->transact(TRANSACTION_mountVolume, data, &reply) != NO_ERROR) { - LOGD("mountVolume could not contact remote\n"); + ALOGD("mountVolume could not contact remote\n"); return -1; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("mountVolume caught exception %d\n", err); + ALOGD("mountVolume caught exception %d\n", err); return err; } return reply.readInt32(); @@ -165,12 +165,12 @@ public: data.writeInt32(force ? 1 : 0); data.writeInt32(removeEncryption ? 1 : 0); if (remote()->transact(TRANSACTION_unmountVolume, data, &reply) != NO_ERROR) { - LOGD("unmountVolume could not contact remote\n"); + ALOGD("unmountVolume could not contact remote\n"); return -1; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("unmountVolume caught exception %d\n", err); + ALOGD("unmountVolume caught exception %d\n", err); return err; } return reply.readInt32(); @@ -182,12 +182,12 @@ public: data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeString16(mountPoint); if (remote()->transact(TRANSACTION_formatVolume, data, &reply) != NO_ERROR) { - LOGD("formatVolume could not contact remote\n"); + ALOGD("formatVolume could not contact remote\n"); return -1; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("formatVolume caught exception %d\n", err); + ALOGD("formatVolume caught exception %d\n", err); return err; } return reply.readInt32(); @@ -199,12 +199,12 @@ public: data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeString16(mountPoint); if (remote()->transact(TRANSACTION_getStorageUsers, data, &reply) != NO_ERROR) { - LOGD("getStorageUsers could not contact remote\n"); + ALOGD("getStorageUsers could not contact remote\n"); return -1; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("getStorageUsers caught exception %d\n", err); + ALOGD("getStorageUsers caught exception %d\n", err); return err; } const int32_t numUsers = reply.readInt32(); @@ -221,12 +221,12 @@ public: data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeString16(mountPoint); if (remote()->transact(TRANSACTION_getVolumeState, data, &reply) != NO_ERROR) { - LOGD("getVolumeState could not contact remote\n"); + ALOGD("getVolumeState could not contact remote\n"); return -1; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("getVolumeState caught exception %d\n", err); + ALOGD("getVolumeState caught exception %d\n", err); return err; } return reply.readInt32(); @@ -243,12 +243,12 @@ public: data.writeString16(key); data.writeInt32(ownerUid); if (remote()->transact(TRANSACTION_createSecureContainer, data, &reply) != NO_ERROR) { - LOGD("createSecureContainer could not contact remote\n"); + ALOGD("createSecureContainer could not contact remote\n"); return -1; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("createSecureContainer caught exception %d\n", err); + ALOGD("createSecureContainer caught exception %d\n", err); return err; } return reply.readInt32(); @@ -260,12 +260,12 @@ public: data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeString16(id); if (remote()->transact(TRANSACTION_finalizeSecureContainer, data, &reply) != NO_ERROR) { - LOGD("finalizeSecureContainer couldn't call remote\n"); + ALOGD("finalizeSecureContainer couldn't call remote\n"); return -1; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("finalizeSecureContainer caught exception %d\n", err); + ALOGD("finalizeSecureContainer caught exception %d\n", err); return err; } return reply.readInt32(); @@ -277,12 +277,12 @@ public: data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeString16(id); if (remote()->transact(TRANSACTION_destroySecureContainer, data, &reply) != NO_ERROR) { - LOGD("destroySecureContainer couldn't call remote"); + ALOGD("destroySecureContainer couldn't call remote"); return -1; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("destroySecureContainer caught exception %d\n", err); + ALOGD("destroySecureContainer caught exception %d\n", err); return err; } return reply.readInt32(); @@ -296,12 +296,12 @@ public: data.writeString16(key); data.writeInt32(ownerUid); if (remote()->transact(TRANSACTION_mountSecureContainer, data, &reply) != NO_ERROR) { - LOGD("mountSecureContainer couldn't call remote"); + ALOGD("mountSecureContainer couldn't call remote"); return -1; } int32_t err = reply.readExceptionCode(); // What to do... if (err < 0) { - LOGD("mountSecureContainer caught exception %d\n", err); + ALOGD("mountSecureContainer caught exception %d\n", err); return err; } return reply.readInt32(); @@ -314,12 +314,12 @@ public: data.writeString16(id); data.writeInt32(force ? 1 : 0); if (remote()->transact(TRANSACTION_getSecureContainerPath, data, &reply) != NO_ERROR) { - LOGD("unmountSecureContainer couldn't call remote"); + ALOGD("unmountSecureContainer couldn't call remote"); return -1; } int32_t err = reply.readExceptionCode(); // What to do... if (err < 0) { - LOGD("unmountSecureContainer caught exception %d\n", err); + ALOGD("unmountSecureContainer caught exception %d\n", err); return err; } return reply.readInt32(); @@ -331,12 +331,12 @@ public: data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeString16(id); if (remote()->transact(TRANSACTION_isSecureContainerMounted, data, &reply) != NO_ERROR) { - LOGD("isSecureContainerMounted couldn't call remote"); + ALOGD("isSecureContainerMounted couldn't call remote"); return false; } int32_t err = reply.readExceptionCode(); // What to do... if (err < 0) { - LOGD("isSecureContainerMounted caught exception %d\n", err); + ALOGD("isSecureContainerMounted caught exception %d\n", err); return false; } return reply.readInt32() != 0; @@ -349,12 +349,12 @@ public: data.writeString16(oldId); data.writeString16(newId); if (remote()->transact(TRANSACTION_renameSecureContainer, data, &reply) != NO_ERROR) { - LOGD("renameSecureContainer couldn't call remote"); + ALOGD("renameSecureContainer couldn't call remote"); return -1; } int32_t err = reply.readExceptionCode(); // What to do... if (err < 0) { - LOGD("renameSecureContainer caught exception %d\n", err); + ALOGD("renameSecureContainer caught exception %d\n", err); return err; } return reply.readInt32(); @@ -366,12 +366,12 @@ public: data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeString16(id); if (remote()->transact(TRANSACTION_getSecureContainerPath, data, &reply) != NO_ERROR) { - LOGD("getSecureContainerPath couldn't call remote"); + ALOGD("getSecureContainerPath couldn't call remote"); return false; } int32_t err = reply.readExceptionCode(); // What to do... if (err < 0) { - LOGD("getSecureContainerPath caught exception %d\n", err); + ALOGD("getSecureContainerPath caught exception %d\n", err); return false; } path = reply.readString16(); @@ -384,12 +384,12 @@ public: data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeString16(id); if (remote()->transact(TRANSACTION_getSecureContainerList, data, &reply) != NO_ERROR) { - LOGD("getSecureContainerList couldn't call remote"); + ALOGD("getSecureContainerList couldn't call remote"); return -1; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("getSecureContainerList caught exception %d\n", err); + ALOGD("getSecureContainerList caught exception %d\n", err); return err; } const int32_t numStrings = reply.readInt32(); @@ -406,12 +406,12 @@ public: data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeStrongBinder(observer->asBinder()); if (remote()->transact(TRANSACTION_shutdown, data, &reply) != NO_ERROR) { - LOGD("shutdown could not contact remote\n"); + ALOGD("shutdown could not contact remote\n"); return; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("shutdown caught exception %d\n", err); + ALOGD("shutdown caught exception %d\n", err); return; } reply.readExceptionCode(); @@ -422,12 +422,12 @@ public: Parcel data, reply; data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); if (remote()->transact(TRANSACTION_finishMediaUpdate, data, &reply) != NO_ERROR) { - LOGD("finishMediaUpdate could not contact remote\n"); + ALOGD("finishMediaUpdate could not contact remote\n"); return; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("finishMediaUpdate caught exception %d\n", err); + ALOGD("finishMediaUpdate caught exception %d\n", err); return; } reply.readExceptionCode(); @@ -443,12 +443,12 @@ public: data.writeStrongBinder(token->asBinder()); data.writeInt32(nonce); if (remote()->transact(TRANSACTION_mountObb, data, &reply) != NO_ERROR) { - LOGD("mountObb could not contact remote\n"); + ALOGD("mountObb could not contact remote\n"); return; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("mountObb caught exception %d\n", err); + ALOGD("mountObb caught exception %d\n", err); return; } } @@ -463,12 +463,12 @@ public: data.writeStrongBinder(token->asBinder()); data.writeInt32(nonce); if (remote()->transact(TRANSACTION_unmountObb, data, &reply) != NO_ERROR) { - LOGD("unmountObb could not contact remote\n"); + ALOGD("unmountObb could not contact remote\n"); return; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("unmountObb caught exception %d\n", err); + ALOGD("unmountObb caught exception %d\n", err); return; } } @@ -479,12 +479,12 @@ public: data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeString16(filename); if (remote()->transact(TRANSACTION_isObbMounted, data, &reply) != NO_ERROR) { - LOGD("isObbMounted could not contact remote\n"); + ALOGD("isObbMounted could not contact remote\n"); return false; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("isObbMounted caught exception %d\n", err); + ALOGD("isObbMounted caught exception %d\n", err); return false; } return reply.readInt32() != 0; @@ -496,12 +496,12 @@ public: data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeString16(filename); if (remote()->transact(TRANSACTION_getMountedObbPath, data, &reply) != NO_ERROR) { - LOGD("getMountedObbPath could not contact remote\n"); + ALOGD("getMountedObbPath could not contact remote\n"); return false; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("getMountedObbPath caught exception %d\n", err); + ALOGD("getMountedObbPath caught exception %d\n", err); return false; } path = reply.readString16(); @@ -514,12 +514,12 @@ public: data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeString16(password); if (remote()->transact(TRANSACTION_decryptStorage, data, &reply) != NO_ERROR) { - LOGD("decryptStorage could not contact remote\n"); + ALOGD("decryptStorage could not contact remote\n"); return -1; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("decryptStorage caught exception %d\n", err); + ALOGD("decryptStorage caught exception %d\n", err); return err; } return reply.readInt32(); @@ -531,12 +531,12 @@ public: data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeString16(password); if (remote()->transact(TRANSACTION_encryptStorage, data, &reply) != NO_ERROR) { - LOGD("encryptStorage could not contact remote\n"); + ALOGD("encryptStorage could not contact remote\n"); return -1; } int32_t err = reply.readExceptionCode(); if (err < 0) { - LOGD("encryptStorage caught exception %d\n", err); + ALOGD("encryptStorage caught exception %d\n", err); return err; } return reply.readInt32(); diff --git a/libs/ui/FramebufferNativeWindow.cpp b/libs/ui/FramebufferNativeWindow.cpp index 8949730..f5ed981 100644 --- a/libs/ui/FramebufferNativeWindow.cpp +++ b/libs/ui/FramebufferNativeWindow.cpp @@ -85,10 +85,10 @@ FramebufferNativeWindow::FramebufferNativeWindow() int err; int i; err = framebuffer_open(module, &fbDev); - LOGE_IF(err, "couldn't open framebuffer HAL (%s)", strerror(-err)); + ALOGE_IF(err, "couldn't open framebuffer HAL (%s)", strerror(-err)); err = gralloc_open(module, &grDev); - LOGE_IF(err, "couldn't open gralloc HAL (%s)", strerror(-err)); + ALOGE_IF(err, "couldn't open gralloc HAL (%s)", strerror(-err)); // bail out if we can't initialize the modules if (!fbDev || !grDev) @@ -113,7 +113,7 @@ FramebufferNativeWindow::FramebufferNativeWindow() fbDev->width, fbDev->height, fbDev->format, GRALLOC_USAGE_HW_FB, &buffers[i]->handle, &buffers[i]->stride); - LOGE_IF(err, "fb buffer %d allocation failed w=%d, h=%d, err=%s", + ALOGE_IF(err, "fb buffer %d allocation failed w=%d, h=%d, err=%s", i, fbDev->width, fbDev->height, strerror(-err)); if (err) @@ -133,7 +133,7 @@ FramebufferNativeWindow::FramebufferNativeWindow() const_cast<int&>(ANativeWindow::maxSwapInterval) = fbDev->maxSwapInterval; } else { - LOGE("Couldn't get gralloc module"); + ALOGE("Couldn't get gralloc module"); } ANativeWindow::setSwapInterval = setSwapInterval; diff --git a/libs/ui/GraphicBuffer.cpp b/libs/ui/GraphicBuffer.cpp index 54a3ffa..f549a37 100644 --- a/libs/ui/GraphicBuffer.cpp +++ b/libs/ui/GraphicBuffer.cpp @@ -167,7 +167,7 @@ status_t GraphicBuffer::lock(uint32_t usage, const Rect& rect, void** vaddr) { if (rect.left < 0 || rect.right > this->width || rect.top < 0 || rect.bottom > this->height) { - LOGE("locking pixels (%d,%d,%d,%d) outside of buffer (w=%d, h=%d)", + ALOGE("locking pixels (%d,%d,%d,%d) outside of buffer (w=%d, h=%d)", rect.left, rect.top, rect.right, rect.bottom, this->width, this->height); return BAD_VALUE; diff --git a/libs/ui/GraphicBufferAllocator.cpp b/libs/ui/GraphicBufferAllocator.cpp index e75415b..d344737 100644 --- a/libs/ui/GraphicBufferAllocator.cpp +++ b/libs/ui/GraphicBufferAllocator.cpp @@ -38,7 +38,7 @@ GraphicBufferAllocator::GraphicBufferAllocator() { hw_module_t const* module; int err = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module); - LOGE_IF(err, "FATAL: can't find the %s module", GRALLOC_HARDWARE_MODULE_ID); + ALOGE_IF(err, "FATAL: can't find the %s module", GRALLOC_HARDWARE_MODULE_ID); if (err == 0) { gralloc_open(module, &mAllocDev); } @@ -85,7 +85,7 @@ void GraphicBufferAllocator::dumpToSystemLog() { String8 s; GraphicBufferAllocator::getInstance().dump(s); - LOGD("%s", s.string()); + ALOGD("%s", s.string()); } status_t GraphicBufferAllocator::alloc(uint32_t w, uint32_t h, PixelFormat format, @@ -101,7 +101,7 @@ status_t GraphicBufferAllocator::alloc(uint32_t w, uint32_t h, PixelFormat forma err = mAllocDev->alloc(mAllocDev, w, h, format, usage, handle, stride); - LOGW_IF(err, "alloc(%u, %u, %d, %08x, ...) failed %d (%s)", + ALOGW_IF(err, "alloc(%u, %u, %d, %08x, ...) failed %d (%s)", w, h, format, usage, err, strerror(-err)); if (err == NO_ERROR) { @@ -132,7 +132,7 @@ status_t GraphicBufferAllocator::free(buffer_handle_t handle) err = mAllocDev->free(mAllocDev, handle); - LOGW_IF(err, "free(...) failed %d (%s)", err, strerror(-err)); + ALOGW_IF(err, "free(...) failed %d (%s)", err, strerror(-err)); if (err == NO_ERROR) { Mutex::Autolock _l(sLock); KeyedVector<buffer_handle_t, alloc_rec_t>& list(sAllocList); diff --git a/libs/ui/GraphicBufferMapper.cpp b/libs/ui/GraphicBufferMapper.cpp index 07c0674..b173c85 100644 --- a/libs/ui/GraphicBufferMapper.cpp +++ b/libs/ui/GraphicBufferMapper.cpp @@ -38,7 +38,7 @@ GraphicBufferMapper::GraphicBufferMapper() { hw_module_t const* module; int err = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module); - LOGE_IF(err, "FATAL: can't find the %s module", GRALLOC_HARDWARE_MODULE_ID); + ALOGE_IF(err, "FATAL: can't find the %s module", GRALLOC_HARDWARE_MODULE_ID); if (err == 0) { mAllocMod = (gralloc_module_t const *)module; } @@ -50,7 +50,7 @@ status_t GraphicBufferMapper::registerBuffer(buffer_handle_t handle) err = mAllocMod->registerBuffer(mAllocMod, handle); - LOGW_IF(err, "registerBuffer(%p) failed %d (%s)", + ALOGW_IF(err, "registerBuffer(%p) failed %d (%s)", handle, err, strerror(-err)); return err; } @@ -61,7 +61,7 @@ status_t GraphicBufferMapper::unregisterBuffer(buffer_handle_t handle) err = mAllocMod->unregisterBuffer(mAllocMod, handle); - LOGW_IF(err, "unregisterBuffer(%p) failed %d (%s)", + ALOGW_IF(err, "unregisterBuffer(%p) failed %d (%s)", handle, err, strerror(-err)); return err; } @@ -75,7 +75,7 @@ status_t GraphicBufferMapper::lock(buffer_handle_t handle, bounds.left, bounds.top, bounds.width(), bounds.height(), vaddr); - LOGW_IF(err, "lock(...) failed %d (%s)", err, strerror(-err)); + ALOGW_IF(err, "lock(...) failed %d (%s)", err, strerror(-err)); return err; } @@ -85,7 +85,7 @@ status_t GraphicBufferMapper::unlock(buffer_handle_t handle) err = mAllocMod->unlock(mAllocMod, handle); - LOGW_IF(err, "unlock(...) failed %d (%s)", err, strerror(-err)); + ALOGW_IF(err, "unlock(...) failed %d (%s)", err, strerror(-err)); return err; } diff --git a/libs/ui/Input.cpp b/libs/ui/Input.cpp index 3de75ba..263c8d9 100644 --- a/libs/ui/Input.cpp +++ b/libs/ui/Input.cpp @@ -106,11 +106,11 @@ String8 getInputDeviceConfigurationFilePathByName( path.append("/usr/"); appendInputDeviceConfigurationFileRelativePath(path, name, type); #if DEBUG_PROBE - LOGD("Probing for system provided input device configuration file: path='%s'", path.string()); + ALOGD("Probing for system provided input device configuration file: path='%s'", path.string()); #endif if (!access(path.string(), R_OK)) { #if DEBUG_PROBE - LOGD("Found"); + ALOGD("Found"); #endif return path; } @@ -121,18 +121,18 @@ String8 getInputDeviceConfigurationFilePathByName( path.append("/system/devices/"); appendInputDeviceConfigurationFileRelativePath(path, name, type); #if DEBUG_PROBE - LOGD("Probing for system user input device configuration file: path='%s'", path.string()); + ALOGD("Probing for system user input device configuration file: path='%s'", path.string()); #endif if (!access(path.string(), R_OK)) { #if DEBUG_PROBE - LOGD("Found"); + ALOGD("Found"); #endif return path; } // Not found. #if DEBUG_PROBE - LOGD("Probe failed to find input device configuration file: name='%s', type=%d", + ALOGD("Probe failed to find input device configuration file: name='%s', type=%d", name.string(), type); #endif return String8(); @@ -345,7 +345,7 @@ status_t PointerCoords::writeToParcel(Parcel* parcel) const { #endif void PointerCoords::tooManyAxes(int axis) { - LOGW("Could not set value for axis %d because the PointerCoords structure is full and " + ALOGW("Could not set value for axis %d because the PointerCoords structure is full and " "cannot contain more than %d axis values.", axis, int(MAX_AXES)); } @@ -782,7 +782,7 @@ void VelocityTracker::addMovement(nsecs_t eventTime, BitSet32 idBits, const Posi } #if DEBUG_VELOCITY - LOGD("VelocityTracker: addMovement eventTime=%lld, idBits=0x%08x, activePointerId=%d", + ALOGD("VelocityTracker: addMovement eventTime=%lld, idBits=0x%08x, activePointerId=%d", eventTime, idBits.value, mActivePointerId); for (BitSet32 iterBits(idBits); !iterBits.isEmpty(); ) { uint32_t id = iterBits.firstMarkedBit(); @@ -790,7 +790,7 @@ void VelocityTracker::addMovement(nsecs_t eventTime, BitSet32 idBits, const Posi iterBits.clearBit(id); Estimator estimator; getEstimator(id, DEFAULT_DEGREE, DEFAULT_HORIZON, &estimator); - LOGD(" %d: position (%0.3f, %0.3f), " + ALOGD(" %d: position (%0.3f, %0.3f), " "estimator (degree=%d, xCoeff=%s, yCoeff=%s, confidence=%f)", id, positions[index].x, positions[index].y, int(estimator.degree), @@ -903,7 +903,7 @@ void VelocityTracker::addMovement(const MotionEvent* event) { static bool solveLeastSquares(const float* x, const float* y, uint32_t m, uint32_t n, float* outB, float* outDet) { #if DEBUG_LEAST_SQUARES - LOGD("solveLeastSquares: m=%d, n=%d, x=%s, y=%s", int(m), int(n), + ALOGD("solveLeastSquares: m=%d, n=%d, x=%s, y=%s", int(m), int(n), vectorToString(x, m).string(), vectorToString(y, m).string()); #endif @@ -916,7 +916,7 @@ static bool solveLeastSquares(const float* x, const float* y, uint32_t m, uint32 } } #if DEBUG_LEAST_SQUARES - LOGD(" - a=%s", matrixToString(&a[0][0], m, n, false /*rowMajor*/).string()); + ALOGD(" - a=%s", matrixToString(&a[0][0], m, n, false /*rowMajor*/).string()); #endif // Apply the Gram-Schmidt process to A to obtain its QR decomposition. @@ -937,7 +937,7 @@ static bool solveLeastSquares(const float* x, const float* y, uint32_t m, uint32 if (norm < 0.000001f) { // vectors are linearly dependent or zero so no solution #if DEBUG_LEAST_SQUARES - LOGD(" - no solution, norm=%f", norm); + ALOGD(" - no solution, norm=%f", norm); #endif return false; } @@ -951,8 +951,8 @@ static bool solveLeastSquares(const float* x, const float* y, uint32_t m, uint32 } } #if DEBUG_LEAST_SQUARES - LOGD(" - q=%s", matrixToString(&q[0][0], m, n, false /*rowMajor*/).string()); - LOGD(" - r=%s", matrixToString(&r[0][0], n, n, true /*rowMajor*/).string()); + ALOGD(" - q=%s", matrixToString(&q[0][0], m, n, false /*rowMajor*/).string()); + ALOGD(" - r=%s", matrixToString(&r[0][0], n, n, true /*rowMajor*/).string()); // calculate QR, if we factored A correctly then QR should equal A float qr[n][m]; @@ -964,7 +964,7 @@ static bool solveLeastSquares(const float* x, const float* y, uint32_t m, uint32 } } } - LOGD(" - qr=%s", matrixToString(&qr[0][0], m, n, false /*rowMajor*/).string()); + ALOGD(" - qr=%s", matrixToString(&qr[0][0], m, n, false /*rowMajor*/).string()); #endif // Solve R B = Qt Y to find B. This is easy because R is upper triangular. @@ -977,7 +977,7 @@ static bool solveLeastSquares(const float* x, const float* y, uint32_t m, uint32 outB[i] /= r[i][i]; } #if DEBUG_LEAST_SQUARES - LOGD(" - b=%s", vectorToString(outB, n).string()); + ALOGD(" - b=%s", vectorToString(outB, n).string()); #endif // Calculate the coefficient of determination as 1 - (SSerr / SStot) where @@ -1004,9 +1004,9 @@ static bool solveLeastSquares(const float* x, const float* y, uint32_t m, uint32 } *outDet = sstot > 0.000001f ? 1.0f - (sserr / sstot) : 1; #if DEBUG_LEAST_SQUARES - LOGD(" - sserr=%f", sserr); - LOGD(" - sstot=%f", sstot); - LOGD(" - det=%f", *outDet); + ALOGD(" - sserr=%f", sserr); + ALOGD(" - sstot=%f", sstot); + ALOGD(" - det=%f", *outDet); #endif return true; } @@ -1073,7 +1073,7 @@ bool VelocityTracker::getEstimator(uint32_t id, uint32_t degree, nsecs_t horizon outEstimator->degree = degree; outEstimator->confidence = xdet * ydet; #if DEBUG_LEAST_SQUARES - LOGD("estimate: degree=%d, xCoeff=%s, yCoeff=%s, confidence=%f", + ALOGD("estimate: degree=%d, xCoeff=%s, yCoeff=%s, confidence=%f", int(outEstimator->degree), vectorToString(outEstimator->xCoeff, n).string(), vectorToString(outEstimator->yCoeff, n).string(), @@ -1116,7 +1116,7 @@ void VelocityControl::move(nsecs_t eventTime, float* deltaX, float* deltaY) { if ((deltaX && *deltaX) || (deltaY && *deltaY)) { if (eventTime >= mLastMovementTime + STOP_TIME) { #if DEBUG_ACCELERATION - LOGD("VelocityControl: stopped, last movement was %0.3fms ago", + ALOGD("VelocityControl: stopped, last movement was %0.3fms ago", (eventTime - mLastMovementTime) * 0.000001f); #endif reset(); @@ -1147,7 +1147,7 @@ void VelocityControl::move(nsecs_t eventTime, float* deltaX, float* deltaY) { } #if DEBUG_ACCELERATION - LOGD("VelocityControl(%0.3f, %0.3f, %0.3f, %0.3f): " + ALOGD("VelocityControl(%0.3f, %0.3f, %0.3f, %0.3f): " "vx=%0.3f, vy=%0.3f, speed=%0.3f, accel=%0.3f", mParameters.scale, mParameters.lowThreshold, mParameters.highThreshold, mParameters.acceleration, @@ -1155,7 +1155,7 @@ void VelocityControl::move(nsecs_t eventTime, float* deltaX, float* deltaY) { #endif } else { #if DEBUG_ACCELERATION - LOGD("VelocityControl(%0.3f, %0.3f, %0.3f, %0.3f): unknown velocity", + ALOGD("VelocityControl(%0.3f, %0.3f, %0.3f, %0.3f): unknown velocity", mParameters.scale, mParameters.lowThreshold, mParameters.highThreshold, mParameters.acceleration); #endif diff --git a/libs/ui/InputTransport.cpp b/libs/ui/InputTransport.cpp index 1e602e9..09cbb31 100644 --- a/libs/ui/InputTransport.cpp +++ b/libs/ui/InputTransport.cpp @@ -55,7 +55,7 @@ InputChannel::InputChannel(const String8& name, int32_t ashmemFd, int32_t receiv int32_t sendPipeFd) : mName(name), mAshmemFd(ashmemFd), mReceivePipeFd(receivePipeFd), mSendPipeFd(sendPipeFd) { #if DEBUG_CHANNEL_LIFECYCLE - LOGD("Input channel constructed: name='%s', ashmemFd=%d, receivePipeFd=%d, sendPipeFd=%d", + ALOGD("Input channel constructed: name='%s', ashmemFd=%d, receivePipeFd=%d, sendPipeFd=%d", mName.string(), ashmemFd, receivePipeFd, sendPipeFd); #endif @@ -70,7 +70,7 @@ InputChannel::InputChannel(const String8& name, int32_t ashmemFd, int32_t receiv InputChannel::~InputChannel() { #if DEBUG_CHANNEL_LIFECYCLE - LOGD("Input channel destroyed: name='%s', ashmemFd=%d, receivePipeFd=%d, sendPipeFd=%d", + ALOGD("Input channel destroyed: name='%s', ashmemFd=%d, receivePipeFd=%d, sendPipeFd=%d", mName.string(), mAshmemFd, mReceivePipeFd, mSendPipeFd); #endif @@ -88,12 +88,12 @@ status_t InputChannel::openInputChannelPair(const String8& name, int serverAshmemFd = ashmem_create_region(ashmemName.string(), DEFAULT_MESSAGE_BUFFER_SIZE); if (serverAshmemFd < 0) { result = -errno; - LOGE("channel '%s' ~ Could not create shared memory region. errno=%d", + ALOGE("channel '%s' ~ Could not create shared memory region. errno=%d", name.string(), errno); } else { result = ashmem_set_prot_region(serverAshmemFd, PROT_READ | PROT_WRITE); if (result < 0) { - LOGE("channel '%s' ~ Error %d trying to set protection of ashmem fd %d.", + ALOGE("channel '%s' ~ Error %d trying to set protection of ashmem fd %d.", name.string(), result, serverAshmemFd); } else { // Dup the file descriptor because the server and client input channel objects that @@ -102,19 +102,19 @@ status_t InputChannel::openInputChannelPair(const String8& name, clientAshmemFd = dup(serverAshmemFd); if (clientAshmemFd < 0) { result = -errno; - LOGE("channel '%s' ~ Could not dup() shared memory region fd. errno=%d", + ALOGE("channel '%s' ~ Could not dup() shared memory region fd. errno=%d", name.string(), errno); } else { int forward[2]; if (pipe(forward)) { result = -errno; - LOGE("channel '%s' ~ Could not create forward pipe. errno=%d", + ALOGE("channel '%s' ~ Could not create forward pipe. errno=%d", name.string(), errno); } else { int reverse[2]; if (pipe(reverse)) { result = -errno; - LOGE("channel '%s' ~ Could not create reverse pipe. errno=%d", + ALOGE("channel '%s' ~ Could not create reverse pipe. errno=%d", name.string(), errno); } else { String8 serverChannelName = name; @@ -150,13 +150,13 @@ status_t InputChannel::sendSignal(char signal) { if (nWrite == 1) { #if DEBUG_CHANNEL_SIGNALS - LOGD("channel '%s' ~ sent signal '%c'", mName.string(), signal); + ALOGD("channel '%s' ~ sent signal '%c'", mName.string(), signal); #endif return OK; } #if DEBUG_CHANNEL_SIGNALS - LOGD("channel '%s' ~ error sending signal '%c', errno=%d", mName.string(), signal, errno); + ALOGD("channel '%s' ~ error sending signal '%c', errno=%d", mName.string(), signal, errno); #endif return -errno; } @@ -169,27 +169,27 @@ status_t InputChannel::receiveSignal(char* outSignal) { if (nRead == 1) { #if DEBUG_CHANNEL_SIGNALS - LOGD("channel '%s' ~ received signal '%c'", mName.string(), *outSignal); + ALOGD("channel '%s' ~ received signal '%c'", mName.string(), *outSignal); #endif return OK; } if (nRead == 0) { // check for EOF #if DEBUG_CHANNEL_SIGNALS - LOGD("channel '%s' ~ receive signal failed because peer was closed", mName.string()); + ALOGD("channel '%s' ~ receive signal failed because peer was closed", mName.string()); #endif return DEAD_OBJECT; } if (errno == EAGAIN) { #if DEBUG_CHANNEL_SIGNALS - LOGD("channel '%s' ~ receive signal failed because no signal available", mName.string()); + ALOGD("channel '%s' ~ receive signal failed because no signal available", mName.string()); #endif return WOULD_BLOCK; } #if DEBUG_CHANNEL_SIGNALS - LOGD("channel '%s' ~ receive signal failed, errno=%d", mName.string(), errno); + ALOGD("channel '%s' ~ receive signal failed, errno=%d", mName.string(), errno); #endif return -errno; } @@ -213,14 +213,14 @@ InputPublisher::~InputPublisher() { status_t InputPublisher::initialize() { #if DEBUG_TRANSPORT_ACTIONS - LOGD("channel '%s' publisher ~ initialize", + ALOGD("channel '%s' publisher ~ initialize", mChannel->getName().string()); #endif int ashmemFd = mChannel->getAshmemFd(); int result = ashmem_get_size_region(ashmemFd); if (result < 0) { - LOGE("channel '%s' publisher ~ Error %d getting size of ashmem fd %d.", + ALOGE("channel '%s' publisher ~ Error %d getting size of ashmem fd %d.", mChannel->getName().string(), result, ashmemFd); return UNKNOWN_ERROR; } @@ -229,7 +229,7 @@ status_t InputPublisher::initialize() { mSharedMessage = static_cast<InputMessage*>(mmap(NULL, mAshmemSize, PROT_READ | PROT_WRITE, MAP_SHARED, ashmemFd, 0)); if (! mSharedMessage) { - LOGE("channel '%s' publisher ~ mmap failed on ashmem fd %d.", + ALOGE("channel '%s' publisher ~ mmap failed on ashmem fd %d.", mChannel->getName().string(), ashmemFd); return NO_MEMORY; } @@ -242,7 +242,7 @@ status_t InputPublisher::initialize() { status_t InputPublisher::reset() { #if DEBUG_TRANSPORT_ACTIONS - LOGD("channel '%s' publisher ~ reset", + ALOGD("channel '%s' publisher ~ reset", mChannel->getName().string()); #endif @@ -253,7 +253,7 @@ status_t InputPublisher::reset() { if (mSharedMessage->consumed) { result = sem_post(& mSharedMessage->semaphore); if (result < 0) { - LOGE("channel '%s' publisher ~ Error %d in sem_post.", + ALOGE("channel '%s' publisher ~ Error %d in sem_post.", mChannel->getName().string(), errno); return UNKNOWN_ERROR; } @@ -261,7 +261,7 @@ status_t InputPublisher::reset() { result = sem_destroy(& mSharedMessage->semaphore); if (result < 0) { - LOGE("channel '%s' publisher ~ Error %d in sem_destroy.", + ALOGE("channel '%s' publisher ~ Error %d in sem_destroy.", mChannel->getName().string(), errno); return UNKNOWN_ERROR; } @@ -273,7 +273,7 @@ status_t InputPublisher::reset() { int ashmemFd = mChannel->getAshmemFd(); result = ashmem_unpin_region(ashmemFd, 0, 0); if (result < 0) { - LOGE("channel '%s' publisher ~ Error %d unpinning ashmem fd %d.", + ALOGE("channel '%s' publisher ~ Error %d unpinning ashmem fd %d.", mChannel->getName().string(), result, ashmemFd); return UNKNOWN_ERROR; } @@ -291,7 +291,7 @@ status_t InputPublisher::publishInputEvent( int32_t deviceId, int32_t source) { if (mPinned) { - LOGE("channel '%s' publisher ~ Attempted to publish a new event but publisher has " + ALOGE("channel '%s' publisher ~ Attempted to publish a new event but publisher has " "not yet been reset.", mChannel->getName().string()); return INVALID_OPERATION; } @@ -302,7 +302,7 @@ status_t InputPublisher::publishInputEvent( int ashmemFd = mChannel->getAshmemFd(); int result = ashmem_pin_region(ashmemFd, 0, 0); if (result < 0) { - LOGE("channel '%s' publisher ~ Error %d pinning ashmem fd %d.", + ALOGE("channel '%s' publisher ~ Error %d pinning ashmem fd %d.", mChannel->getName().string(), result, ashmemFd); return UNKNOWN_ERROR; } @@ -311,7 +311,7 @@ status_t InputPublisher::publishInputEvent( result = sem_init(& mSharedMessage->semaphore, 1, 1); if (result < 0) { - LOGE("channel '%s' publisher ~ Error %d in sem_init.", + ALOGE("channel '%s' publisher ~ Error %d in sem_init.", mChannel->getName().string(), errno); return UNKNOWN_ERROR; } @@ -337,7 +337,7 @@ status_t InputPublisher::publishKeyEvent( nsecs_t downTime, nsecs_t eventTime) { #if DEBUG_TRANSPORT_ACTIONS - LOGD("channel '%s' publisher ~ publishKeyEvent: deviceId=%d, source=0x%x, " + ALOGD("channel '%s' publisher ~ publishKeyEvent: deviceId=%d, source=0x%x, " "action=0x%x, flags=0x%x, keyCode=%d, scanCode=%d, metaState=0x%x, repeatCount=%d," "downTime=%lld, eventTime=%lld", mChannel->getName().string(), @@ -379,7 +379,7 @@ status_t InputPublisher::publishMotionEvent( const PointerProperties* pointerProperties, const PointerCoords* pointerCoords) { #if DEBUG_TRANSPORT_ACTIONS - LOGD("channel '%s' publisher ~ publishMotionEvent: deviceId=%d, source=0x%x, " + ALOGD("channel '%s' publisher ~ publishMotionEvent: deviceId=%d, source=0x%x, " "action=0x%x, flags=0x%x, edgeFlags=0x%x, metaState=0x%x, buttonState=0x%x, " "xOffset=%f, yOffset=%f, " "xPrecision=%f, yPrecision=%f, downTime=%lld, eventTime=%lld, " @@ -390,7 +390,7 @@ status_t InputPublisher::publishMotionEvent( #endif if (pointerCount > MAX_POINTERS || pointerCount < 1) { - LOGE("channel '%s' publisher ~ Invalid number of pointers provided: %d.", + ALOGE("channel '%s' publisher ~ Invalid number of pointers provided: %d.", mChannel->getName().string(), pointerCount); return BAD_VALUE; } @@ -439,12 +439,12 @@ status_t InputPublisher::appendMotionSample( nsecs_t eventTime, const PointerCoords* pointerCoords) { #if DEBUG_TRANSPORT_ACTIONS - LOGD("channel '%s' publisher ~ appendMotionSample: eventTime=%lld", + ALOGD("channel '%s' publisher ~ appendMotionSample: eventTime=%lld", mChannel->getName().string(), eventTime); #endif if (! mPinned || ! mMotionEventSampleDataTail) { - LOGE("channel '%s' publisher ~ Cannot append motion sample because there is no current " + ALOGE("channel '%s' publisher ~ Cannot append motion sample because there is no current " "AMOTION_EVENT_ACTION_MOVE or AMOTION_EVENT_ACTION_HOVER_MOVE event.", mChannel->getName().string()); return INVALID_OPERATION; @@ -457,7 +457,7 @@ status_t InputPublisher::appendMotionSample( if (newBytesUsed > mAshmemSize) { #if DEBUG_TRANSPORT_ACTIONS - LOGD("channel '%s' publisher ~ Cannot append motion sample because the shared memory " + ALOGD("channel '%s' publisher ~ Cannot append motion sample because the shared memory " "buffer is full. Buffer size: %d bytes, pointers: %d, samples: %d", mChannel->getName().string(), mAshmemSize, mMotionEventPointerCount, mSharedMessage->motion.sampleCount); @@ -473,12 +473,12 @@ status_t InputPublisher::appendMotionSample( // Only possible source of contention is the consumer having consumed (or being in the // process of consuming) the message and left the semaphore count at 0. #if DEBUG_TRANSPORT_ACTIONS - LOGD("channel '%s' publisher ~ Cannot append motion sample because the message has " + ALOGD("channel '%s' publisher ~ Cannot append motion sample because the message has " "already been consumed.", mChannel->getName().string()); #endif return FAILED_TRANSACTION; } else { - LOGE("channel '%s' publisher ~ Error %d in sem_trywait.", + ALOGE("channel '%s' publisher ~ Error %d in sem_trywait.", mChannel->getName().string(), errno); return UNKNOWN_ERROR; } @@ -496,7 +496,7 @@ status_t InputPublisher::appendMotionSample( if (mWasDispatched) { result = sem_post(& mSharedMessage->semaphore); if (result < 0) { - LOGE("channel '%s' publisher ~ Error %d in sem_post.", + ALOGE("channel '%s' publisher ~ Error %d in sem_post.", mChannel->getName().string(), errno); return UNKNOWN_ERROR; } @@ -506,7 +506,7 @@ status_t InputPublisher::appendMotionSample( status_t InputPublisher::sendDispatchSignal() { #if DEBUG_TRANSPORT_ACTIONS - LOGD("channel '%s' publisher ~ sendDispatchSignal", + ALOGD("channel '%s' publisher ~ sendDispatchSignal", mChannel->getName().string()); #endif @@ -516,7 +516,7 @@ status_t InputPublisher::sendDispatchSignal() { status_t InputPublisher::receiveFinishedSignal(bool* outHandled) { #if DEBUG_TRANSPORT_ACTIONS - LOGD("channel '%s' publisher ~ receiveFinishedSignal", + ALOGD("channel '%s' publisher ~ receiveFinishedSignal", mChannel->getName().string()); #endif @@ -531,7 +531,7 @@ status_t InputPublisher::receiveFinishedSignal(bool* outHandled) { } else if (signal == INPUT_SIGNAL_FINISHED_UNHANDLED) { *outHandled = false; } else { - LOGE("channel '%s' publisher ~ Received unexpected signal '%c' from consumer", + ALOGE("channel '%s' publisher ~ Received unexpected signal '%c' from consumer", mChannel->getName().string(), signal); return UNKNOWN_ERROR; } @@ -552,14 +552,14 @@ InputConsumer::~InputConsumer() { status_t InputConsumer::initialize() { #if DEBUG_TRANSPORT_ACTIONS - LOGD("channel '%s' consumer ~ initialize", + ALOGD("channel '%s' consumer ~ initialize", mChannel->getName().string()); #endif int ashmemFd = mChannel->getAshmemFd(); int result = ashmem_get_size_region(ashmemFd); if (result < 0) { - LOGE("channel '%s' consumer ~ Error %d getting size of ashmem fd %d.", + ALOGE("channel '%s' consumer ~ Error %d getting size of ashmem fd %d.", mChannel->getName().string(), result, ashmemFd); return UNKNOWN_ERROR; } @@ -569,7 +569,7 @@ status_t InputConsumer::initialize() { mSharedMessage = static_cast<InputMessage*>(mmap(NULL, mAshmemSize, PROT_READ | PROT_WRITE, MAP_SHARED, ashmemFd, 0)); if (! mSharedMessage) { - LOGE("channel '%s' consumer ~ mmap failed on ashmem fd %d.", + ALOGE("channel '%s' consumer ~ mmap failed on ashmem fd %d.", mChannel->getName().string(), ashmemFd); return NO_MEMORY; } @@ -579,7 +579,7 @@ status_t InputConsumer::initialize() { status_t InputConsumer::consume(InputEventFactoryInterface* factory, InputEvent** outEvent) { #if DEBUG_TRANSPORT_ACTIONS - LOGD("channel '%s' consumer ~ consume", + ALOGD("channel '%s' consumer ~ consume", mChannel->getName().string()); #endif @@ -589,19 +589,19 @@ status_t InputConsumer::consume(InputEventFactoryInterface* factory, InputEvent* int result = ashmem_pin_region(ashmemFd, 0, 0); if (result != ASHMEM_NOT_PURGED) { if (result == ASHMEM_WAS_PURGED) { - LOGE("channel '%s' consumer ~ Error %d pinning ashmem fd %d because it was purged " + ALOGE("channel '%s' consumer ~ Error %d pinning ashmem fd %d because it was purged " "which probably indicates that the publisher and consumer are out of sync.", mChannel->getName().string(), result, ashmemFd); return INVALID_OPERATION; } - LOGE("channel '%s' consumer ~ Error %d pinning ashmem fd %d.", + ALOGE("channel '%s' consumer ~ Error %d pinning ashmem fd %d.", mChannel->getName().string(), result, ashmemFd); return UNKNOWN_ERROR; } if (mSharedMessage->consumed) { - LOGE("channel '%s' consumer ~ The current message has already been consumed.", + ALOGE("channel '%s' consumer ~ The current message has already been consumed.", mChannel->getName().string()); return INVALID_OPERATION; } @@ -611,7 +611,7 @@ status_t InputConsumer::consume(InputEventFactoryInterface* factory, InputEvent* // consumed). Eventually the publisher will reinitialize the semaphore for the next message. result = sem_wait(& mSharedMessage->semaphore); if (result < 0) { - LOGE("channel '%s' consumer ~ Error %d in sem_wait.", + ALOGE("channel '%s' consumer ~ Error %d in sem_wait.", mChannel->getName().string(), errno); return UNKNOWN_ERROR; } @@ -640,7 +640,7 @@ status_t InputConsumer::consume(InputEventFactoryInterface* factory, InputEvent* } default: - LOGE("channel '%s' consumer ~ Received message of unknown type %d", + ALOGE("channel '%s' consumer ~ Received message of unknown type %d", mChannel->getName().string(), mSharedMessage->type); return UNKNOWN_ERROR; } @@ -650,7 +650,7 @@ status_t InputConsumer::consume(InputEventFactoryInterface* factory, InputEvent* status_t InputConsumer::sendFinishedSignal(bool handled) { #if DEBUG_TRANSPORT_ACTIONS - LOGD("channel '%s' consumer ~ sendFinishedSignal: handled=%d", + ALOGD("channel '%s' consumer ~ sendFinishedSignal: handled=%d", mChannel->getName().string(), handled); #endif @@ -661,7 +661,7 @@ status_t InputConsumer::sendFinishedSignal(bool handled) { status_t InputConsumer::receiveDispatchSignal() { #if DEBUG_TRANSPORT_ACTIONS - LOGD("channel '%s' consumer ~ receiveDispatchSignal", + ALOGD("channel '%s' consumer ~ receiveDispatchSignal", mChannel->getName().string()); #endif @@ -671,7 +671,7 @@ status_t InputConsumer::receiveDispatchSignal() { return result; } if (signal != INPUT_SIGNAL_DISPATCH) { - LOGE("channel '%s' consumer ~ Received unexpected signal '%c' from publisher", + ALOGE("channel '%s' consumer ~ Received unexpected signal '%c' from publisher", mChannel->getName().string(), signal); return UNKNOWN_ERROR; } diff --git a/libs/ui/KeyCharacterMap.cpp b/libs/ui/KeyCharacterMap.cpp index 77f18de..485234c 100644 --- a/libs/ui/KeyCharacterMap.cpp +++ b/libs/ui/KeyCharacterMap.cpp @@ -95,11 +95,11 @@ status_t KeyCharacterMap::load(const String8& filename, KeyCharacterMap** outMap Tokenizer* tokenizer; status_t status = Tokenizer::open(filename, &tokenizer); if (status) { - LOGE("Error %d opening key character map file %s.", status, filename.string()); + ALOGE("Error %d opening key character map file %s.", status, filename.string()); } else { KeyCharacterMap* map = new KeyCharacterMap(); if (!map) { - LOGE("Error allocating key character map."); + ALOGE("Error allocating key character map."); status = NO_MEMORY; } else { #if DEBUG_PARSER_PERFORMANCE @@ -109,7 +109,7 @@ status_t KeyCharacterMap::load(const String8& filename, KeyCharacterMap** outMap status = parser.parse(); #if DEBUG_PARSER_PERFORMANCE nsecs_t elapsedTime = systemTime(SYSTEM_TIME_MONOTONIC) - startTime; - LOGD("Parsed key character map file '%s' %d lines in %0.3fms.", + ALOGD("Parsed key character map file '%s' %d lines in %0.3fms.", tokenizer->getFilename().string(), tokenizer->getLineNumber(), elapsedTime / 1000000.0); #endif @@ -135,7 +135,7 @@ char16_t KeyCharacterMap::getDisplayLabel(int32_t keyCode) const { result = key->label; } #if DEBUG_MAPPING - LOGD("getDisplayLabel: keyCode=%d ~ Result %d.", keyCode, result); + ALOGD("getDisplayLabel: keyCode=%d ~ Result %d.", keyCode, result); #endif return result; } @@ -147,7 +147,7 @@ char16_t KeyCharacterMap::getNumber(int32_t keyCode) const { result = key->number; } #if DEBUG_MAPPING - LOGD("getNumber: keyCode=%d ~ Result %d.", keyCode, result); + ALOGD("getNumber: keyCode=%d ~ Result %d.", keyCode, result); #endif return result; } @@ -160,7 +160,7 @@ char16_t KeyCharacterMap::getCharacter(int32_t keyCode, int32_t metaState) const result = behavior->character; } #if DEBUG_MAPPING - LOGD("getCharacter: keyCode=%d, metaState=0x%08x ~ Result %d.", keyCode, metaState, result); + ALOGD("getCharacter: keyCode=%d, metaState=0x%08x ~ Result %d.", keyCode, metaState, result); #endif return result; } @@ -181,7 +181,7 @@ bool KeyCharacterMap::getFallbackAction(int32_t keyCode, int32_t metaState, } } #if DEBUG_MAPPING - LOGD("getFallbackKeyCode: keyCode=%d, metaState=0x%08x ~ Result %s, " + ALOGD("getFallbackKeyCode: keyCode=%d, metaState=0x%08x ~ Result %s, " "fallback keyCode=%d, fallback metaState=0x%08x.", keyCode, metaState, result ? "true" : "false", outFallbackAction->keyCode, outFallbackAction->metaState); @@ -213,7 +213,7 @@ char16_t KeyCharacterMap::getMatch(int32_t keyCode, const char16_t* chars, size_ ExactMatch: ; } #if DEBUG_MAPPING - LOGD("getMatch: keyCode=%d, chars=[%s], metaState=0x%08x ~ Result %d.", + ALOGD("getMatch: keyCode=%d, chars=[%s], metaState=0x%08x ~ Result %d.", keyCode, toString(chars, numChars).string(), metaState, result); #endif return result; @@ -228,7 +228,7 @@ bool KeyCharacterMap::getEvents(int32_t deviceId, const char16_t* chars, size_t char16_t ch = chars[i]; if (!findKey(ch, &keyCode, &metaState)) { #if DEBUG_MAPPING - LOGD("getEvents: deviceId=%d, chars=[%s] ~ Failed to find mapping for character %d.", + ALOGD("getEvents: deviceId=%d, chars=[%s] ~ Failed to find mapping for character %d.", deviceId, toString(chars, numChars).string(), ch); #endif return false; @@ -241,10 +241,10 @@ bool KeyCharacterMap::getEvents(int32_t deviceId, const char16_t* chars, size_t addMetaKeys(outEvents, deviceId, metaState, false, now, ¤tMetaState); } #if DEBUG_MAPPING - LOGD("getEvents: deviceId=%d, chars=[%s] ~ Generated %d events.", + ALOGD("getEvents: deviceId=%d, chars=[%s] ~ Generated %d events.", deviceId, toString(chars, numChars).string(), int32_t(outEvents.size())); for (size_t i = 0; i < outEvents.size(); i++) { - LOGD(" Key: keyCode=%d, metaState=0x%08x, %s.", + ALOGD(" Key: keyCode=%d, metaState=0x%08x, %s.", outEvents[i].getKeyCode(), outEvents[i].getMetaState(), outEvents[i].getAction() == AKEY_EVENT_ACTION_DOWN ? "down" : "up"); } @@ -455,7 +455,7 @@ KeyCharacterMap::Parser::~Parser() { status_t KeyCharacterMap::Parser::parse() { while (!mTokenizer->isEof()) { #if DEBUG_PARSER - LOGD("Parsing %s: '%s'.", mTokenizer->getLocation().string(), + ALOGD("Parsing %s: '%s'.", mTokenizer->getLocation().string(), mTokenizer->peekRemainderOfLine().string()); #endif @@ -474,7 +474,7 @@ status_t KeyCharacterMap::Parser::parse() { status_t status = parseKey(); if (status) return status; } else { - LOGE("%s: Expected keyword, got '%s'.", mTokenizer->getLocation().string(), + ALOGE("%s: Expected keyword, got '%s'.", mTokenizer->getLocation().string(), keywordToken.string()); return BAD_VALUE; } @@ -490,7 +490,7 @@ status_t KeyCharacterMap::Parser::parse() { mTokenizer->skipDelimiters(WHITESPACE); if (!mTokenizer->isEol()) { - LOGE("%s: Expected end of line, got '%s'.", + ALOGE("%s: Expected end of line, got '%s'.", mTokenizer->getLocation().string(), mTokenizer->peekRemainderOfLine().string()); return BAD_VALUE; @@ -501,13 +501,13 @@ status_t KeyCharacterMap::Parser::parse() { } if (mState != STATE_TOP) { - LOGE("%s: Unterminated key description at end of file.", + ALOGE("%s: Unterminated key description at end of file.", mTokenizer->getLocation().string()); return BAD_VALUE; } if (mMap->mType == KEYBOARD_TYPE_UNKNOWN) { - LOGE("%s: Missing required keyboard 'type' declaration.", + ALOGE("%s: Missing required keyboard 'type' declaration.", mTokenizer->getLocation().string()); return BAD_VALUE; } @@ -517,7 +517,7 @@ status_t KeyCharacterMap::Parser::parse() { status_t KeyCharacterMap::Parser::parseType() { if (mMap->mType != KEYBOARD_TYPE_UNKNOWN) { - LOGE("%s: Duplicate keyboard 'type' declaration.", + ALOGE("%s: Duplicate keyboard 'type' declaration.", mTokenizer->getLocation().string()); return BAD_VALUE; } @@ -535,13 +535,13 @@ status_t KeyCharacterMap::Parser::parseType() { } else if (typeToken == "SPECIAL_FUNCTION") { type = KEYBOARD_TYPE_SPECIAL_FUNCTION; } else { - LOGE("%s: Expected keyboard type label, got '%s'.", mTokenizer->getLocation().string(), + ALOGE("%s: Expected keyboard type label, got '%s'.", mTokenizer->getLocation().string(), typeToken.string()); return BAD_VALUE; } #if DEBUG_PARSER - LOGD("Parsed type: type=%d.", type); + ALOGD("Parsed type: type=%d.", type); #endif mMap->mType = type; return NO_ERROR; @@ -551,12 +551,12 @@ status_t KeyCharacterMap::Parser::parseKey() { String8 keyCodeToken = mTokenizer->nextToken(WHITESPACE); int32_t keyCode = getKeyCodeByLabel(keyCodeToken.string()); if (!keyCode) { - LOGE("%s: Expected key code label, got '%s'.", mTokenizer->getLocation().string(), + ALOGE("%s: Expected key code label, got '%s'.", mTokenizer->getLocation().string(), keyCodeToken.string()); return BAD_VALUE; } if (mMap->mKeys.indexOfKey(keyCode) >= 0) { - LOGE("%s: Duplicate entry for key code '%s'.", mTokenizer->getLocation().string(), + ALOGE("%s: Duplicate entry for key code '%s'.", mTokenizer->getLocation().string(), keyCodeToken.string()); return BAD_VALUE; } @@ -564,13 +564,13 @@ status_t KeyCharacterMap::Parser::parseKey() { mTokenizer->skipDelimiters(WHITESPACE); String8 openBraceToken = mTokenizer->nextToken(WHITESPACE); if (openBraceToken != "{") { - LOGE("%s: Expected '{' after key code label, got '%s'.", + ALOGE("%s: Expected '{' after key code label, got '%s'.", mTokenizer->getLocation().string(), openBraceToken.string()); return BAD_VALUE; } #if DEBUG_PARSER - LOGD("Parsed beginning of key: keyCode=%d.", keyCode); + ALOGD("Parsed beginning of key: keyCode=%d.", keyCode); #endif mKeyCode = keyCode; mMap->mKeys.add(keyCode, new Key()); @@ -597,7 +597,7 @@ status_t KeyCharacterMap::Parser::parseKeyProperty() { int32_t metaState; status_t status = parseModifier(token, &metaState); if (status) { - LOGE("%s: Expected a property name or modifier, got '%s'.", + ALOGE("%s: Expected a property name or modifier, got '%s'.", mTokenizer->getLocation().string(), token.string()); return status; } @@ -616,7 +616,7 @@ status_t KeyCharacterMap::Parser::parseKeyProperty() { } } - LOGE("%s: Expected ',' or ':' after property name.", + ALOGE("%s: Expected ',' or ':' after property name.", mTokenizer->getLocation().string()); return BAD_VALUE; } @@ -634,12 +634,12 @@ status_t KeyCharacterMap::Parser::parseKeyProperty() { char16_t character; status_t status = parseCharacterLiteral(&character); if (status || !character) { - LOGE("%s: Invalid character literal for key.", + ALOGE("%s: Invalid character literal for key.", mTokenizer->getLocation().string()); return BAD_VALUE; } if (haveCharacter) { - LOGE("%s: Cannot combine multiple character literals or 'none'.", + ALOGE("%s: Cannot combine multiple character literals or 'none'.", mTokenizer->getLocation().string()); return BAD_VALUE; } @@ -649,7 +649,7 @@ status_t KeyCharacterMap::Parser::parseKeyProperty() { token = mTokenizer->nextToken(WHITESPACE); if (token == "none") { if (haveCharacter) { - LOGE("%s: Cannot combine multiple character literals or 'none'.", + ALOGE("%s: Cannot combine multiple character literals or 'none'.", mTokenizer->getLocation().string()); return BAD_VALUE; } @@ -659,20 +659,20 @@ status_t KeyCharacterMap::Parser::parseKeyProperty() { token = mTokenizer->nextToken(WHITESPACE); int32_t keyCode = getKeyCodeByLabel(token.string()); if (!keyCode) { - LOGE("%s: Invalid key code label for fallback behavior, got '%s'.", + ALOGE("%s: Invalid key code label for fallback behavior, got '%s'.", mTokenizer->getLocation().string(), token.string()); return BAD_VALUE; } if (haveFallback) { - LOGE("%s: Cannot combine multiple fallback key codes.", + ALOGE("%s: Cannot combine multiple fallback key codes.", mTokenizer->getLocation().string()); return BAD_VALUE; } behavior.fallbackKeyCode = keyCode; haveFallback = true; } else { - LOGE("%s: Expected a key behavior after ':'.", + ALOGE("%s: Expected a key behavior after ':'.", mTokenizer->getLocation().string()); return BAD_VALUE; } @@ -688,30 +688,30 @@ status_t KeyCharacterMap::Parser::parseKeyProperty() { switch (property.property) { case PROPERTY_LABEL: if (key->label) { - LOGE("%s: Duplicate label for key.", + ALOGE("%s: Duplicate label for key.", mTokenizer->getLocation().string()); return BAD_VALUE; } key->label = behavior.character; #if DEBUG_PARSER - LOGD("Parsed key label: keyCode=%d, label=%d.", mKeyCode, key->label); + ALOGD("Parsed key label: keyCode=%d, label=%d.", mKeyCode, key->label); #endif break; case PROPERTY_NUMBER: if (key->number) { - LOGE("%s: Duplicate number for key.", + ALOGE("%s: Duplicate number for key.", mTokenizer->getLocation().string()); return BAD_VALUE; } key->number = behavior.character; #if DEBUG_PARSER - LOGD("Parsed key number: keyCode=%d, number=%d.", mKeyCode, key->number); + ALOGD("Parsed key number: keyCode=%d, number=%d.", mKeyCode, key->number); #endif break; case PROPERTY_META: { for (Behavior* b = key->firstBehavior; b; b = b->next) { if (b->metaState == property.metaState) { - LOGE("%s: Duplicate key behavior for modifier.", + ALOGE("%s: Duplicate key behavior for modifier.", mTokenizer->getLocation().string()); return BAD_VALUE; } @@ -721,7 +721,7 @@ status_t KeyCharacterMap::Parser::parseKeyProperty() { newBehavior->next = key->firstBehavior; key->firstBehavior = newBehavior; #if DEBUG_PARSER - LOGD("Parsed key meta: keyCode=%d, meta=0x%x, char=%d, fallback=%d.", mKeyCode, + ALOGD("Parsed key meta: keyCode=%d, meta=0x%x, char=%d, fallback=%d.", mKeyCode, newBehavior->metaState, newBehavior->character, newBehavior->fallbackKeyCode); #endif break; @@ -757,7 +757,7 @@ status_t KeyCharacterMap::Parser::parseModifier(const String8& token, int32_t* o return BAD_VALUE; } if (combinedMeta & metaState) { - LOGE("%s: Duplicate modifier combination '%s'.", + ALOGE("%s: Duplicate modifier combination '%s'.", mTokenizer->getLocation().string(), token.string()); return BAD_VALUE; } @@ -831,7 +831,7 @@ status_t KeyCharacterMap::Parser::parseCharacterLiteral(char16_t* outCharacter) } Error: - LOGE("%s: Malformed character literal.", mTokenizer->getLocation().string()); + ALOGE("%s: Malformed character literal.", mTokenizer->getLocation().string()); return BAD_VALUE; } diff --git a/libs/ui/KeyLayoutMap.cpp b/libs/ui/KeyLayoutMap.cpp index 8626a03..44a9420 100644 --- a/libs/ui/KeyLayoutMap.cpp +++ b/libs/ui/KeyLayoutMap.cpp @@ -53,11 +53,11 @@ status_t KeyLayoutMap::load(const String8& filename, KeyLayoutMap** outMap) { Tokenizer* tokenizer; status_t status = Tokenizer::open(filename, &tokenizer); if (status) { - LOGE("Error %d opening key layout map file %s.", status, filename.string()); + ALOGE("Error %d opening key layout map file %s.", status, filename.string()); } else { KeyLayoutMap* map = new KeyLayoutMap(); if (!map) { - LOGE("Error allocating key layout map."); + ALOGE("Error allocating key layout map."); status = NO_MEMORY; } else { #if DEBUG_PARSER_PERFORMANCE @@ -67,7 +67,7 @@ status_t KeyLayoutMap::load(const String8& filename, KeyLayoutMap** outMap) { status = parser.parse(); #if DEBUG_PARSER_PERFORMANCE nsecs_t elapsedTime = systemTime(SYSTEM_TIME_MONOTONIC) - startTime; - LOGD("Parsed key layout map file '%s' %d lines in %0.3fms.", + ALOGD("Parsed key layout map file '%s' %d lines in %0.3fms.", tokenizer->getFilename().string(), tokenizer->getLineNumber(), elapsedTime / 1000000.0); #endif @@ -86,7 +86,7 @@ status_t KeyLayoutMap::mapKey(int32_t scanCode, int32_t* keyCode, uint32_t* flag ssize_t index = mKeys.indexOfKey(scanCode); if (index < 0) { #if DEBUG_MAPPING - LOGD("mapKey: scanCode=%d ~ Failed.", scanCode); + ALOGD("mapKey: scanCode=%d ~ Failed.", scanCode); #endif *keyCode = AKEYCODE_UNKNOWN; *flags = 0; @@ -98,7 +98,7 @@ status_t KeyLayoutMap::mapKey(int32_t scanCode, int32_t* keyCode, uint32_t* flag *flags = k.flags; #if DEBUG_MAPPING - LOGD("mapKey: scanCode=%d ~ Result keyCode=%d, flags=0x%08x.", scanCode, *keyCode, *flags); + ALOGD("mapKey: scanCode=%d ~ Result keyCode=%d, flags=0x%08x.", scanCode, *keyCode, *flags); #endif return NO_ERROR; } @@ -117,7 +117,7 @@ status_t KeyLayoutMap::mapAxis(int32_t scanCode, AxisInfo* outAxisInfo) const { ssize_t index = mAxes.indexOfKey(scanCode); if (index < 0) { #if DEBUG_MAPPING - LOGD("mapAxis: scanCode=%d ~ Failed.", scanCode); + ALOGD("mapAxis: scanCode=%d ~ Failed.", scanCode); #endif return NAME_NOT_FOUND; } @@ -125,7 +125,7 @@ status_t KeyLayoutMap::mapAxis(int32_t scanCode, AxisInfo* outAxisInfo) const { *outAxisInfo = mAxes.valueAt(index); #if DEBUG_MAPPING - LOGD("mapAxis: scanCode=%d ~ Result mode=%d, axis=%d, highAxis=%d, " + ALOGD("mapAxis: scanCode=%d ~ Result mode=%d, axis=%d, highAxis=%d, " "splitValue=%d, flatOverride=%d.", scanCode, outAxisInfo->mode, outAxisInfo->axis, outAxisInfo->highAxis, @@ -147,7 +147,7 @@ KeyLayoutMap::Parser::~Parser() { status_t KeyLayoutMap::Parser::parse() { while (!mTokenizer->isEof()) { #if DEBUG_PARSER - LOGD("Parsing %s: '%s'.", mTokenizer->getLocation().string(), + ALOGD("Parsing %s: '%s'.", mTokenizer->getLocation().string(), mTokenizer->peekRemainderOfLine().string()); #endif @@ -164,14 +164,14 @@ status_t KeyLayoutMap::Parser::parse() { status_t status = parseAxis(); if (status) return status; } else { - LOGE("%s: Expected keyword, got '%s'.", mTokenizer->getLocation().string(), + ALOGE("%s: Expected keyword, got '%s'.", mTokenizer->getLocation().string(), keywordToken.string()); return BAD_VALUE; } mTokenizer->skipDelimiters(WHITESPACE); if (!mTokenizer->isEol()) { - LOGE("%s: Expected end of line, got '%s'.", + ALOGE("%s: Expected end of line, got '%s'.", mTokenizer->getLocation().string(), mTokenizer->peekRemainderOfLine().string()); return BAD_VALUE; @@ -188,12 +188,12 @@ status_t KeyLayoutMap::Parser::parseKey() { char* end; int32_t scanCode = int32_t(strtol(scanCodeToken.string(), &end, 0)); if (*end) { - LOGE("%s: Expected key scan code number, got '%s'.", mTokenizer->getLocation().string(), + ALOGE("%s: Expected key scan code number, got '%s'.", mTokenizer->getLocation().string(), scanCodeToken.string()); return BAD_VALUE; } if (mMap->mKeys.indexOfKey(scanCode) >= 0) { - LOGE("%s: Duplicate entry for key scan code '%s'.", mTokenizer->getLocation().string(), + ALOGE("%s: Duplicate entry for key scan code '%s'.", mTokenizer->getLocation().string(), scanCodeToken.string()); return BAD_VALUE; } @@ -202,7 +202,7 @@ status_t KeyLayoutMap::Parser::parseKey() { String8 keyCodeToken = mTokenizer->nextToken(WHITESPACE); int32_t keyCode = getKeyCodeByLabel(keyCodeToken.string()); if (!keyCode) { - LOGE("%s: Expected key code label, got '%s'.", mTokenizer->getLocation().string(), + ALOGE("%s: Expected key code label, got '%s'.", mTokenizer->getLocation().string(), keyCodeToken.string()); return BAD_VALUE; } @@ -215,12 +215,12 @@ status_t KeyLayoutMap::Parser::parseKey() { String8 flagToken = mTokenizer->nextToken(WHITESPACE); uint32_t flag = getKeyFlagByLabel(flagToken.string()); if (!flag) { - LOGE("%s: Expected key flag label, got '%s'.", mTokenizer->getLocation().string(), + ALOGE("%s: Expected key flag label, got '%s'.", mTokenizer->getLocation().string(), flagToken.string()); return BAD_VALUE; } if (flags & flag) { - LOGE("%s: Duplicate key flag '%s'.", mTokenizer->getLocation().string(), + ALOGE("%s: Duplicate key flag '%s'.", mTokenizer->getLocation().string(), flagToken.string()); return BAD_VALUE; } @@ -228,7 +228,7 @@ status_t KeyLayoutMap::Parser::parseKey() { } #if DEBUG_PARSER - LOGD("Parsed key: scanCode=%d, keyCode=%d, flags=0x%08x.", scanCode, keyCode, flags); + ALOGD("Parsed key: scanCode=%d, keyCode=%d, flags=0x%08x.", scanCode, keyCode, flags); #endif Key key; key.keyCode = keyCode; @@ -242,12 +242,12 @@ status_t KeyLayoutMap::Parser::parseAxis() { char* end; int32_t scanCode = int32_t(strtol(scanCodeToken.string(), &end, 0)); if (*end) { - LOGE("%s: Expected axis scan code number, got '%s'.", mTokenizer->getLocation().string(), + ALOGE("%s: Expected axis scan code number, got '%s'.", mTokenizer->getLocation().string(), scanCodeToken.string()); return BAD_VALUE; } if (mMap->mAxes.indexOfKey(scanCode) >= 0) { - LOGE("%s: Duplicate entry for axis scan code '%s'.", mTokenizer->getLocation().string(), + ALOGE("%s: Duplicate entry for axis scan code '%s'.", mTokenizer->getLocation().string(), scanCodeToken.string()); return BAD_VALUE; } @@ -263,7 +263,7 @@ status_t KeyLayoutMap::Parser::parseAxis() { String8 axisToken = mTokenizer->nextToken(WHITESPACE); axisInfo.axis = getAxisByLabel(axisToken.string()); if (axisInfo.axis < 0) { - LOGE("%s: Expected inverted axis label, got '%s'.", + ALOGE("%s: Expected inverted axis label, got '%s'.", mTokenizer->getLocation().string(), axisToken.string()); return BAD_VALUE; } @@ -274,7 +274,7 @@ status_t KeyLayoutMap::Parser::parseAxis() { String8 splitToken = mTokenizer->nextToken(WHITESPACE); axisInfo.splitValue = int32_t(strtol(splitToken.string(), &end, 0)); if (*end) { - LOGE("%s: Expected split value, got '%s'.", + ALOGE("%s: Expected split value, got '%s'.", mTokenizer->getLocation().string(), splitToken.string()); return BAD_VALUE; } @@ -283,7 +283,7 @@ status_t KeyLayoutMap::Parser::parseAxis() { String8 lowAxisToken = mTokenizer->nextToken(WHITESPACE); axisInfo.axis = getAxisByLabel(lowAxisToken.string()); if (axisInfo.axis < 0) { - LOGE("%s: Expected low axis label, got '%s'.", + ALOGE("%s: Expected low axis label, got '%s'.", mTokenizer->getLocation().string(), lowAxisToken.string()); return BAD_VALUE; } @@ -292,14 +292,14 @@ status_t KeyLayoutMap::Parser::parseAxis() { String8 highAxisToken = mTokenizer->nextToken(WHITESPACE); axisInfo.highAxis = getAxisByLabel(highAxisToken.string()); if (axisInfo.highAxis < 0) { - LOGE("%s: Expected high axis label, got '%s'.", + ALOGE("%s: Expected high axis label, got '%s'.", mTokenizer->getLocation().string(), highAxisToken.string()); return BAD_VALUE; } } else { axisInfo.axis = getAxisByLabel(token.string()); if (axisInfo.axis < 0) { - LOGE("%s: Expected axis label, 'split' or 'invert', got '%s'.", + ALOGE("%s: Expected axis label, 'split' or 'invert', got '%s'.", mTokenizer->getLocation().string(), token.string()); return BAD_VALUE; } @@ -316,19 +316,19 @@ status_t KeyLayoutMap::Parser::parseAxis() { String8 flatToken = mTokenizer->nextToken(WHITESPACE); axisInfo.flatOverride = int32_t(strtol(flatToken.string(), &end, 0)); if (*end) { - LOGE("%s: Expected flat value, got '%s'.", + ALOGE("%s: Expected flat value, got '%s'.", mTokenizer->getLocation().string(), flatToken.string()); return BAD_VALUE; } } else { - LOGE("%s: Expected keyword 'flat', got '%s'.", + ALOGE("%s: Expected keyword 'flat', got '%s'.", mTokenizer->getLocation().string(), keywordToken.string()); return BAD_VALUE; } } #if DEBUG_PARSER - LOGD("Parsed axis: scanCode=%d, mode=%d, axis=%d, highAxis=%d, " + ALOGD("Parsed axis: scanCode=%d, mode=%d, axis=%d, highAxis=%d, " "splitValue=%d, flatOverride=%d.", scanCode, axisInfo.mode, axisInfo.axis, axisInfo.highAxis, diff --git a/libs/ui/Keyboard.cpp b/libs/ui/Keyboard.cpp index 10bb39c..e4611f7 100644 --- a/libs/ui/Keyboard.cpp +++ b/libs/ui/Keyboard.cpp @@ -50,7 +50,7 @@ status_t KeyMap::load(const InputDeviceIdentifier& deviceIdenfifier, keyLayoutName)) { status_t status = loadKeyLayout(deviceIdenfifier, keyLayoutName); if (status == NAME_NOT_FOUND) { - LOGE("Configuration for keyboard device '%s' requested keyboard layout '%s' but " + ALOGE("Configuration for keyboard device '%s' requested keyboard layout '%s' but " "it was not found.", deviceIdenfifier.name.string(), keyLayoutName.string()); } @@ -61,7 +61,7 @@ status_t KeyMap::load(const InputDeviceIdentifier& deviceIdenfifier, keyCharacterMapName)) { status_t status = loadKeyCharacterMap(deviceIdenfifier, keyCharacterMapName); if (status == NAME_NOT_FOUND) { - LOGE("Configuration for keyboard device '%s' requested keyboard character " + ALOGE("Configuration for keyboard device '%s' requested keyboard character " "map '%s' but it was not found.", deviceIdenfifier.name.string(), keyLayoutName.string()); } @@ -90,7 +90,7 @@ status_t KeyMap::load(const InputDeviceIdentifier& deviceIdenfifier, } // Give up! - LOGE("Could not determine key map for device '%s' and no default key maps were found!", + ALOGE("Could not determine key map for device '%s' and no default key maps were found!", deviceIdenfifier.name.string()); return NAME_NOT_FOUND; } diff --git a/libs/ui/Region.cpp b/libs/ui/Region.cpp index 5656088..8cd047a 100644 --- a/libs/ui/Region.cpp +++ b/libs/ui/Region.cpp @@ -69,7 +69,7 @@ Region::Region(const Rect& rhs) Region::Region(const void* buffer) { status_t err = read(buffer); - LOGE_IF(err<0, "error %s reading Region from buffer", strerror(err)); + ALOGE_IF(err<0, "error %s reading Region from buffer", strerror(err)); } Region::~Region() @@ -272,7 +272,7 @@ public: } virtual void operator()(const Rect& rect) { - //LOGD(">>> %3d, %3d, %3d, %3d", + //ALOGD(">>> %3d, %3d, %3d, %3d", // rect.left, rect.top, rect.right, rect.bottom); if (span.size()) { if (cur->top != rect.top) { @@ -338,15 +338,15 @@ bool Region::validate(const Region& reg, const char* name) b.bottom = b.bottom > cur->bottom ? b.bottom : cur->bottom; if (cur->top == prev->top) { if (cur->bottom != prev->bottom) { - LOGE("%s: invalid span %p", name, cur); + ALOGE("%s: invalid span %p", name, cur); result = false; } else if (cur->left < prev->right) { - LOGE("%s: spans overlap horizontally prev=%p, cur=%p", + ALOGE("%s: spans overlap horizontally prev=%p, cur=%p", name, prev, cur); result = false; } } else if (cur->top < prev->bottom) { - LOGE("%s: spans overlap vertically prev=%p, cur=%p", + ALOGE("%s: spans overlap vertically prev=%p, cur=%p", name, prev, cur); result = false; } @@ -355,7 +355,7 @@ bool Region::validate(const Region& reg, const char* name) } if (b != reg.getBounds()) { result = false; - LOGE("%s: invalid bounds [%d,%d,%d,%d] vs. [%d,%d,%d,%d]", name, + ALOGE("%s: invalid bounds [%d,%d,%d,%d] vs. [%d,%d,%d,%d]", name, b.left, b.top, b.right, b.bottom, reg.getBounds().left, reg.getBounds().top, reg.getBounds().right, reg.getBounds().bottom); @@ -457,14 +457,14 @@ void Region::boolean_operation(int op, Region& dst, } if(!same) { - LOGD("---\nregion boolean %s failed", name); + ALOGD("---\nregion boolean %s failed", name); lhs.dump("lhs"); rhs.dump("rhs"); dst.dump("dst"); - LOGD("should be"); + ALOGD("should be"); SkRegion::Iterator it(sk_dst); while (!it.done()) { - LOGD(" [%3d, %3d, %3d, %3d]", + ALOGD(" [%3d, %3d, %3d, %3d]", it.rect().fLeft, it.rect().fTop, it.rect().fRight, @@ -480,7 +480,7 @@ void Region::boolean_operation(int op, Region& dst, const Rect& rhs, int dx, int dy) { if (!rhs.isValid()) { - LOGE("Region::boolean_operation(op=%d) invalid Rect={%d,%d,%d,%d}", + ALOGE("Region::boolean_operation(op=%d) invalid Rect={%d,%d,%d,%d}", op, rhs.left, rhs.top, rhs.right, rhs.bottom); return; } @@ -647,9 +647,9 @@ void Region::dump(const char* what, uint32_t flags) const (void)flags; const_iterator head = begin(); const_iterator const tail = end(); - LOGD(" Region %s (this=%p, count=%d)\n", what, this, tail-head); + ALOGD(" Region %s (this=%p, count=%d)\n", what, this, tail-head); while (head != tail) { - LOGD(" [%3d, %3d, %3d, %3d]\n", + ALOGD(" [%3d, %3d, %3d, %3d]\n", head->left, head->top, head->right, head->bottom); head++; } diff --git a/libs/ui/VirtualKeyMap.cpp b/libs/ui/VirtualKeyMap.cpp index e756cdd..62d5b59 100644 --- a/libs/ui/VirtualKeyMap.cpp +++ b/libs/ui/VirtualKeyMap.cpp @@ -51,11 +51,11 @@ status_t VirtualKeyMap::load(const String8& filename, VirtualKeyMap** outMap) { Tokenizer* tokenizer; status_t status = Tokenizer::open(filename, &tokenizer); if (status) { - LOGE("Error %d opening virtual key map file %s.", status, filename.string()); + ALOGE("Error %d opening virtual key map file %s.", status, filename.string()); } else { VirtualKeyMap* map = new VirtualKeyMap(); if (!map) { - LOGE("Error allocating virtual key map."); + ALOGE("Error allocating virtual key map."); status = NO_MEMORY; } else { #if DEBUG_PARSER_PERFORMANCE @@ -65,7 +65,7 @@ status_t VirtualKeyMap::load(const String8& filename, VirtualKeyMap** outMap) { status = parser.parse(); #if DEBUG_PARSER_PERFORMANCE nsecs_t elapsedTime = systemTime(SYSTEM_TIME_MONOTONIC) - startTime; - LOGD("Parsed key character map file '%s' %d lines in %0.3fms.", + ALOGD("Parsed key character map file '%s' %d lines in %0.3fms.", tokenizer->getFilename().string(), tokenizer->getLineNumber(), elapsedTime / 1000000.0); #endif @@ -93,7 +93,7 @@ VirtualKeyMap::Parser::~Parser() { status_t VirtualKeyMap::Parser::parse() { while (!mTokenizer->isEof()) { #if DEBUG_PARSER - LOGD("Parsing %s: '%s'.", mTokenizer->getLocation().string(), + ALOGD("Parsing %s: '%s'.", mTokenizer->getLocation().string(), mTokenizer->peekRemainderOfLine().string()); #endif @@ -104,7 +104,7 @@ status_t VirtualKeyMap::Parser::parse() { do { String8 token = mTokenizer->nextToken(WHITESPACE_OR_FIELD_DELIMITER); if (token != "0x01") { - LOGE("%s: Unknown virtual key type, expected 0x01.", + ALOGE("%s: Unknown virtual key type, expected 0x01.", mTokenizer->getLocation().string()); return BAD_VALUE; } @@ -116,13 +116,13 @@ status_t VirtualKeyMap::Parser::parse() { && parseNextIntField(&defn.width) && parseNextIntField(&defn.height); if (!success) { - LOGE("%s: Expected 5 colon-delimited integers in virtual key definition.", + ALOGE("%s: Expected 5 colon-delimited integers in virtual key definition.", mTokenizer->getLocation().string()); return BAD_VALUE; } #if DEBUG_PARSER - LOGD("Parsed virtual key: scanCode=%d, centerX=%d, centerY=%d, " + ALOGD("Parsed virtual key: scanCode=%d, centerX=%d, centerY=%d, " "width=%d, height=%d", defn.scanCode, defn.centerX, defn.centerY, defn.width, defn.height); #endif @@ -130,7 +130,7 @@ status_t VirtualKeyMap::Parser::parse() { } while (consumeFieldDelimiterAndSkipWhitespace()); if (!mTokenizer->isEol()) { - LOGE("%s: Expected end of line, got '%s'.", + ALOGE("%s: Expected end of line, got '%s'.", mTokenizer->getLocation().string(), mTokenizer->peekRemainderOfLine().string()); return BAD_VALUE; @@ -162,7 +162,7 @@ bool VirtualKeyMap::Parser::parseNextIntField(int32_t* outValue) { char* end; *outValue = strtol(token.string(), &end, 0); if (token.isEmpty() || *end != '\0') { - LOGE("Expected an integer, got '%s'.", token.string()); + ALOGE("Expected an integer, got '%s'.", token.string()); return false; } return true; diff --git a/libs/ui/tests/region/region.cpp b/libs/ui/tests/region/region.cpp index ef15de9..6347294 100644 --- a/libs/ui/tests/region/region.cpp +++ b/libs/ui/tests/region/region.cpp @@ -58,7 +58,7 @@ int main() //reg2.dump("reg2"); //reg3.dump("reg3"); - LOGD("---"); + ALOGD("---"); reg2 = reg0 | reg0.translate(100, 0); reg0.dump("reg0"); reg1.dump("reg1"); diff --git a/libs/utils/Asset.cpp b/libs/utils/Asset.cpp index a18294b..50e701a 100644 --- a/libs/utils/Asset.cpp +++ b/libs/utils/Asset.cpp @@ -89,7 +89,7 @@ Asset::Asset(void) gTail->mNext = this; gTail = this; } - //LOGI("Creating Asset %p #%d\n", this, gCount); + //ALOGI("Creating Asset %p #%d\n", this, gCount); } Asset::~Asset(void) @@ -109,7 +109,7 @@ Asset::~Asset(void) mPrev->mNext = mNext; } mNext = mPrev = NULL; - //LOGI("Destroying Asset in %p #%d\n", this, gCount); + //ALOGI("Destroying Asset in %p #%d\n", this, gCount); } /* @@ -210,7 +210,7 @@ Asset::~Asset(void) offset = ftell(fp); fclose(fp); if (!scanResult) { - LOGD("File '%s' is not in gzip format\n", fileName); + ALOGD("File '%s' is not in gzip format\n", fileName); ::close(fd); return NULL; } @@ -327,14 +327,14 @@ off64_t Asset::handleSeek(off64_t offset, int whence, off64_t curPosn, off64_t m newOffset = maxPosn + offset; break; default: - LOGW("unexpected whence %d\n", whence); + ALOGW("unexpected whence %d\n", whence); // this was happening due to an off64_t size mismatch assert(false); return (off64_t) -1; } if (newOffset < 0 || newOffset > maxPosn) { - LOGW("seek out of range: want %ld, end=%ld\n", + ALOGW("seek out of range: want %ld, end=%ld\n", (long) newOffset, (long) maxPosn); return (off64_t) -1; } @@ -384,12 +384,12 @@ status_t _FileAsset::openChunk(const char* fileName, int fd, off64_t offset, siz fileLength = lseek64(fd, 0, SEEK_END); if (fileLength == (off64_t) -1) { // probably a bad file descriptor - LOGD("failed lseek (errno=%d)\n", errno); + ALOGD("failed lseek (errno=%d)\n", errno); return UNKNOWN_ERROR; } if ((off64_t) (offset + length) > fileLength) { - LOGD("start (%ld) + len (%ld) > end (%ld)\n", + ALOGD("start (%ld) + len (%ld) > end (%ld)\n", (long) offset, (long) length, (long) fileLength); return BAD_INDEX; } @@ -473,7 +473,7 @@ ssize_t _FileAsset::read(void* buf, size_t count) /* read from the file */ //printf("file read\n"); if (ftell(mFp) != mStart + mOffset) { - LOGE("Hosed: %ld != %ld+%ld\n", + ALOGE("Hosed: %ld != %ld+%ld\n", ftell(mFp), (long) mStart, (long) mOffset); assert(false); } @@ -581,23 +581,23 @@ const void* _FileAsset::getBuffer(bool wordAligned) buf = new unsigned char[allocLen]; if (buf == NULL) { - LOGE("alloc of %ld bytes failed\n", (long) allocLen); + ALOGE("alloc of %ld bytes failed\n", (long) allocLen); return NULL; } - LOGV("Asset %p allocating buffer size %d (smaller than threshold)", this, (int)allocLen); + ALOGV("Asset %p allocating buffer size %d (smaller than threshold)", this, (int)allocLen); if (mLength > 0) { long oldPosn = ftell(mFp); fseek(mFp, mStart, SEEK_SET); if (fread(buf, 1, mLength, mFp) != (size_t) mLength) { - LOGE("failed reading %ld bytes\n", (long) mLength); + ALOGE("failed reading %ld bytes\n", (long) mLength); delete[] buf; return NULL; } fseek(mFp, oldPosn, SEEK_SET); } - LOGV(" getBuffer: loaded into buffer\n"); + ALOGV(" getBuffer: loaded into buffer\n"); mBuf = buf; return mBuf; @@ -610,7 +610,7 @@ const void* _FileAsset::getBuffer(bool wordAligned) return NULL; } - LOGV(" getBuffer: mapped\n"); + ALOGV(" getBuffer: mapped\n"); mMap = map; if (!wordAligned) { @@ -648,17 +648,17 @@ const void* _FileAsset::ensureAlignment(FileMap* map) if ((((size_t)data)&0x3) == 0) { // We can return this directly if it is aligned on a word // boundary. - LOGV("Returning aligned FileAsset %p (%s).", this, + ALOGV("Returning aligned FileAsset %p (%s).", this, getAssetSource()); return data; } // If not aligned on a word boundary, then we need to copy it into // our own buffer. - LOGV("Copying FileAsset %p (%s) to buffer size %d to make it aligned.", this, + ALOGV("Copying FileAsset %p (%s) to buffer size %d to make it aligned.", this, getAssetSource(), (int)mLength); unsigned char* buf = new unsigned char[mLength]; if (buf == NULL) { - LOGE("alloc of %ld bytes failed\n", (long) mLength); + ALOGE("alloc of %ld bytes failed\n", (long) mLength); return NULL; } memcpy(buf, data, mLength); @@ -855,7 +855,7 @@ const void* _CompressedAsset::getBuffer(bool wordAligned) */ buf = new unsigned char[mUncompressedLen]; if (buf == NULL) { - LOGW("alloc %ld bytes failed\n", (long) mUncompressedLen); + ALOGW("alloc %ld bytes failed\n", (long) mUncompressedLen); goto bail; } diff --git a/libs/utils/AssetManager.cpp b/libs/utils/AssetManager.cpp index 22034c5..47a2b99 100644 --- a/libs/utils/AssetManager.cpp +++ b/libs/utils/AssetManager.cpp @@ -117,14 +117,14 @@ AssetManager::AssetManager(CacheMode cacheMode) mCacheMode(cacheMode), mCacheValid(false) { int count = android_atomic_inc(&gCount)+1; - //LOGI("Creating AssetManager %p #%d\n", this, count); + //ALOGI("Creating AssetManager %p #%d\n", this, count); memset(mConfig, 0, sizeof(ResTable_config)); } AssetManager::~AssetManager(void) { int count = android_atomic_dec(&gCount); - //LOGI("Destroying AssetManager in %p #%d\n", this, count); + //ALOGI("Destroying AssetManager in %p #%d\n", this, count); delete mConfig; delete mResources; @@ -151,7 +151,7 @@ bool AssetManager::addAssetPath(const String8& path, void** cookie) ap.path = path; ap.type = ::getFileType(path.string()); if (ap.type != kFileTypeDirectory && ap.type != kFileTypeRegular) { - LOGW("Asset path %s is neither a directory nor file (type=%d).", + ALOGW("Asset path %s is neither a directory nor file (type=%d).", path.string(), (int)ap.type); return false; } @@ -167,7 +167,7 @@ bool AssetManager::addAssetPath(const String8& path, void** cookie) } } - LOGV("In %p Asset %s path: %s", this, + ALOGV("In %p Asset %s path: %s", this, ap.type == kFileTypeDirectory ? "dir" : "zip", ap.path.string()); mAssetPaths.add(ap); @@ -200,7 +200,7 @@ bool AssetManager::addAssetPath(const String8& path, void** cookie) if (addOverlay) { mAssetPaths.add(oap); } else { - LOGW("failed to add overlay package %s\n", overlayPath.string()); + ALOGW("failed to add overlay package %s\n", overlayPath.string()); } } } @@ -216,17 +216,17 @@ bool AssetManager::isIdmapStaleLocked(const String8& originalPath, const String8 if (errno == ENOENT) { return true; // non-existing idmap is always stale } else { - LOGW("failed to stat file %s: %s\n", idmapPath.string(), strerror(errno)); + ALOGW("failed to stat file %s: %s\n", idmapPath.string(), strerror(errno)); return false; } } if (st.st_size < ResTable::IDMAP_HEADER_SIZE_BYTES) { - LOGW("file %s has unexpectedly small size=%zd\n", idmapPath.string(), (size_t)st.st_size); + ALOGW("file %s has unexpectedly small size=%zd\n", idmapPath.string(), (size_t)st.st_size); return false; } int fd = TEMP_FAILURE_RETRY(::open(idmapPath.string(), O_RDONLY)); if (fd == -1) { - LOGW("failed to open file %s: %s\n", idmapPath.string(), strerror(errno)); + ALOGW("failed to open file %s: %s\n", idmapPath.string(), strerror(errno)); return false; } char buf[ResTable::IDMAP_HEADER_SIZE_BYTES]; @@ -283,7 +283,7 @@ bool AssetManager::getZipEntryCrcLocked(const String8& zipPath, const char* entr bool AssetManager::createIdmapFileLocked(const String8& originalPath, const String8& overlayPath, const String8& idmapPath) { - LOGD("%s: originalPath=%s overlayPath=%s idmapPath=%s\n", + ALOGD("%s: originalPath=%s overlayPath=%s idmapPath=%s\n", __FUNCTION__, originalPath.string(), overlayPath.string(), idmapPath.string()); ResTable tables[2]; const String8* paths[2] = { &originalPath, &overlayPath }; @@ -300,24 +300,24 @@ bool AssetManager::createIdmapFileLocked(const String8& originalPath, const Stri ap.path = *paths[i]; Asset* ass = openNonAssetInPathLocked("resources.arsc", Asset::ACCESS_BUFFER, ap); if (ass == NULL) { - LOGW("failed to find resources.arsc in %s\n", ap.path.string()); + ALOGW("failed to find resources.arsc in %s\n", ap.path.string()); goto error; } tables[i].add(ass, (void*)1, false); } if (!getZipEntryCrcLocked(originalPath, "resources.arsc", &originalCrc)) { - LOGW("failed to retrieve crc for resources.arsc in %s\n", originalPath.string()); + ALOGW("failed to retrieve crc for resources.arsc in %s\n", originalPath.string()); goto error; } if (!getZipEntryCrcLocked(overlayPath, "resources.arsc", &overlayCrc)) { - LOGW("failed to retrieve crc for resources.arsc in %s\n", overlayPath.string()); + ALOGW("failed to retrieve crc for resources.arsc in %s\n", overlayPath.string()); goto error; } if (tables[0].createIdmap(tables[1], originalCrc, overlayCrc, (void**)&data, &size) != NO_ERROR) { - LOGW("failed to generate idmap data for file %s\n", idmapPath.string()); + ALOGW("failed to generate idmap data for file %s\n", idmapPath.string()); goto error; } @@ -326,13 +326,13 @@ bool AssetManager::createIdmapFileLocked(const String8& originalPath, const Stri // installd). fd = TEMP_FAILURE_RETRY(::open(idmapPath.string(), O_WRONLY | O_CREAT | O_TRUNC, 0644)); if (fd == -1) { - LOGW("failed to write idmap file %s (open: %s)\n", idmapPath.string(), strerror(errno)); + ALOGW("failed to write idmap file %s (open: %s)\n", idmapPath.string(), strerror(errno)); goto error_free; } for (;;) { ssize_t written = TEMP_FAILURE_RETRY(write(fd, data + offset, size)); if (written < 0) { - LOGW("failed to write idmap file %s (write: %s)\n", idmapPath.string(), + ALOGW("failed to write idmap file %s (write: %s)\n", idmapPath.string(), strerror(errno)); goto error_close; } @@ -498,7 +498,7 @@ Asset* AssetManager::open(const char* fileName, AccessMode mode) size_t i = mAssetPaths.size(); while (i > 0) { i--; - LOGV("Looking for asset '%s' in '%s'\n", + ALOGV("Looking for asset '%s' in '%s'\n", assetName.string(), mAssetPaths.itemAt(i).path.string()); Asset* pAsset = openNonAssetInPathLocked(assetName.string(), mode, mAssetPaths.itemAt(i)); if (pAsset != NULL) { @@ -532,7 +532,7 @@ Asset* AssetManager::openNonAsset(const char* fileName, AccessMode mode) size_t i = mAssetPaths.size(); while (i > 0) { i--; - LOGV("Looking for non-asset '%s' in '%s'\n", fileName, mAssetPaths.itemAt(i).path.string()); + ALOGV("Looking for non-asset '%s' in '%s'\n", fileName, mAssetPaths.itemAt(i).path.string()); Asset* pAsset = openNonAssetInPathLocked( fileName, mode, mAssetPaths.itemAt(i)); if (pAsset != NULL) { @@ -556,7 +556,7 @@ Asset* AssetManager::openNonAsset(void* cookie, const char* fileName, AccessMode loadFileNameCacheLocked(); if (which < mAssetPaths.size()) { - LOGV("Looking for non-asset '%s' in '%s'\n", fileName, + ALOGV("Looking for non-asset '%s' in '%s'\n", fileName, mAssetPaths.itemAt(which).path.string()); Asset* pAsset = openNonAssetInPathLocked( fileName, mode, mAssetPaths.itemAt(which)); @@ -621,7 +621,7 @@ const ResTable* AssetManager::getResTable(bool required) const bool shared = true; const asset_path& ap = mAssetPaths.itemAt(i); Asset* idmap = openIdmapLocked(ap); - LOGV("Looking for resource asset in '%s'\n", ap.path.string()); + ALOGV("Looking for resource asset in '%s'\n", ap.path.string()); if (ap.type != kFileTypeDirectory) { if (i == 0) { // The first item is typically the framework resources, @@ -633,7 +633,7 @@ const ResTable* AssetManager::getResTable(bool required) const ass = const_cast<AssetManager*>(this)-> mZipSet.getZipResourceTableAsset(ap.path); if (ass == NULL) { - LOGV("loading resource table %s\n", ap.path.string()); + ALOGV("loading resource table %s\n", ap.path.string()); ass = const_cast<AssetManager*>(this)-> openNonAssetInPathLocked("resources.arsc", Asset::ACCESS_BUFFER, @@ -648,7 +648,7 @@ const ResTable* AssetManager::getResTable(bool required) const // If this is the first resource table in the asset // manager, then we are going to cache it so that we // can quickly copy it out for others. - LOGV("Creating shared resources for %s", ap.path.string()); + ALOGV("Creating shared resources for %s", ap.path.string()); sharedRes = new ResTable(); sharedRes->add(ass, (void*)(i+1), false, idmap); sharedRes = const_cast<AssetManager*>(this)-> @@ -656,7 +656,7 @@ const ResTable* AssetManager::getResTable(bool required) const } } } else { - LOGV("loading resource table %s\n", ap.path.string()); + ALOGV("loading resource table %s\n", ap.path.string()); Asset* ass = const_cast<AssetManager*>(this)-> openNonAssetInPathLocked("resources.arsc", Asset::ACCESS_BUFFER, @@ -668,12 +668,12 @@ const ResTable* AssetManager::getResTable(bool required) const mResources = rt = new ResTable(); updateResourceParamsLocked(); } - LOGV("Installing resource asset %p in to table %p\n", ass, mResources); + ALOGV("Installing resource asset %p in to table %p\n", ass, mResources); if (sharedRes != NULL) { - LOGV("Copying existing resources for %s", ap.path.string()); + ALOGV("Copying existing resources for %s", ap.path.string()); rt->add(sharedRes); } else { - LOGV("Parsing resources for %s", ap.path.string()); + ALOGV("Parsing resources for %s", ap.path.string()); rt->add(ass, (void*)(i+1), !shared, idmap); } @@ -686,7 +686,7 @@ const ResTable* AssetManager::getResTable(bool required) const } } - if (required && !rt) LOGW("Unable to find resources file resources.arsc"); + if (required && !rt) ALOGW("Unable to find resources file resources.arsc"); if (!rt) { mResources = rt = new ResTable(); } @@ -725,9 +725,9 @@ Asset* AssetManager::openIdmapLocked(const struct asset_path& ap) const ass = const_cast<AssetManager*>(this)-> openAssetFromFileLocked(ap.idmap, Asset::ACCESS_BUFFER); if (ass) { - LOGV("loading idmap %s\n", ap.idmap.string()); + ALOGV("loading idmap %s\n", ap.idmap.string()); } else { - LOGW("failed to load idmap %s\n", ap.idmap.string()); + ALOGW("failed to load idmap %s\n", ap.idmap.string()); } } return ass; @@ -923,7 +923,7 @@ Asset* AssetManager::openInLocaleVendorLocked(const char* fileName, AccessMode m */ if (found) { if (pAsset == NULL) - LOGD("Expected file not found: '%s'\n", path.string()); + ALOGD("Expected file not found: '%s'\n", path.string()); return pAsset; } } @@ -1019,7 +1019,7 @@ String8 AssetManager::createPathNameLocked(const asset_path& ap, const char* roo */ ZipFileRO* AssetManager::getZipFileLocked(const asset_path& ap) { - LOGV("getZipFileLocked() in %p\n", this); + ALOGV("getZipFileLocked() in %p\n", this); return mZipSet.getZip(ap.path); } @@ -1074,29 +1074,29 @@ Asset* AssetManager::openAssetFromZipLocked(const ZipFileRO* pZipFile, if (!pZipFile->getEntryInfo(entry, &method, &uncompressedLen, NULL, NULL, NULL, NULL)) { - LOGW("getEntryInfo failed\n"); + ALOGW("getEntryInfo failed\n"); return NULL; } FileMap* dataMap = pZipFile->createEntryFileMap(entry); if (dataMap == NULL) { - LOGW("create map from entry failed\n"); + ALOGW("create map from entry failed\n"); return NULL; } if (method == ZipFileRO::kCompressStored) { pAsset = Asset::createFromUncompressedMap(dataMap, mode); - LOGV("Opened uncompressed entry %s in zip %s mode %d: %p", entryName.string(), + ALOGV("Opened uncompressed entry %s in zip %s mode %d: %p", entryName.string(), dataMap->getFileName(), mode, pAsset); } else { pAsset = Asset::createFromCompressedMap(dataMap, method, uncompressedLen, mode); - LOGV("Opened compressed entry %s in zip %s mode %d: %p", entryName.string(), + ALOGV("Opened compressed entry %s in zip %s mode %d: %p", entryName.string(), dataMap->getFileName(), mode, pAsset); } if (pAsset == NULL) { /* unexpected */ - LOGW("create from segment failed\n"); + ALOGW("create from segment failed\n"); } return pAsset; @@ -1146,10 +1146,10 @@ AssetDir* AssetManager::openDir(const char* dirName) i--; const asset_path& ap = mAssetPaths.itemAt(i); if (ap.type == kFileTypeRegular) { - LOGV("Adding directory %s from zip %s", dirName, ap.path.string()); + ALOGV("Adding directory %s from zip %s", dirName, ap.path.string()); scanAndMergeZipLocked(pMergedInfo, ap, kAssetsRoot, dirName); } else { - LOGV("Adding directory %s from dir %s", dirName, ap.path.string()); + ALOGV("Adding directory %s from dir %s", dirName, ap.path.string()); scanAndMergeDirLocked(pMergedInfo, ap, kAssetsRoot, dirName); } } @@ -1200,10 +1200,10 @@ AssetDir* AssetManager::openNonAssetDir(void* cookie, const char* dirName) if (which < mAssetPaths.size()) { const asset_path& ap = mAssetPaths.itemAt(which); if (ap.type == kFileTypeRegular) { - LOGV("Adding directory %s from zip %s", dirName, ap.path.string()); + ALOGV("Adding directory %s from zip %s", dirName, ap.path.string()); scanAndMergeZipLocked(pMergedInfo, ap, NULL, dirName); } else { - LOGV("Adding directory %s from dir %s", dirName, ap.path.string()); + ALOGV("Adding directory %s from dir %s", dirName, ap.path.string()); scanAndMergeDirLocked(pMergedInfo, ap, NULL, dirName); } } @@ -1325,7 +1325,7 @@ bool AssetManager::scanAndMergeDirLocked(SortedVector<AssetDir::FileInfo>* pMerg matchIdx = AssetDir::FileInfo::findEntry(pMergedInfo, match); if (matchIdx > 0) { - LOGV("Excluding '%s' [%s]\n", + ALOGV("Excluding '%s' [%s]\n", pMergedInfo->itemAt(matchIdx).getFileName().string(), pMergedInfo->itemAt(matchIdx).getSourceName().string()); pMergedInfo->removeAt(matchIdx); @@ -1333,7 +1333,7 @@ bool AssetManager::scanAndMergeDirLocked(SortedVector<AssetDir::FileInfo>* pMerg //printf("+++ no match on '%s'\n", (const char*) match); } - LOGD("HEY: size=%d removing %d\n", (int)pContents->size(), i); + ALOGD("HEY: size=%d removing %d\n", (int)pContents->size(), i); pContents->removeAt(i); i--; // adjust "for" loop count--; // and loop limit @@ -1365,7 +1365,7 @@ SortedVector<AssetDir::FileInfo>* AssetManager::scanDirLocked(const String8& pat struct dirent* entry; FileType fileType; - LOGV("Scanning dir '%s'\n", path.string()); + ALOGV("Scanning dir '%s'\n", path.string()); dir = opendir(path.string()); if (dir == NULL) @@ -1427,7 +1427,7 @@ bool AssetManager::scanAndMergeZipLocked(SortedVector<AssetDir::FileInfo>* pMerg pZip = mZipSet.getZip(ap.path); if (pZip == NULL) { - LOGW("Failure opening zip %s\n", ap.path.string()); + ALOGW("Failure opening zip %s\n", ap.path.string()); return false; } @@ -1461,7 +1461,7 @@ bool AssetManager::scanAndMergeZipLocked(SortedVector<AssetDir::FileInfo>* pMerg entry = pZip->findEntryByIndex(i); if (pZip->getEntryFileName(entry, nameBuf, sizeof(nameBuf)) != 0) { // TODO: fix this if we expect to have long names - LOGE("ARGH: name too long?\n"); + ALOGE("ARGH: name too long?\n"); continue; } //printf("Comparing %s in %s?\n", nameBuf, dirName.string()); @@ -1652,7 +1652,7 @@ void AssetManager::loadFileNameCacheLocked(void) #ifdef DO_TIMINGS timer.stop(); - LOGD("Cache scan took %.3fms\n", + ALOGD("Cache scan took %.3fms\n", timer.durationUsecs() / 1000.0); #endif @@ -1780,11 +1780,11 @@ AssetManager::SharedZip::SharedZip(const String8& path, time_t modWhen) : mPath(path), mZipFile(NULL), mModWhen(modWhen), mResourceTableAsset(NULL), mResourceTable(NULL) { - //LOGI("Creating SharedZip %p %s\n", this, (const char*)mPath); + //ALOGI("Creating SharedZip %p %s\n", this, (const char*)mPath); mZipFile = new ZipFileRO; - LOGV("+++ opening zip '%s'\n", mPath.string()); + ALOGV("+++ opening zip '%s'\n", mPath.string()); if (mZipFile->open(mPath.string()) != NO_ERROR) { - LOGD("failed to open Zip archive '%s'\n", mPath.string()); + ALOGD("failed to open Zip archive '%s'\n", mPath.string()); delete mZipFile; mZipFile = NULL; } @@ -1811,7 +1811,7 @@ ZipFileRO* AssetManager::SharedZip::getZip() Asset* AssetManager::SharedZip::getResourceTableAsset() { - LOGV("Getting from SharedZip %p resource asset %p\n", this, mResourceTableAsset); + ALOGV("Getting from SharedZip %p resource asset %p\n", this, mResourceTableAsset); return mResourceTableAsset; } @@ -1833,7 +1833,7 @@ Asset* AssetManager::SharedZip::setResourceTableAsset(Asset* asset) ResTable* AssetManager::SharedZip::getResourceTable() { - LOGV("Getting from SharedZip %p resource table %p\n", this, mResourceTable); + ALOGV("Getting from SharedZip %p resource table %p\n", this, mResourceTable); return mResourceTable; } @@ -1858,7 +1858,7 @@ bool AssetManager::SharedZip::isUpToDate() AssetManager::SharedZip::~SharedZip() { - //LOGI("Destroying SharedZip %p %s\n", this, (const char*)mPath); + //ALOGI("Destroying SharedZip %p %s\n", this, (const char*)mPath); if (mResourceTable != NULL) { delete mResourceTable; } @@ -1867,7 +1867,7 @@ AssetManager::SharedZip::~SharedZip() } if (mZipFile != NULL) { delete mZipFile; - LOGV("Closed '%s'\n", mPath.string()); + ALOGV("Closed '%s'\n", mPath.string()); } } diff --git a/libs/utils/BackupData.cpp b/libs/utils/BackupData.cpp index 87912639..f956306 100644 --- a/libs/utils/BackupData.cpp +++ b/libs/utils/BackupData.cpp @@ -78,7 +78,7 @@ BackupDataWriter::write_padding_for(int n) paddingSize = padding_extra(n); if (paddingSize > 0) { uint32_t padding = 0xbcbcbcbc; - if (DEBUG) LOGI("writing %d padding bytes for %d", paddingSize, n); + if (DEBUG) ALOGI("writing %d padding bytes for %d", paddingSize, n); amt = write(m_fd, &padding, paddingSize); if (amt != paddingSize) { m_status = errno; @@ -112,8 +112,8 @@ BackupDataWriter::WriteEntityHeader(const String8& key, size_t dataSize) k = key; } if (DEBUG) { - LOGD("Writing header: prefix='%s' key='%s' dataSize=%d", m_keyPrefix.string(), key.string(), - dataSize); + ALOGD("Writing header: prefix='%s' key='%s' dataSize=%d", m_keyPrefix.string(), + key.string(), dataSize); } entity_header_v1 header; @@ -125,7 +125,7 @@ BackupDataWriter::WriteEntityHeader(const String8& key, size_t dataSize) header.keyLen = tolel(keyLen); header.dataSize = tolel(dataSize); - if (DEBUG) LOGI("writing entity header, %d bytes", sizeof(entity_header_v1)); + if (DEBUG) ALOGI("writing entity header, %d bytes", sizeof(entity_header_v1)); amt = write(m_fd, &header, sizeof(entity_header_v1)); if (amt != sizeof(entity_header_v1)) { m_status = errno; @@ -133,7 +133,7 @@ BackupDataWriter::WriteEntityHeader(const String8& key, size_t dataSize) } m_pos += amt; - if (DEBUG) LOGI("writing entity header key, %d bytes", keyLen+1); + if (DEBUG) ALOGI("writing entity header key, %d bytes", keyLen+1); amt = write(m_fd, k.string(), keyLen+1); if (amt != keyLen+1) { m_status = errno; @@ -151,11 +151,11 @@ BackupDataWriter::WriteEntityHeader(const String8& key, size_t dataSize) status_t BackupDataWriter::WriteEntityData(const void* data, size_t size) { - if (DEBUG) LOGD("Writing data: size=%lu", (unsigned long) size); + if (DEBUG) ALOGD("Writing data: size=%lu", (unsigned long) size); if (m_status != NO_ERROR) { if (DEBUG) { - LOGD("Not writing data - stream in error state %d (%s)", m_status, strerror(m_status)); + ALOGD("Not writing data - stream in error state %d (%s)", m_status, strerror(m_status)); } return m_status; } @@ -166,7 +166,7 @@ BackupDataWriter::WriteEntityData(const void* data, size_t size) ssize_t amt = write(m_fd, data, size); if (amt != (ssize_t)size) { m_status = errno; - if (DEBUG) LOGD("write returned error %d (%s)", m_status, strerror(m_status)); + if (DEBUG) ALOGD("write returned error %d (%s)", m_status, strerror(m_status)); return m_status; } m_pos += amt; @@ -208,7 +208,7 @@ BackupDataReader::Status() m_done = true; \ } else { \ m_status = errno; \ - LOGD("CHECK_SIZE(a=%ld e=%ld) failed at line %d m_status='%s'", \ + ALOGD("CHECK_SIZE(a=%ld e=%ld) failed at line %d m_status='%s'", \ long(actual), long(expected), __LINE__, strerror(m_status)); \ } \ return m_status; \ @@ -218,7 +218,7 @@ BackupDataReader::Status() do { \ status_t err = skip_padding(); \ if (err != NO_ERROR) { \ - LOGD("SKIP_PADDING FAILED at line %d", __LINE__); \ + ALOGD("SKIP_PADDING FAILED at line %d", __LINE__); \ m_status = err; \ return err; \ } \ @@ -261,7 +261,7 @@ BackupDataReader::ReadNextHeader(bool* done, int* type) { m_header.entity.keyLen = fromlel(m_header.entity.keyLen); if (m_header.entity.keyLen <= 0) { - LOGD("Entity header at %d has keyLen<=0: 0x%08x\n", (int)m_pos, + ALOGD("Entity header at %d has keyLen<=0: 0x%08x\n", (int)m_pos, (int)m_header.entity.keyLen); m_status = EINVAL; } @@ -285,7 +285,7 @@ BackupDataReader::ReadNextHeader(bool* done, int* type) break; } default: - LOGD("Chunk header at %d has invalid type: 0x%08x", + ALOGD("Chunk header at %d has invalid type: 0x%08x", (int)(m_pos - sizeof(m_header)), (int)m_header.type); m_status = EINVAL; } @@ -339,7 +339,7 @@ BackupDataReader::ReadEntityData(void* data, size_t size) return -1; } int remaining = m_dataEndPos - m_pos; - //LOGD("ReadEntityData size=%d m_pos=0x%x m_dataEndPos=0x%x remaining=%d\n", + //ALOGD("ReadEntityData size=%d m_pos=0x%x m_dataEndPos=0x%x remaining=%d\n", // size, m_pos, m_dataEndPos, remaining); if (remaining <= 0) { return 0; @@ -347,7 +347,7 @@ BackupDataReader::ReadEntityData(void* data, size_t size) if (((int)size) > remaining) { size = remaining; } - //LOGD(" reading %d bytes", size); + //ALOGD(" reading %d bytes", size); int amt = read(m_fd, data, size); if (amt < 0) { m_status = errno; diff --git a/libs/utils/BackupHelpers.cpp b/libs/utils/BackupHelpers.cpp index 7ef30f9..f77a891 100644 --- a/libs/utils/BackupHelpers.cpp +++ b/libs/utils/BackupHelpers.cpp @@ -74,7 +74,7 @@ const static int CURRENT_METADATA_VERSION = 1; #if TEST_BACKUP_HELPERS #define LOGP(f, x...) printf(f "\n", x) #else -#define LOGP(x...) LOGD(x) +#define LOGP(x...) ALOGD(x) #endif #endif @@ -100,7 +100,7 @@ read_snapshot_file(int fd, KeyedVector<String8,FileState>* snapshot) bytesRead += amt; if (header.magic0 != MAGIC0 || header.magic1 != MAGIC1) { - LOGW("read_snapshot_file header.magic0=0x%08x magic1=0x%08x", header.magic0, header.magic1); + ALOGW("read_snapshot_file header.magic0=0x%08x magic1=0x%08x", header.magic0, header.magic1); return 1; } @@ -110,7 +110,7 @@ read_snapshot_file(int fd, KeyedVector<String8,FileState>* snapshot) amt = read(fd, &file, sizeof(FileState)); if (amt != sizeof(FileState)) { - LOGW("read_snapshot_file FileState truncated/error with read at %d bytes\n", bytesRead); + ALOGW("read_snapshot_file FileState truncated/error with read at %d bytes\n", bytesRead); return 1; } bytesRead += amt; @@ -129,13 +129,13 @@ read_snapshot_file(int fd, KeyedVector<String8,FileState>* snapshot) free(filename); } if (amt != nameBufSize) { - LOGW("read_snapshot_file filename truncated/error with read at %d bytes\n", bytesRead); + ALOGW("read_snapshot_file filename truncated/error with read at %d bytes\n", bytesRead); return 1; } } if (header.totalSize != bytesRead) { - LOGW("read_snapshot_file length mismatch: header.totalSize=%d bytesRead=%d\n", + ALOGW("read_snapshot_file length mismatch: header.totalSize=%d bytesRead=%d\n", header.totalSize, bytesRead); return 1; } @@ -166,7 +166,7 @@ write_snapshot_file(int fd, const KeyedVector<String8,FileRec>& snapshot) amt = write(fd, &header, sizeof(header)); if (amt != sizeof(header)) { - LOGW("write_snapshot_file error writing header %s", strerror(errno)); + ALOGW("write_snapshot_file error writing header %s", strerror(errno)); return errno; } @@ -178,14 +178,14 @@ write_snapshot_file(int fd, const KeyedVector<String8,FileRec>& snapshot) amt = write(fd, &r.s, sizeof(FileState)); if (amt != sizeof(FileState)) { - LOGW("write_snapshot_file error writing header %s", strerror(errno)); + ALOGW("write_snapshot_file error writing header %s", strerror(errno)); return 1; } // filename is not NULL terminated, but it is padded amt = write(fd, name.string(), nameLen); if (amt != nameLen) { - LOGW("write_snapshot_file error writing filename %s", strerror(errno)); + ALOGW("write_snapshot_file error writing filename %s", strerror(errno)); return 1; } int paddingLen = ROUND_UP[nameLen % 4]; @@ -193,7 +193,7 @@ write_snapshot_file(int fd, const KeyedVector<String8,FileRec>& snapshot) int padding = 0xabababab; amt = write(fd, &padding, paddingLen); if (amt != paddingLen) { - LOGW("write_snapshot_file error writing %d bytes of filename padding %s", + ALOGW("write_snapshot_file error writing %d bytes of filename padding %s", paddingLen, strerror(errno)); return 1; } @@ -232,7 +232,7 @@ write_update_file(BackupDataWriter* dataStream, int fd, int mode, const String8& lseek(fd, 0, SEEK_SET); if (sizeof(metadata) != 16) { - LOGE("ERROR: metadata block is the wrong size!"); + ALOGE("ERROR: metadata block is the wrong size!"); } bytesLeft = fileSize + sizeof(metadata); @@ -280,7 +280,7 @@ write_update_file(BackupDataWriter* dataStream, int fd, int mode, const String8& } } } - LOGE("write_update_file size mismatch for %s. expected=%d actual=%d." + ALOGE("write_update_file size mismatch for %s. expected=%d actual=%d." " You aren't doing proper locking!", realFilename, fileSize, fileSize-bytesLeft); } @@ -525,7 +525,7 @@ int write_tarfile(const String8& packageName, const String8& domain, struct stat64 s; if (lstat64(filepath.string(), &s) != 0) { err = errno; - LOGE("Error %d (%s) from lstat64(%s)", err, strerror(err), filepath.string()); + ALOGE("Error %d (%s) from lstat64(%s)", err, strerror(err), filepath.string()); return err; } @@ -540,7 +540,7 @@ int write_tarfile(const String8& packageName, const String8& domain, int fd = open(filepath.string(), O_RDONLY); if (fd < 0) { err = errno; - LOGE("Error %d (%s) from open(%s)", err, strerror(err), filepath.string()); + ALOGE("Error %d (%s) from open(%s)", err, strerror(err), filepath.string()); return err; } @@ -551,7 +551,7 @@ int write_tarfile(const String8& packageName, const String8& domain, char* paxData = buf + 1024; if (buf == NULL) { - LOGE("Out of mem allocating transfer buffer"); + ALOGE("Out of mem allocating transfer buffer"); err = ENOMEM; goto cleanup; } @@ -591,7 +591,7 @@ int write_tarfile(const String8& packageName, const String8& domain, } else if (S_ISREG(s.st_mode)) { type = '0'; // tar magic: '0' == normal file } else { - LOGW("Error: unknown file mode 0%o [%s]", s.st_mode, filepath.string()); + ALOGW("Error: unknown file mode 0%o [%s]", s.st_mode, filepath.string()); goto cleanup; } buf[156] = type; @@ -628,7 +628,7 @@ int write_tarfile(const String8& packageName, const String8& domain, // [ 329 : 8 ] and [ 337 : 8 ] devmajor/devminor, not used - LOGI(" Name: %s", fullname.string()); + ALOGI(" Name: %s", fullname.string()); // If we're using a pax extended header, build & write that here; lengths are // already preflighted @@ -688,11 +688,11 @@ int write_tarfile(const String8& packageName, const String8& domain, ssize_t nRead = read(fd, buf, toRead); if (nRead < 0) { err = errno; - LOGE("Unable to read file [%s], err=%d (%s)", filepath.string(), + ALOGE("Unable to read file [%s], err=%d (%s)", filepath.string(), err, strerror(err)); break; } else if (nRead == 0) { - LOGE("EOF but expect %lld more bytes in [%s]", (long long) toWrite, + ALOGE("EOF but expect %lld more bytes in [%s]", (long long) toWrite, filepath.string()); err = EIO; break; @@ -759,7 +759,7 @@ RestoreHelperBase::WriteFile(const String8& filename, BackupDataReader* in) file_metadata_v1 metadata; amt = in->ReadEntityData(&metadata, sizeof(metadata)); if (amt != sizeof(metadata)) { - LOGW("Could not read metadata for %s -- %ld / %s", filename.string(), + ALOGW("Could not read metadata for %s -- %ld / %s", filename.string(), (long)amt, strerror(errno)); return EIO; } @@ -768,7 +768,7 @@ RestoreHelperBase::WriteFile(const String8& filename, BackupDataReader* in) if (metadata.version > CURRENT_METADATA_VERSION) { if (!m_loggedUnknownMetadata) { m_loggedUnknownMetadata = true; - LOGW("Restoring file with unsupported metadata version %d (currently %d)", + ALOGW("Restoring file with unsupported metadata version %d (currently %d)", metadata.version, CURRENT_METADATA_VERSION); } } @@ -778,7 +778,7 @@ RestoreHelperBase::WriteFile(const String8& filename, BackupDataReader* in) crc = crc32(0L, Z_NULL, 0); fd = open(filename.string(), O_CREAT|O_RDWR|O_TRUNC, mode); if (fd == -1) { - LOGW("Could not open file %s -- %s", filename.string(), strerror(errno)); + ALOGW("Could not open file %s -- %s", filename.string(), strerror(errno)); return errno; } @@ -786,7 +786,7 @@ RestoreHelperBase::WriteFile(const String8& filename, BackupDataReader* in) err = write(fd, buf, amt); if (err != amt) { close(fd); - LOGW("Error '%s' writing '%s'", strerror(errno), filename.string()); + ALOGW("Error '%s' writing '%s'", strerror(errno), filename.string()); return errno; } crc = crc32(crc, (Bytef*)buf, amt); @@ -797,7 +797,7 @@ RestoreHelperBase::WriteFile(const String8& filename, BackupDataReader* in) // Record for the snapshot err = stat(filename.string(), &st); if (err != 0) { - LOGW("Error stating file that we just created %s", filename.string()); + ALOGW("Error stating file that we just created %s", filename.string()); return errno; } diff --git a/libs/utils/BlobCache.cpp b/libs/utils/BlobCache.cpp index d38aae9..e52cf2f 100644 --- a/libs/utils/BlobCache.cpp +++ b/libs/utils/BlobCache.cpp @@ -48,32 +48,32 @@ BlobCache::BlobCache(size_t maxKeySize, size_t maxValueSize, size_t maxTotalSize mRandState[1] = (now >> 16) & 0xFFFF; mRandState[2] = (now >> 32) & 0xFFFF; #endif - LOGV("initializing random seed using %lld", now); + ALOGV("initializing random seed using %lld", now); } void BlobCache::set(const void* key, size_t keySize, const void* value, size_t valueSize) { if (mMaxKeySize < keySize) { - LOGV("set: not caching because the key is too large: %d (limit: %d)", + ALOGV("set: not caching because the key is too large: %d (limit: %d)", keySize, mMaxKeySize); return; } if (mMaxValueSize < valueSize) { - LOGV("set: not caching because the value is too large: %d (limit: %d)", + ALOGV("set: not caching because the value is too large: %d (limit: %d)", valueSize, mMaxValueSize); return; } if (mMaxTotalSize < keySize + valueSize) { - LOGV("set: not caching because the combined key/value size is too " + ALOGV("set: not caching because the combined key/value size is too " "large: %d (limit: %d)", keySize + valueSize, mMaxTotalSize); return; } if (keySize == 0) { - LOGW("set: not caching because keySize is 0"); + ALOGW("set: not caching because keySize is 0"); return; } if (valueSize <= 0) { - LOGW("set: not caching because valueSize is 0"); + ALOGW("set: not caching because valueSize is 0"); return; } @@ -93,7 +93,7 @@ void BlobCache::set(const void* key, size_t keySize, const void* value, clean(); continue; } else { - LOGV("set: not caching new key/value pair because the " + ALOGV("set: not caching new key/value pair because the " "total cache size limit would be exceeded: %d " "(limit: %d)", keySize + valueSize, mMaxTotalSize); @@ -102,7 +102,7 @@ void BlobCache::set(const void* key, size_t keySize, const void* value, } mCacheEntries.add(CacheEntry(keyBlob, valueBlob)); mTotalSize = newTotalSize; - LOGV("set: created new cache entry with %d byte key and %d byte value", + ALOGV("set: created new cache entry with %d byte key and %d byte value", keySize, valueSize); } else { // Update the existing cache entry. @@ -115,7 +115,7 @@ void BlobCache::set(const void* key, size_t keySize, const void* value, clean(); continue; } else { - LOGV("set: not caching new value because the total cache " + ALOGV("set: not caching new value because the total cache " "size limit would be exceeded: %d (limit: %d)", keySize + valueSize, mMaxTotalSize); break; @@ -123,7 +123,7 @@ void BlobCache::set(const void* key, size_t keySize, const void* value, } mCacheEntries.editItemAt(index).setValue(valueBlob); mTotalSize = newTotalSize; - LOGV("set: updated existing cache entry with %d byte key and %d byte " + ALOGV("set: updated existing cache entry with %d byte key and %d byte " "value", keySize, valueSize); } break; @@ -133,7 +133,7 @@ void BlobCache::set(const void* key, size_t keySize, const void* value, size_t BlobCache::get(const void* key, size_t keySize, void* value, size_t valueSize) { if (mMaxKeySize < keySize) { - LOGV("get: not searching because the key is too large: %d (limit %d)", + ALOGV("get: not searching because the key is too large: %d (limit %d)", keySize, mMaxKeySize); return 0; } @@ -141,7 +141,7 @@ size_t BlobCache::get(const void* key, size_t keySize, void* value, CacheEntry dummyEntry(dummyKey, NULL); ssize_t index = mCacheEntries.indexOf(dummyEntry); if (index < 0) { - LOGV("get: no cache entry found for key of size %d", keySize); + ALOGV("get: no cache entry found for key of size %d", keySize); return 0; } @@ -150,10 +150,10 @@ size_t BlobCache::get(const void* key, size_t keySize, void* value, sp<Blob> valueBlob(mCacheEntries[index].getValue()); size_t valueBlobSize = valueBlob->getSize(); if (valueBlobSize <= valueSize) { - LOGV("get: copying %d bytes to caller's buffer", valueBlobSize); + ALOGV("get: copying %d bytes to caller's buffer", valueBlobSize); memcpy(value, valueBlob->getData(), valueBlobSize); } else { - LOGV("get: caller's buffer is too small for value: %d (needs %d)", + ALOGV("get: caller's buffer is too small for value: %d (needs %d)", valueSize, valueBlobSize); } return valueBlobSize; @@ -183,13 +183,13 @@ size_t BlobCache::getFdCount() const { status_t BlobCache::flatten(void* buffer, size_t size, int fds[], size_t count) const { if (count != 0) { - LOGE("flatten: nonzero fd count: %d", count); + ALOGE("flatten: nonzero fd count: %d", count); return BAD_VALUE; } // Write the cache header if (size < sizeof(Header)) { - LOGE("flatten: not enough room for cache header"); + ALOGE("flatten: not enough room for cache header"); return BAD_VALUE; } Header* header = reinterpret_cast<Header*>(buffer); @@ -210,7 +210,7 @@ status_t BlobCache::flatten(void* buffer, size_t size, int fds[], size_t count) size_t entrySize = sizeof(EntryHeader) + keySize + valueSize; if (byteOffset + entrySize > size) { - LOGE("flatten: not enough room for cache entries"); + ALOGE("flatten: not enough room for cache entries"); return BAD_VALUE; } @@ -234,18 +234,18 @@ status_t BlobCache::unflatten(void const* buffer, size_t size, int fds[], mCacheEntries.clear(); if (count != 0) { - LOGE("unflatten: nonzero fd count: %d", count); + ALOGE("unflatten: nonzero fd count: %d", count); return BAD_VALUE; } // Read the cache header if (size < sizeof(Header)) { - LOGE("unflatten: not enough room for cache header"); + ALOGE("unflatten: not enough room for cache header"); return BAD_VALUE; } const Header* header = reinterpret_cast<const Header*>(buffer); if (header->mMagicNumber != blobCacheMagic) { - LOGE("unflatten: bad magic number: %d", header->mMagicNumber); + ALOGE("unflatten: bad magic number: %d", header->mMagicNumber); return BAD_VALUE; } if (header->mBlobCacheVersion != blobCacheVersion || @@ -261,7 +261,7 @@ status_t BlobCache::unflatten(void const* buffer, size_t size, int fds[], for (size_t i = 0; i < numEntries; i++) { if (byteOffset + sizeof(EntryHeader) > size) { mCacheEntries.clear(); - LOGE("unflatten: not enough room for cache entry headers"); + ALOGE("unflatten: not enough room for cache entry headers"); return BAD_VALUE; } @@ -273,7 +273,7 @@ status_t BlobCache::unflatten(void const* buffer, size_t size, int fds[], if (byteOffset + entrySize > size) { mCacheEntries.clear(); - LOGE("unflatten: not enough room for cache entry headers"); + ALOGE("unflatten: not enough room for cache entry headers"); return BAD_VALUE; } diff --git a/libs/utils/CallStack.cpp b/libs/utils/CallStack.cpp index 55b6024..bd7e239 100644 --- a/libs/utils/CallStack.cpp +++ b/libs/utils/CallStack.cpp @@ -328,7 +328,7 @@ void CallStack::dump(const char* prefix) const * get very deep. So we request function names of each frame individually. */ for (int i=0; i<int(mCount); i++) { - LOGD("%s", toStringSingleLevel(prefix, i).string()); + ALOGD("%s", toStringSingleLevel(prefix, i).string()); } } diff --git a/libs/utils/FileMap.cpp b/libs/utils/FileMap.cpp index c220a90..9ce370e 100644 --- a/libs/utils/FileMap.cpp +++ b/libs/utils/FileMap.cpp @@ -64,12 +64,12 @@ FileMap::~FileMap(void) } #ifdef HAVE_POSIX_FILEMAP if (mBasePtr && munmap(mBasePtr, mBaseLength) != 0) { - LOGD("munmap(%p, %d) failed\n", mBasePtr, (int) mBaseLength); + ALOGD("munmap(%p, %d) failed\n", mBasePtr, (int) mBaseLength); } #endif #ifdef HAVE_WIN32_FILEMAP if (mBasePtr && UnmapViewOfFile(mBasePtr) == 0) { - LOGD("UnmapViewOfFile(%p) failed, error = %ld\n", mBasePtr, + ALOGD("UnmapViewOfFile(%p) failed, error = %ld\n", mBasePtr, GetLastError() ); } if (mFileMapping != INVALID_HANDLE_VALUE) { @@ -108,7 +108,7 @@ bool FileMap::create(const char* origFileName, int fd, off64_t offset, size_t le mFileHandle = (HANDLE) _get_osfhandle(fd); mFileMapping = CreateFileMapping( mFileHandle, NULL, protect, 0, 0, NULL); if (mFileMapping == NULL) { - LOGE("CreateFileMapping(%p, %lx) failed with error %ld\n", + ALOGE("CreateFileMapping(%p, %lx) failed with error %ld\n", mFileHandle, protect, GetLastError() ); return false; } @@ -123,7 +123,7 @@ bool FileMap::create(const char* origFileName, int fd, off64_t offset, size_t le (DWORD)(adjOffset), adjLength ); if (mBasePtr == NULL) { - LOGE("MapViewOfFile(%ld, %ld) failed with error %ld\n", + ALOGE("MapViewOfFile(%ld, %ld) failed with error %ld\n", adjOffset, adjLength, GetLastError() ); CloseHandle(mFileMapping); mFileMapping = INVALID_HANDLE_VALUE; @@ -147,7 +147,7 @@ bool FileMap::create(const char* origFileName, int fd, off64_t offset, size_t le #if NOT_USING_KLIBC mPageSize = sysconf(_SC_PAGESIZE); if (mPageSize == -1) { - LOGE("could not get _SC_PAGESIZE\n"); + ALOGE("could not get _SC_PAGESIZE\n"); return false; } #else @@ -175,7 +175,7 @@ try_again: goto try_again; } - LOGE("mmap(%ld,%ld) failed: %s\n", + ALOGE("mmap(%ld,%ld) failed: %s\n", (long) adjOffset, (long) adjLength, strerror(errno)); return false; } @@ -190,7 +190,7 @@ try_again: assert(mBasePtr != NULL); - LOGV("MAP: base %p/%d data %p/%d\n", + ALOGV("MAP: base %p/%d data %p/%d\n", mBasePtr, (int) mBaseLength, mDataPtr, (int) mDataLength); return true; @@ -217,7 +217,7 @@ int FileMap::advise(MapAdvice advice) cc = madvise(mBasePtr, mBaseLength, sysAdvice); if (cc != 0) - LOGW("madvise(%d) failed: %s\n", sysAdvice, strerror(errno)); + ALOGW("madvise(%d) failed: %s\n", sysAdvice, strerror(errno)); return cc; #else return -1; diff --git a/libs/utils/Looper.cpp b/libs/utils/Looper.cpp index b54fb9d..d1aa664 100644 --- a/libs/utils/Looper.cpp +++ b/libs/utils/Looper.cpp @@ -163,7 +163,7 @@ sp<Looper> Looper::prepare(int opts) { Looper::setForThread(looper); } if (looper->getAllowNonCallbacks() != allowNonCallbacks) { - LOGW("Looper already prepared for this thread with a different value for the " + ALOGW("Looper already prepared for this thread with a different value for the " "ALOOPER_PREPARE_ALLOW_NON_CALLBACKS option."); } return looper; @@ -185,7 +185,7 @@ int Looper::pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outDa int events = response.events; void* data = response.request.data; #if DEBUG_POLL_AND_WAKE - LOGD("%p ~ pollOnce - returning signalled identifier %d: " + ALOGD("%p ~ pollOnce - returning signalled identifier %d: " "fd=%d, events=0x%x, data=%p", this, ident, fd, events, data); #endif @@ -198,7 +198,7 @@ int Looper::pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outDa if (result != 0) { #if DEBUG_POLL_AND_WAKE - LOGD("%p ~ pollOnce - returning result %d", this, result); + ALOGD("%p ~ pollOnce - returning result %d", this, result); #endif if (outFd != NULL) *outFd = 0; if (outEvents != NULL) *outEvents = NULL; @@ -212,7 +212,7 @@ int Looper::pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outDa int Looper::pollInner(int timeoutMillis) { #if DEBUG_POLL_AND_WAKE - LOGD("%p ~ pollOnce - waiting: timeoutMillis=%d", this, timeoutMillis); + ALOGD("%p ~ pollOnce - waiting: timeoutMillis=%d", this, timeoutMillis); #endif // Adjust the timeout based on when the next message is due. @@ -224,7 +224,7 @@ int Looper::pollInner(int timeoutMillis) { timeoutMillis = messageTimeoutMillis; } #if DEBUG_POLL_AND_WAKE - LOGD("%p ~ pollOnce - next message in %lldns, adjusted timeout: timeoutMillis=%d", + ALOGD("%p ~ pollOnce - next message in %lldns, adjusted timeout: timeoutMillis=%d", this, mNextMessageUptime - now, timeoutMillis); #endif } @@ -262,7 +262,7 @@ int Looper::pollInner(int timeoutMillis) { if (errno == EINTR) { goto Done; } - LOGW("Poll failed with an unexpected error, errno=%d", errno); + ALOGW("Poll failed with an unexpected error, errno=%d", errno); result = ALOOPER_POLL_ERROR; goto Done; } @@ -270,7 +270,7 @@ int Looper::pollInner(int timeoutMillis) { // Check for poll timeout. if (eventCount == 0) { #if DEBUG_POLL_AND_WAKE - LOGD("%p ~ pollOnce - timeout", this); + ALOGD("%p ~ pollOnce - timeout", this); #endif result = ALOOPER_POLL_TIMEOUT; goto Done; @@ -278,7 +278,7 @@ int Looper::pollInner(int timeoutMillis) { // Handle all events. #if DEBUG_POLL_AND_WAKE - LOGD("%p ~ pollOnce - handling events from %d fds", this, eventCount); + ALOGD("%p ~ pollOnce - handling events from %d fds", this, eventCount); #endif #ifdef LOOPER_USES_EPOLL @@ -289,7 +289,7 @@ int Looper::pollInner(int timeoutMillis) { if (epollEvents & EPOLLIN) { awoken(); } else { - LOGW("Ignoring unexpected epoll events 0x%x on wake read pipe.", epollEvents); + ALOGW("Ignoring unexpected epoll events 0x%x on wake read pipe.", epollEvents); } } else { ssize_t requestIndex = mRequests.indexOfKey(fd); @@ -301,7 +301,7 @@ int Looper::pollInner(int timeoutMillis) { if (epollEvents & EPOLLHUP) events |= ALOOPER_EVENT_HANGUP; pushResponse(events, mRequests.valueAt(requestIndex)); } else { - LOGW("Ignoring unexpected epoll events 0x%x on fd %d that is " + ALOGW("Ignoring unexpected epoll events 0x%x on fd %d that is " "no longer registered.", epollEvents, fd); } } @@ -317,7 +317,7 @@ Done: ; if (pollEvents & POLLIN) { awoken(); } else { - LOGW("Ignoring unexpected poll events 0x%x on wake read pipe.", pollEvents); + ALOGW("Ignoring unexpected poll events 0x%x on wake read pipe.", pollEvents); } } else { int events = 0; @@ -353,7 +353,7 @@ Done: - milliseconds_to_nanoseconds(timeoutMillis); } if (mSampledPolls == SAMPLED_POLLS_TO_AGGREGATE) { - LOGD("%p ~ poll latency statistics: %0.3fms zero timeout, %0.3fms non-zero timeout", this, + ALOGD("%p ~ poll latency statistics: %0.3fms zero timeout, %0.3fms non-zero timeout", this, 0.000001f * float(mSampledZeroPollLatencySum) / mSampledZeroPollCount, 0.000001f * float(mSampledTimeoutPollLatencySum) / mSampledTimeoutPollCount); mSampledPolls = 0; @@ -382,7 +382,7 @@ Done: mLock.unlock(); #if DEBUG_POLL_AND_WAKE || DEBUG_CALLBACKS - LOGD("%p ~ pollOnce - sending message: handler=%p, what=%d", + ALOGD("%p ~ pollOnce - sending message: handler=%p, what=%d", this, handler.get(), message.what); #endif handler->handleMessage(message); @@ -410,7 +410,7 @@ Done: int events = response.events; void* data = response.request.data; #if DEBUG_POLL_AND_WAKE || DEBUG_CALLBACKS - LOGD("%p ~ pollOnce - invoking fd event callback %p: fd=%d, events=0x%x, data=%p", + ALOGD("%p ~ pollOnce - invoking fd event callback %p: fd=%d, events=0x%x, data=%p", this, callback, fd, events, data); #endif int callbackResult = callback(fd, events, data); @@ -451,7 +451,7 @@ int Looper::pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outDat void Looper::wake() { #if DEBUG_POLL_AND_WAKE - LOGD("%p ~ wake", this); + ALOGD("%p ~ wake", this); #endif #ifdef LOOPER_STATISTICS @@ -468,19 +468,19 @@ void Looper::wake() { if (nWrite != 1) { if (errno != EAGAIN) { - LOGW("Could not write wake signal, errno=%d", errno); + ALOGW("Could not write wake signal, errno=%d", errno); } } } void Looper::awoken() { #if DEBUG_POLL_AND_WAKE - LOGD("%p ~ awoken", this); + ALOGD("%p ~ awoken", this); #endif #ifdef LOOPER_STATISTICS if (mPendingWakeCount == 0) { - LOGD("%p ~ awoken: spurious!", this); + ALOGD("%p ~ awoken: spurious!", this); } else { mSampledWakeCycles += 1; mSampledWakeCountSum += mPendingWakeCount; @@ -488,7 +488,7 @@ void Looper::awoken() { mPendingWakeCount = 0; mPendingWakeTime = -1; if (mSampledWakeCycles == SAMPLED_WAKE_CYCLES_TO_AGGREGATE) { - LOGD("%p ~ wake statistics: %0.3fms wake latency, %0.3f wakes per cycle", this, + ALOGD("%p ~ wake statistics: %0.3fms wake latency, %0.3f wakes per cycle", this, 0.000001f * float(mSampledWakeLatencySum) / mSampledWakeCycles, float(mSampledWakeCountSum) / mSampledWakeCycles); mSampledWakeCycles = 0; @@ -514,18 +514,18 @@ void Looper::pushResponse(int events, const Request& request) { int Looper::addFd(int fd, int ident, int events, ALooper_callbackFunc callback, void* data) { #if DEBUG_CALLBACKS - LOGD("%p ~ addFd - fd=%d, ident=%d, events=0x%x, callback=%p, data=%p", this, fd, ident, + ALOGD("%p ~ addFd - fd=%d, ident=%d, events=0x%x, callback=%p, data=%p", this, fd, ident, events, callback, data); #endif if (! callback) { if (! mAllowNonCallbacks) { - LOGE("Invalid attempt to set NULL callback but not allowed for this looper."); + ALOGE("Invalid attempt to set NULL callback but not allowed for this looper."); return -1; } if (ident < 0) { - LOGE("Invalid attempt to set NULL callback with ident <= 0."); + ALOGE("Invalid attempt to set NULL callback with ident <= 0."); return -1; } } @@ -553,14 +553,14 @@ int Looper::addFd(int fd, int ident, int events, ALooper_callbackFunc callback, if (requestIndex < 0) { int epollResult = epoll_ctl(mEpollFd, EPOLL_CTL_ADD, fd, & eventItem); if (epollResult < 0) { - LOGE("Error adding epoll events for fd %d, errno=%d", fd, errno); + ALOGE("Error adding epoll events for fd %d, errno=%d", fd, errno); return -1; } mRequests.add(fd, request); } else { int epollResult = epoll_ctl(mEpollFd, EPOLL_CTL_MOD, fd, & eventItem); if (epollResult < 0) { - LOGE("Error modifying epoll events for fd %d, errno=%d", fd, errno); + ALOGE("Error modifying epoll events for fd %d, errno=%d", fd, errno); return -1; } mRequests.replaceValueAt(requestIndex, request); @@ -598,7 +598,7 @@ int Looper::addFd(int fd, int ident, int events, ALooper_callbackFunc callback, int Looper::removeFd(int fd) { #if DEBUG_CALLBACKS - LOGD("%p ~ removeFd - fd=%d", this, fd); + ALOGD("%p ~ removeFd - fd=%d", this, fd); #endif #ifdef LOOPER_USES_EPOLL @@ -611,7 +611,7 @@ int Looper::removeFd(int fd) { int epollResult = epoll_ctl(mEpollFd, EPOLL_CTL_DEL, fd, NULL); if (epollResult < 0) { - LOGE("Error removing epoll events for fd %d, errno=%d", fd, errno); + ALOGE("Error removing epoll events for fd %d, errno=%d", fd, errno); return -1; } @@ -675,7 +675,7 @@ void Looper::sendMessageDelayed(nsecs_t uptimeDelay, const sp<MessageHandler>& h void Looper::sendMessageAtTime(nsecs_t uptime, const sp<MessageHandler>& handler, const Message& message) { #if DEBUG_CALLBACKS - LOGD("%p ~ sendMessageAtTime - uptime=%lld, handler=%p, what=%d", + ALOGD("%p ~ sendMessageAtTime - uptime=%lld, handler=%p, what=%d", this, uptime, handler.get(), message.what); #endif @@ -708,7 +708,7 @@ void Looper::sendMessageAtTime(nsecs_t uptime, const sp<MessageHandler>& handler void Looper::removeMessages(const sp<MessageHandler>& handler) { #if DEBUG_CALLBACKS - LOGD("%p ~ removeMessages - handler=%p", this, handler.get()); + ALOGD("%p ~ removeMessages - handler=%p", this, handler.get()); #endif { // acquire lock @@ -725,7 +725,7 @@ void Looper::removeMessages(const sp<MessageHandler>& handler) { void Looper::removeMessages(const sp<MessageHandler>& handler, int what) { #if DEBUG_CALLBACKS - LOGD("%p ~ removeMessages - handler=%p, what=%d", this, handler.get(), what); + ALOGD("%p ~ removeMessages - handler=%p, what=%d", this, handler.get(), what); #endif { // acquire lock diff --git a/libs/utils/ObbFile.cpp b/libs/utils/ObbFile.cpp index 2907b56..ddf5991 100644 --- a/libs/utils/ObbFile.cpp +++ b/libs/utils/ObbFile.cpp @@ -90,14 +90,14 @@ bool ObbFile::readFrom(const char* filename) fd = ::open(filename, O_RDONLY); if (fd < 0) { - LOGW("couldn't open file %s: %s", filename, strerror(errno)); + ALOGW("couldn't open file %s: %s", filename, strerror(errno)); goto out; } success = readFrom(fd); close(fd); if (!success) { - LOGW("failed to read from %s (fd=%d)\n", filename, fd); + ALOGW("failed to read from %s (fd=%d)\n", filename, fd); } out: @@ -107,7 +107,7 @@ out: bool ObbFile::readFrom(int fd) { if (fd < 0) { - LOGW("attempt to read from invalid fd\n"); + ALOGW("attempt to read from invalid fd\n"); return false; } @@ -120,9 +120,9 @@ bool ObbFile::parseObbFile(int fd) if (fileLength < kFooterMinSize) { if (fileLength < 0) { - LOGW("error seeking in ObbFile: %s\n", strerror(errno)); + ALOGW("error seeking in ObbFile: %s\n", strerror(errno)); } else { - LOGW("file is only %lld (less than %d minimum)\n", fileLength, kFooterMinSize); + ALOGW("file is only %lld (less than %d minimum)\n", fileLength, kFooterMinSize); } return false; } @@ -136,13 +136,13 @@ bool ObbFile::parseObbFile(int fd) char *footer = new char[kFooterTagSize]; actual = TEMP_FAILURE_RETRY(read(fd, footer, kFooterTagSize)); if (actual != kFooterTagSize) { - LOGW("couldn't read footer signature: %s\n", strerror(errno)); + ALOGW("couldn't read footer signature: %s\n", strerror(errno)); return false; } unsigned int fileSig = get4LE((unsigned char*)footer + sizeof(int32_t)); if (fileSig != kSignature) { - LOGW("footer didn't match magic string (expected 0x%08x; got 0x%08x)\n", + ALOGW("footer didn't match magic string (expected 0x%08x; got 0x%08x)\n", kSignature, fileSig); return false; } @@ -150,13 +150,13 @@ bool ObbFile::parseObbFile(int fd) footerSize = get4LE((unsigned char*)footer); if (footerSize > (size_t)fileLength - kFooterTagSize || footerSize > kMaxBufSize) { - LOGW("claimed footer size is too large (0x%08zx; file size is 0x%08llx)\n", + ALOGW("claimed footer size is too large (0x%08zx; file size is 0x%08llx)\n", footerSize, fileLength); return false; } if (footerSize < (kFooterMinSize - kFooterTagSize)) { - LOGW("claimed footer size is too small (0x%zx; minimum size is 0x%x)\n", + ALOGW("claimed footer size is too small (0x%zx; minimum size is 0x%x)\n", footerSize, kFooterMinSize - kFooterTagSize); return false; } @@ -164,7 +164,7 @@ bool ObbFile::parseObbFile(int fd) off64_t fileOffset = fileLength - footerSize - kFooterTagSize; if (lseek64(fd, fileOffset, SEEK_SET) != fileOffset) { - LOGW("seek %lld failed: %s\n", fileOffset, strerror(errno)); + ALOGW("seek %lld failed: %s\n", fileOffset, strerror(errno)); return false; } @@ -172,27 +172,27 @@ bool ObbFile::parseObbFile(int fd) char* scanBuf = (char*)malloc(footerSize); if (scanBuf == NULL) { - LOGW("couldn't allocate scanBuf: %s\n", strerror(errno)); + ALOGW("couldn't allocate scanBuf: %s\n", strerror(errno)); return false; } actual = TEMP_FAILURE_RETRY(read(fd, scanBuf, footerSize)); // readAmount is guaranteed to be less than kMaxBufSize if (actual != (ssize_t)footerSize) { - LOGI("couldn't read ObbFile footer: %s\n", strerror(errno)); + ALOGI("couldn't read ObbFile footer: %s\n", strerror(errno)); free(scanBuf); return false; } #ifdef DEBUG for (int i = 0; i < footerSize; ++i) { - LOGI("char: 0x%02x\n", scanBuf[i]); + ALOGI("char: 0x%02x\n", scanBuf[i]); } #endif uint32_t sigVersion = get4LE((unsigned char*)scanBuf); if (sigVersion != kSigVersion) { - LOGW("Unsupported ObbFile version %d\n", sigVersion); + ALOGW("Unsupported ObbFile version %d\n", sigVersion); free(scanBuf); return false; } @@ -205,7 +205,7 @@ bool ObbFile::parseObbFile(int fd) size_t packageNameLen = get4LE((unsigned char*)scanBuf + kPackageNameLenOffset); if (packageNameLen == 0 || packageNameLen > (footerSize - kPackageNameOffset)) { - LOGW("bad ObbFile package name length (0x%04zx; 0x%04zx possible)\n", + ALOGW("bad ObbFile package name length (0x%04zx; 0x%04zx possible)\n", packageNameLen, footerSize - kPackageNameOffset); free(scanBuf); return false; @@ -217,7 +217,7 @@ bool ObbFile::parseObbFile(int fd) free(scanBuf); #ifdef DEBUG - LOGI("Obb scan succeeded: packageName=%s, version=%d\n", mPackageName.string(), mVersion); + ALOGI("Obb scan succeeded: packageName=%s, version=%d\n", mPackageName.string(), mVersion); #endif return true; @@ -237,7 +237,7 @@ bool ObbFile::writeTo(const char* filename) out: if (!success) { - LOGW("failed to write to %s: %s\n", filename, strerror(errno)); + ALOGW("failed to write to %s: %s\n", filename, strerror(errno)); } return success; } @@ -251,7 +251,7 @@ bool ObbFile::writeTo(int fd) lseek64(fd, 0, SEEK_END); if (mPackageName.size() == 0 || mVersion == -1) { - LOGW("tried to write uninitialized ObbFile data\n"); + ALOGW("tried to write uninitialized ObbFile data\n"); return false; } @@ -260,48 +260,48 @@ bool ObbFile::writeTo(int fd) put4LE(intBuf, kSigVersion); if (write(fd, &intBuf, sizeof(uint32_t)) != (ssize_t)sizeof(uint32_t)) { - LOGW("couldn't write signature version: %s\n", strerror(errno)); + ALOGW("couldn't write signature version: %s\n", strerror(errno)); return false; } put4LE(intBuf, mVersion); if (write(fd, &intBuf, sizeof(uint32_t)) != (ssize_t)sizeof(uint32_t)) { - LOGW("couldn't write package version\n"); + ALOGW("couldn't write package version\n"); return false; } put4LE(intBuf, mFlags); if (write(fd, &intBuf, sizeof(uint32_t)) != (ssize_t)sizeof(uint32_t)) { - LOGW("couldn't write package version\n"); + ALOGW("couldn't write package version\n"); return false; } if (write(fd, mSalt, sizeof(mSalt)) != (ssize_t)sizeof(mSalt)) { - LOGW("couldn't write salt: %s\n", strerror(errno)); + ALOGW("couldn't write salt: %s\n", strerror(errno)); return false; } size_t packageNameLen = mPackageName.size(); put4LE(intBuf, packageNameLen); if (write(fd, &intBuf, sizeof(uint32_t)) != (ssize_t)sizeof(uint32_t)) { - LOGW("couldn't write package name length: %s\n", strerror(errno)); + ALOGW("couldn't write package name length: %s\n", strerror(errno)); return false; } if (write(fd, mPackageName.string(), packageNameLen) != (ssize_t)packageNameLen) { - LOGW("couldn't write package name: %s\n", strerror(errno)); + ALOGW("couldn't write package name: %s\n", strerror(errno)); return false; } put4LE(intBuf, kPackageNameOffset + packageNameLen); if (write(fd, &intBuf, sizeof(uint32_t)) != (ssize_t)sizeof(uint32_t)) { - LOGW("couldn't write footer size: %s\n", strerror(errno)); + ALOGW("couldn't write footer size: %s\n", strerror(errno)); return false; } put4LE(intBuf, kSignature); if (write(fd, &intBuf, sizeof(uint32_t)) != (ssize_t)sizeof(uint32_t)) { - LOGW("couldn't write footer magic signature: %s\n", strerror(errno)); + ALOGW("couldn't write footer magic signature: %s\n", strerror(errno)); return false; } @@ -322,7 +322,7 @@ bool ObbFile::removeFrom(const char* filename) out: if (!success) { - LOGW("failed to remove signature from %s: %s\n", filename, strerror(errno)); + ALOGW("failed to remove signature from %s: %s\n", filename, strerror(errno)); } return success; } diff --git a/libs/utils/PropertyMap.cpp b/libs/utils/PropertyMap.cpp index d472d45..5520702 100644 --- a/libs/utils/PropertyMap.cpp +++ b/libs/utils/PropertyMap.cpp @@ -84,7 +84,7 @@ bool PropertyMap::tryGetProperty(const String8& key, int32_t& outValue) const { char* end; int value = strtol(stringValue.string(), & end, 10); if (*end != '\0') { - LOGW("Property key '%s' has invalid value '%s'. Expected an integer.", + ALOGW("Property key '%s' has invalid value '%s'. Expected an integer.", key.string(), stringValue.string()); return false; } @@ -101,7 +101,7 @@ bool PropertyMap::tryGetProperty(const String8& key, float& outValue) const { char* end; float value = strtof(stringValue.string(), & end); if (*end != '\0') { - LOGW("Property key '%s' has invalid value '%s'. Expected a float.", + ALOGW("Property key '%s' has invalid value '%s'. Expected a float.", key.string(), stringValue.string()); return false; } @@ -121,11 +121,11 @@ status_t PropertyMap::load(const String8& filename, PropertyMap** outMap) { Tokenizer* tokenizer; status_t status = Tokenizer::open(filename, &tokenizer); if (status) { - LOGE("Error %d opening property file %s.", status, filename.string()); + ALOGE("Error %d opening property file %s.", status, filename.string()); } else { PropertyMap* map = new PropertyMap(); if (!map) { - LOGE("Error allocating property map."); + ALOGE("Error allocating property map."); status = NO_MEMORY; } else { #if DEBUG_PARSER_PERFORMANCE @@ -135,7 +135,7 @@ status_t PropertyMap::load(const String8& filename, PropertyMap** outMap) { status = parser.parse(); #if DEBUG_PARSER_PERFORMANCE nsecs_t elapsedTime = systemTime(SYSTEM_TIME_MONOTONIC) - startTime; - LOGD("Parsed property file '%s' %d lines in %0.3fms.", + ALOGD("Parsed property file '%s' %d lines in %0.3fms.", tokenizer->getFilename().string(), tokenizer->getLineNumber(), elapsedTime / 1000000.0); #endif @@ -163,7 +163,7 @@ PropertyMap::Parser::~Parser() { status_t PropertyMap::Parser::parse() { while (!mTokenizer->isEof()) { #if DEBUG_PARSER - LOGD("Parsing %s: '%s'.", mTokenizer->getLocation().string(), + ALOGD("Parsing %s: '%s'.", mTokenizer->getLocation().string(), mTokenizer->peekRemainderOfLine().string()); #endif @@ -172,14 +172,14 @@ status_t PropertyMap::Parser::parse() { if (!mTokenizer->isEol() && mTokenizer->peekChar() != '#') { String8 keyToken = mTokenizer->nextToken(WHITESPACE_OR_PROPERTY_DELIMITER); if (keyToken.isEmpty()) { - LOGE("%s: Expected non-empty property key.", mTokenizer->getLocation().string()); + ALOGE("%s: Expected non-empty property key.", mTokenizer->getLocation().string()); return BAD_VALUE; } mTokenizer->skipDelimiters(WHITESPACE); if (mTokenizer->nextChar() != '=') { - LOGE("%s: Expected '=' between property key and value.", + ALOGE("%s: Expected '=' between property key and value.", mTokenizer->getLocation().string()); return BAD_VALUE; } @@ -188,21 +188,21 @@ status_t PropertyMap::Parser::parse() { String8 valueToken = mTokenizer->nextToken(WHITESPACE); if (valueToken.find("\\", 0) >= 0 || valueToken.find("\"", 0) >= 0) { - LOGE("%s: Found reserved character '\\' or '\"' in property value.", + ALOGE("%s: Found reserved character '\\' or '\"' in property value.", mTokenizer->getLocation().string()); return BAD_VALUE; } mTokenizer->skipDelimiters(WHITESPACE); if (!mTokenizer->isEol()) { - LOGE("%s: Expected end of line, got '%s'.", + ALOGE("%s: Expected end of line, got '%s'.", mTokenizer->getLocation().string(), mTokenizer->peekRemainderOfLine().string()); return BAD_VALUE; } if (mMap->hasProperty(keyToken)) { - LOGE("%s: Duplicate property value for key '%s'.", + ALOGE("%s: Duplicate property value for key '%s'.", mTokenizer->getLocation().string(), keyToken.string()); return BAD_VALUE; } diff --git a/libs/utils/RefBase.cpp b/libs/utils/RefBase.cpp index 37d061c..e80a795 100644 --- a/libs/utils/RefBase.cpp +++ b/libs/utils/RefBase.cpp @@ -98,12 +98,12 @@ public: #if DEBUG_REFS_FATAL_SANITY_CHECKS LOG_ALWAYS_FATAL("Strong references remain!"); #else - LOGE("Strong references remain:"); + ALOGE("Strong references remain:"); #endif ref_entry* refs = mStrongRefs; while (refs) { char inc = refs->ref >= 0 ? '+' : '-'; - LOGD("\t%c ID %p (ref %d):", inc, refs->id, refs->ref); + ALOGD("\t%c ID %p (ref %d):", inc, refs->id, refs->ref); #if DEBUG_REFS_CALLSTACK_ENABLED refs->stack.dump(); #endif @@ -116,12 +116,12 @@ public: #if DEBUG_REFS_FATAL_SANITY_CHECKS LOG_ALWAYS_FATAL("Weak references remain:"); #else - LOGE("Weak references remain!"); + ALOGE("Weak references remain!"); #endif ref_entry* refs = mWeakRefs; while (refs) { char inc = refs->ref >= 0 ? '+' : '-'; - LOGD("\t%c ID %p (ref %d):", inc, refs->id, refs->ref); + ALOGD("\t%c ID %p (ref %d):", inc, refs->id, refs->ref); #if DEBUG_REFS_CALLSTACK_ENABLED refs->stack.dump(); #endif @@ -129,7 +129,7 @@ public: } } if (dumpStack) { - LOGE("above errors at:"); + ALOGE("above errors at:"); CallStack stack; stack.update(); stack.dump(); @@ -137,13 +137,13 @@ public: } void addStrongRef(const void* id) { - //LOGD_IF(mTrackEnabled, + //ALOGD_IF(mTrackEnabled, // "addStrongRef: RefBase=%p, id=%p", mBase, id); addRef(&mStrongRefs, id, mStrong); } void removeStrongRef(const void* id) { - //LOGD_IF(mTrackEnabled, + //ALOGD_IF(mTrackEnabled, // "removeStrongRef: RefBase=%p, id=%p", mBase, id); if (!mRetain) { removeRef(&mStrongRefs, id); @@ -153,7 +153,7 @@ public: } void renameStrongRefId(const void* old_id, const void* new_id) { - //LOGD_IF(mTrackEnabled, + //ALOGD_IF(mTrackEnabled, // "renameStrongRefId: RefBase=%p, oid=%p, nid=%p", // mBase, old_id, new_id); renameRefsId(mStrongRefs, old_id, new_id); @@ -203,9 +203,9 @@ public: if (rc >= 0) { write(rc, text.string(), text.length()); close(rc); - LOGD("STACK TRACE for %p saved in %s", this, name); + ALOGD("STACK TRACE for %p saved in %s", this, name); } - else LOGE("FAILED TO PRINT STACK TRACE for %p in %s: %s", this, + else ALOGE("FAILED TO PRINT STACK TRACE for %p in %s: %s", this, name, strerror(errno)); } } @@ -263,14 +263,14 @@ private: id, mBase, this); #endif - LOGE("RefBase: removing id %p on RefBase %p" + ALOGE("RefBase: removing id %p on RefBase %p" "(weakref_type %p) that doesn't exist!", id, mBase, this); ref = head; while (ref) { char inc = ref->ref >= 0 ? '+' : '-'; - LOGD("\t%c ID %p (ref %d):", inc, ref->id, ref->ref); + ALOGD("\t%c ID %p (ref %d):", inc, ref->id, ref->ref); ref = ref->next; } @@ -332,9 +332,9 @@ void RefBase::incStrong(const void* id) const refs->addStrongRef(id); const int32_t c = android_atomic_inc(&refs->mStrong); - LOG_ASSERT(c > 0, "incStrong() called on %p after last strong ref", refs); + ALOG_ASSERT(c > 0, "incStrong() called on %p after last strong ref", refs); #if PRINT_REFS - LOGD("incStrong of %p from %p: cnt=%d\n", this, id, c); + ALOGD("incStrong of %p from %p: cnt=%d\n", this, id, c); #endif if (c != INITIAL_STRONG_VALUE) { return; @@ -350,9 +350,9 @@ void RefBase::decStrong(const void* id) const refs->removeStrongRef(id); const int32_t c = android_atomic_dec(&refs->mStrong); #if PRINT_REFS - LOGD("decStrong of %p from %p: cnt=%d\n", this, id, c); + ALOGD("decStrong of %p from %p: cnt=%d\n", this, id, c); #endif - LOG_ASSERT(c >= 1, "decStrong() called on %p too many times", refs); + ALOG_ASSERT(c >= 1, "decStrong() called on %p too many times", refs); if (c == 1) { refs->mBase->onLastStrongRef(id); if ((refs->mFlags&OBJECT_LIFETIME_MASK) == OBJECT_LIFETIME_STRONG) { @@ -369,10 +369,10 @@ void RefBase::forceIncStrong(const void* id) const refs->addStrongRef(id); const int32_t c = android_atomic_inc(&refs->mStrong); - LOG_ASSERT(c >= 0, "forceIncStrong called on %p after ref count underflow", + ALOG_ASSERT(c >= 0, "forceIncStrong called on %p after ref count underflow", refs); #if PRINT_REFS - LOGD("forceIncStrong of %p from %p: cnt=%d\n", this, id, c); + ALOGD("forceIncStrong of %p from %p: cnt=%d\n", this, id, c); #endif switch (c) { @@ -399,7 +399,7 @@ void RefBase::weakref_type::incWeak(const void* id) weakref_impl* const impl = static_cast<weakref_impl*>(this); impl->addWeakRef(id); const int32_t c = android_atomic_inc(&impl->mWeak); - LOG_ASSERT(c >= 0, "incWeak called on %p after last weak ref", this); + ALOG_ASSERT(c >= 0, "incWeak called on %p after last weak ref", this); } @@ -408,7 +408,7 @@ void RefBase::weakref_type::decWeak(const void* id) weakref_impl* const impl = static_cast<weakref_impl*>(this); impl->removeWeakRef(id); const int32_t c = android_atomic_dec(&impl->mWeak); - LOG_ASSERT(c >= 1, "decWeak called on %p too many times", this); + ALOG_ASSERT(c >= 1, "decWeak called on %p too many times", this); if (c != 1) return; if ((impl->mFlags&OBJECT_LIFETIME_WEAK) == OBJECT_LIFETIME_STRONG) { @@ -421,7 +421,7 @@ void RefBase::weakref_type::decWeak(const void* id) // destroy the object now. delete impl->mBase; } else { - // LOGV("Freeing refs %p of old RefBase %p\n", this, impl->mBase); + // ALOGV("Freeing refs %p of old RefBase %p\n", this, impl->mBase); delete impl; } } else { @@ -442,7 +442,7 @@ bool RefBase::weakref_type::attemptIncStrong(const void* id) weakref_impl* const impl = static_cast<weakref_impl*>(this); int32_t curCount = impl->mStrong; - LOG_ASSERT(curCount >= 0, "attemptIncStrong called on %p after underflow", + ALOG_ASSERT(curCount >= 0, "attemptIncStrong called on %p after underflow", this); while (curCount > 0 && curCount != INITIAL_STRONG_VALUE) { if (android_atomic_cmpxchg(curCount, curCount+1, &impl->mStrong) == 0) { @@ -487,7 +487,7 @@ bool RefBase::weakref_type::attemptIncStrong(const void* id) impl->addStrongRef(id); #if PRINT_REFS - LOGD("attemptIncStrong of %p from %p: cnt=%d\n", this, id, curCount); + ALOGD("attemptIncStrong of %p from %p: cnt=%d\n", this, id, curCount); #endif if (curCount == INITIAL_STRONG_VALUE) { @@ -503,7 +503,7 @@ bool RefBase::weakref_type::attemptIncWeak(const void* id) weakref_impl* const impl = static_cast<weakref_impl*>(this); int32_t curCount = impl->mWeak; - LOG_ASSERT(curCount >= 0, "attemptIncWeak called on %p after underflow", + ALOG_ASSERT(curCount >= 0, "attemptIncWeak called on %p after underflow", this); while (curCount > 0) { if (android_atomic_cmpxchg(curCount, curCount+1, &impl->mWeak) == 0) { diff --git a/libs/utils/ResourceTypes.cpp b/libs/utils/ResourceTypes.cpp index 6cf01c8..15b83bb 100644 --- a/libs/utils/ResourceTypes.cpp +++ b/libs/utils/ResourceTypes.cpp @@ -69,7 +69,7 @@ namespace android { static void printToLogFunc(void* cookie, const char* txt) { - LOGV("%s", txt); + ALOGV("%s", txt); } // Standard C isspace() is only required to look at the low byte of its input, so @@ -107,20 +107,20 @@ static status_t validate_chunk(const ResChunk_header* chunk, if ((ssize_t)size <= (dataEnd-((const uint8_t*)chunk))) { return NO_ERROR; } - LOGW("%s data size %p extends beyond resource end %p.", + ALOGW("%s data size %p extends beyond resource end %p.", name, (void*)size, (void*)(dataEnd-((const uint8_t*)chunk))); return BAD_TYPE; } - LOGW("%s size 0x%x or headerSize 0x%x is not on an integer boundary.", + ALOGW("%s size 0x%x or headerSize 0x%x is not on an integer boundary.", name, (int)size, (int)headerSize); return BAD_TYPE; } - LOGW("%s size %p is smaller than header size %p.", + ALOGW("%s size %p is smaller than header size %p.", name, (void*)size, (void*)(int)headerSize); return BAD_TYPE; } - LOGW("%s header size %p is too small.", + ALOGW("%s header size %p is too small.", name, (void*)(int)headerSize); return BAD_TYPE; } @@ -221,11 +221,11 @@ static void deserializeInternal(const void* inData, Res_png_9patch* outData) { static bool assertIdmapHeader(const uint32_t* map, size_t sizeBytes) { if (sizeBytes < ResTable::IDMAP_HEADER_SIZE_BYTES) { - LOGW("idmap assertion failed: size=%d bytes\n", sizeBytes); + ALOGW("idmap assertion failed: size=%d bytes\n", sizeBytes); return false; } if (*map != htodl(IDMAP_MAGIC)) { // htodl: map data expected to be in correct endianess - LOGW("idmap assertion failed: invalid magic found (is 0x%08x, expected 0x%08x)\n", + ALOGW("idmap assertion failed: invalid magic found (is 0x%08x, expected 0x%08x)\n", *map, htodl(IDMAP_MAGIC)); return false; } @@ -246,11 +246,11 @@ static status_t idmapLookup(const uint32_t* map, size_t sizeBytes, uint32_t key, const uint32_t typeCount = *map; if (type > typeCount) { - LOGW("Resource ID map: type=%d exceeds number of types=%d\n", type, typeCount); + ALOGW("Resource ID map: type=%d exceeds number of types=%d\n", type, typeCount); return UNKNOWN_ERROR; } if (typeCount > size) { - LOGW("Resource ID map: number of types=%d exceeds size of map=%d\n", typeCount, size); + ALOGW("Resource ID map: number of types=%d exceeds size of map=%d\n", typeCount, size); return UNKNOWN_ERROR; } const uint32_t typeOffset = map[type]; @@ -259,7 +259,7 @@ static status_t idmapLookup(const uint32_t* map, size_t sizeBytes, uint32_t key, return NO_ERROR; } if (typeOffset + 1 > size) { - LOGW("Resource ID map: type offset=%d exceeds reasonable value, size of map=%d\n", + ALOGW("Resource ID map: type offset=%d exceeds reasonable value, size of map=%d\n", typeOffset, size); return UNKNOWN_ERROR; } @@ -271,7 +271,7 @@ static status_t idmapLookup(const uint32_t* map, size_t sizeBytes, uint32_t key, } const uint32_t index = typeOffset + 2 + entry - entryOffset; if (index > size) { - LOGW("Resource ID map: entry index=%d exceeds size of map=%d\n", index, size); + ALOGW("Resource ID map: entry index=%d exceeds size of map=%d\n", index, size); *outValue = 0; return NO_ERROR; } @@ -296,7 +296,7 @@ static status_t getIdmapPackageId(const uint32_t* map, size_t mapSize, uint32_t Res_png_9patch* Res_png_9patch::deserialize(const void* inData) { if (sizeof(void*) != sizeof(int32_t)) { - LOGE("Cannot deserialize on non 32-bit system\n"); + ALOGE("Cannot deserialize on non 32-bit system\n"); return NULL; } deserializeInternal(inData, (Res_png_9patch*) inData); @@ -358,7 +358,7 @@ status_t ResStringPool::setTo(const void* data, size_t size, bool copyData) if (mHeader->header.headerSize > mHeader->header.size || mHeader->header.size > size) { - LOGW("Bad string block: header size %d or total size %d is larger than data size %d\n", + ALOGW("Bad string block: header size %d or total size %d is larger than data size %d\n", (int)mHeader->header.headerSize, (int)mHeader->header.size, (int)size); return (mError=BAD_TYPE); } @@ -370,7 +370,7 @@ status_t ResStringPool::setTo(const void* data, size_t size, bool copyData) if ((mHeader->stringCount*sizeof(uint32_t) < mHeader->stringCount) // uint32 overflow? || (mHeader->header.headerSize+(mHeader->stringCount*sizeof(uint32_t))) > size) { - LOGW("Bad string block: entry of %d items extends past data size %d\n", + ALOGW("Bad string block: entry of %d items extends past data size %d\n", (int)(mHeader->header.headerSize+(mHeader->stringCount*sizeof(uint32_t))), (int)size); return (mError=BAD_TYPE); @@ -388,7 +388,7 @@ status_t ResStringPool::setTo(const void* data, size_t size, bool copyData) mStrings = (const void*) (((const uint8_t*)data)+mHeader->stringsStart); if (mHeader->stringsStart >= (mHeader->header.size-sizeof(uint16_t))) { - LOGW("Bad string block: string pool starts at %d, after total size %d\n", + ALOGW("Bad string block: string pool starts at %d, after total size %d\n", (int)mHeader->stringsStart, (int)mHeader->header.size); return (mError=BAD_TYPE); } @@ -398,13 +398,13 @@ status_t ResStringPool::setTo(const void* data, size_t size, bool copyData) } else { // check invariant: styles starts before end of data if (mHeader->stylesStart >= (mHeader->header.size-sizeof(uint16_t))) { - LOGW("Bad style block: style block starts at %d past data size of %d\n", + ALOGW("Bad style block: style block starts at %d past data size of %d\n", (int)mHeader->stylesStart, (int)mHeader->header.size); return (mError=BAD_TYPE); } // check invariant: styles follow the strings if (mHeader->stylesStart <= mHeader->stringsStart) { - LOGW("Bad style block: style block starts at %d, before strings at %d\n", + ALOGW("Bad style block: style block starts at %d, before strings at %d\n", (int)mHeader->stylesStart, (int)mHeader->stringsStart); return (mError=BAD_TYPE); } @@ -414,7 +414,7 @@ status_t ResStringPool::setTo(const void* data, size_t size, bool copyData) // check invariant: stringCount > 0 requires a string pool to exist if (mStringPoolSize == 0) { - LOGW("Bad string block: stringCount is %d but pool size is 0\n", (int)mHeader->stringCount); + ALOGW("Bad string block: stringCount is %d but pool size is 0\n", (int)mHeader->stringCount); return (mError=BAD_TYPE); } @@ -437,7 +437,7 @@ status_t ResStringPool::setTo(const void* data, size_t size, bool copyData) ((uint8_t*)mStrings)[mStringPoolSize-1] != 0) || (!mHeader->flags&ResStringPool_header::UTF8_FLAG && ((char16_t*)mStrings)[mStringPoolSize-1] != 0)) { - LOGW("Bad string block: last string is not 0-terminated\n"); + ALOGW("Bad string block: last string is not 0-terminated\n"); return (mError=BAD_TYPE); } } else { @@ -449,12 +449,12 @@ status_t ResStringPool::setTo(const void* data, size_t size, bool copyData) mEntryStyles = mEntries + mHeader->stringCount; // invariant: integer overflow in calculating mEntryStyles if (mEntryStyles < mEntries) { - LOGW("Bad string block: integer overflow finding styles\n"); + ALOGW("Bad string block: integer overflow finding styles\n"); return (mError=BAD_TYPE); } if (((const uint8_t*)mEntryStyles-(const uint8_t*)mHeader) > (int)size) { - LOGW("Bad string block: entry of %d styles extends past data size %d\n", + ALOGW("Bad string block: entry of %d styles extends past data size %d\n", (int)((const uint8_t*)mEntryStyles-(const uint8_t*)mHeader), (int)size); return (mError=BAD_TYPE); @@ -462,7 +462,7 @@ status_t ResStringPool::setTo(const void* data, size_t size, bool copyData) mStyles = (const uint32_t*) (((const uint8_t*)data)+mHeader->stylesStart); if (mHeader->stylesStart >= mHeader->header.size) { - LOGW("Bad string block: style pool starts %d, after total size %d\n", + ALOGW("Bad string block: style pool starts %d, after total size %d\n", (int)mHeader->stylesStart, (int)mHeader->header.size); return (mError=BAD_TYPE); } @@ -487,7 +487,7 @@ status_t ResStringPool::setTo(const void* data, size_t size, bool copyData) }; if (memcmp(&mStyles[mStylePoolSize-(sizeof(endSpan)/sizeof(uint32_t))], &endSpan, sizeof(endSpan)) != 0) { - LOGW("Bad string block: last style is not 0xFFFFFFFF-terminated\n"); + ALOGW("Bad string block: last style is not 0xFFFFFFFF-terminated\n"); return (mError=BAD_TYPE); } } else { @@ -581,7 +581,7 @@ const uint16_t* ResStringPool::stringAt(size_t idx, size_t* u16len) const if ((uint32_t)(str+*u16len-strings) < mStringPoolSize) { return str; } else { - LOGW("Bad string block: string #%d extends to %d, past end at %d\n", + ALOGW("Bad string block: string #%d extends to %d, past end at %d\n", (int)idx, (int)(str+*u16len-strings), (int)mStringPoolSize); } } else { @@ -601,7 +601,7 @@ const uint16_t* ResStringPool::stringAt(size_t idx, size_t* u16len) const ssize_t actualLen = utf8_to_utf16_length(u8str, u8len); if (actualLen < 0 || (size_t)actualLen != *u16len) { - LOGW("Bad string block: string #%lld decoded length is not correct " + ALOGW("Bad string block: string #%lld decoded length is not correct " "%lld vs %llu\n", (long long)idx, (long long)actualLen, (long long)*u16len); return NULL; @@ -609,7 +609,7 @@ const uint16_t* ResStringPool::stringAt(size_t idx, size_t* u16len) const char16_t *u16str = (char16_t *)calloc(*u16len+1, sizeof(char16_t)); if (!u16str) { - LOGW("No memory when trying to allocate decode cache for string #%d\n", + ALOGW("No memory when trying to allocate decode cache for string #%d\n", (int)idx); return NULL; } @@ -618,13 +618,13 @@ const uint16_t* ResStringPool::stringAt(size_t idx, size_t* u16len) const mCache[idx] = u16str; return u16str; } else { - LOGW("Bad string block: string #%lld extends to %lld, past end at %lld\n", + ALOGW("Bad string block: string #%lld extends to %lld, past end at %lld\n", (long long)idx, (long long)(u8str+u8len-strings), (long long)mStringPoolSize); } } } else { - LOGW("Bad string block: string #%d entry is at %d, past end at %d\n", + ALOGW("Bad string block: string #%d entry is at %d, past end at %d\n", (int)idx, (int)(off*sizeof(uint16_t)), (int)(mStringPoolSize*sizeof(uint16_t))); } @@ -646,12 +646,12 @@ const char* ResStringPool::string8At(size_t idx, size_t* outLen) const if ((uint32_t)(str+encLen-strings) < mStringPoolSize) { return (const char*)str; } else { - LOGW("Bad string block: string #%d extends to %d, past end at %d\n", + ALOGW("Bad string block: string #%d extends to %d, past end at %d\n", (int)idx, (int)(str+encLen-strings), (int)mStringPoolSize); } } } else { - LOGW("Bad string block: string #%d entry is at %d, past end at %d\n", + ALOGW("Bad string block: string #%d entry is at %d, past end at %d\n", (int)idx, (int)(off*sizeof(uint16_t)), (int)(mStringPoolSize*sizeof(uint16_t))); } @@ -671,7 +671,7 @@ const ResStringPool_span* ResStringPool::styleAt(size_t idx) const if (off < mStylePoolSize) { return (const ResStringPool_span*)(mStyles+off); } else { - LOGW("Bad string block: style #%d entry is at %d, past end at %d\n", + ALOGW("Bad string block: style #%d entry is at %d, past end at %d\n", (int)idx, (int)(off*sizeof(uint32_t)), (int)(mStylePoolSize*sizeof(uint32_t))); } @@ -1087,7 +1087,7 @@ ResXMLParser::event_code_t ResXMLParser::nextNode() do { const ResXMLTree_node* next = (const ResXMLTree_node*) (((const uint8_t*)mCurNode) + dtohl(mCurNode->header.size)); - //LOGW("Next node: prev=%p, next=%p\n", mCurNode, next); + //ALOGW("Next node: prev=%p, next=%p\n", mCurNode, next); if (((const uint8_t*)next) >= mTree.mDataEnd) { mCurNode = NULL; @@ -1120,14 +1120,14 @@ ResXMLParser::event_code_t ResXMLParser::nextNode() minExtSize = sizeof(ResXMLTree_cdataExt); break; default: - LOGW("Unknown XML block: header type %d in node at %d\n", + ALOGW("Unknown XML block: header type %d in node at %d\n", (int)dtohs(next->header.type), (int)(((const uint8_t*)next)-((const uint8_t*)mTree.mHeader))); continue; } if ((totalSize-headerSize) < minExtSize) { - LOGW("Bad XML block: header type 0x%x in node at 0x%x has size %d, need %d\n", + ALOGW("Bad XML block: header type 0x%x in node at 0x%x has size %d, need %d\n", (int)dtohs(next->header.type), (int)(((const uint8_t*)next)-((const uint8_t*)mTree.mHeader)), (int)(totalSize-headerSize), (int)minExtSize); @@ -1164,7 +1164,7 @@ ResXMLTree::ResXMLTree() : ResXMLParser(*this) , mError(NO_INIT), mOwnedData(NULL) { - //LOGI("Creating ResXMLTree %p #%d\n", this, android_atomic_inc(&gCount)+1); + //ALOGI("Creating ResXMLTree %p #%d\n", this, android_atomic_inc(&gCount)+1); restart(); } @@ -1172,13 +1172,13 @@ ResXMLTree::ResXMLTree(const void* data, size_t size, bool copyData) : ResXMLParser(*this) , mError(NO_INIT), mOwnedData(NULL) { - //LOGI("Creating ResXMLTree %p #%d\n", this, android_atomic_inc(&gCount)+1); + //ALOGI("Creating ResXMLTree %p #%d\n", this, android_atomic_inc(&gCount)+1); setTo(data, size, copyData); } ResXMLTree::~ResXMLTree() { - //LOGI("Destroying ResXMLTree in %p #%d\n", this, android_atomic_dec(&gCount)-1); + //ALOGI("Destroying ResXMLTree in %p #%d\n", this, android_atomic_dec(&gCount)-1); uninit(); } @@ -1199,7 +1199,7 @@ status_t ResXMLTree::setTo(const void* data, size_t size, bool copyData) mHeader = (const ResXMLTree_header*)data; mSize = dtohl(mHeader->header.size); if (dtohs(mHeader->header.headerSize) > mSize || mSize > size) { - LOGW("Bad XML block: header size %d or total size %d is larger than data size %d\n", + ALOGW("Bad XML block: header size %d or total size %d is larger than data size %d\n", (int)dtohs(mHeader->header.headerSize), (int)dtohl(mHeader->header.size), (int)size); mError = BAD_TYPE; @@ -1259,7 +1259,7 @@ status_t ResXMLTree::setTo(const void* data, size_t size, bool copyData) } if (mRootNode == NULL) { - LOGW("Bad XML block: no root element node found\n"); + ALOGW("Bad XML block: no root element node found\n"); mError = BAD_TYPE; goto done; } @@ -1313,12 +1313,12 @@ status_t ResXMLTree::validateNode(const ResXMLTree_node* node) const if ((dtohs(attrExt->attributeStart)+attrSize) <= (size-headerSize)) { return NO_ERROR; } - LOGW("Bad XML block: node attributes use 0x%x bytes, only have 0x%x bytes\n", + ALOGW("Bad XML block: node attributes use 0x%x bytes, only have 0x%x bytes\n", (unsigned int)(dtohs(attrExt->attributeStart)+attrSize), (unsigned int)(size-headerSize)); } else { - LOGW("Bad XML start block: node header size 0x%x, size 0x%x\n", + ALOGW("Bad XML start block: node header size 0x%x, size 0x%x\n", (unsigned int)headerSize, (unsigned int)size); } return BAD_TYPE; @@ -1342,21 +1342,21 @@ status_t ResXMLTree::validateNode(const ResXMLTree_node* node) const <= (size-headerSize)) { return NO_ERROR; } - LOGW("Bad XML block: node attributes use 0x%x bytes, only have 0x%x bytes\n", + ALOGW("Bad XML block: node attributes use 0x%x bytes, only have 0x%x bytes\n", ((int)dtohs(node->attributeSize))*dtohs(node->attributeCount), (int)(size-headerSize)); return BAD_TYPE; } - LOGW("Bad XML block: node at 0x%x extends beyond data end 0x%x\n", + ALOGW("Bad XML block: node at 0x%x extends beyond data end 0x%x\n", (int)(((const uint8_t*)node)-((const uint8_t*)mHeader)), (int)mSize); return BAD_TYPE; } - LOGW("Bad XML block: node at 0x%x header size 0x%x smaller than total size 0x%x\n", + ALOGW("Bad XML block: node at 0x%x header size 0x%x smaller than total size 0x%x\n", (int)(((const uint8_t*)node)-((const uint8_t*)mHeader)), (int)headerSize, (int)size); return BAD_TYPE; } - LOGW("Bad XML block: node at 0x%x header size 0x%x too small\n", + ALOGW("Bad XML block: node at 0x%x header size 0x%x too small\n", (int)(((const uint8_t*)node)-((const uint8_t*)mHeader)), (int)headerSize); return BAD_TYPE; @@ -1574,7 +1574,7 @@ status_t ResTable::Theme::applyStyle(uint32_t resID, bool force) if (curPackage != p) { const ssize_t pidx = mTable.getResourcePackageIndex(attrRes); if (pidx < 0) { - LOGE("Style contains key with bad package: 0x%08x\n", attrRes); + ALOGE("Style contains key with bad package: 0x%08x\n", attrRes); bag++; continue; } @@ -1594,7 +1594,7 @@ status_t ResTable::Theme::applyStyle(uint32_t resID, bool force) } if (curType != t) { if (t >= curPI->numTypes) { - LOGE("Style contains key with bad type: 0x%08x\n", attrRes); + ALOGE("Style contains key with bad type: 0x%08x\n", attrRes); bag++; continue; } @@ -1612,7 +1612,7 @@ status_t ResTable::Theme::applyStyle(uint32_t resID, bool force) numEntries = curPI->types[t].numEntries; } if (e >= numEntries) { - LOGE("Style contains key with bad entry: 0x%08x\n", attrRes); + ALOGE("Style contains key with bad entry: 0x%08x\n", attrRes); bag++; continue; } @@ -1631,7 +1631,7 @@ status_t ResTable::Theme::applyStyle(uint32_t resID, bool force) mTable.unlock(); - //LOGI("Applying style 0x%08x (force=%d) theme %p...\n", resID, force, this); + //ALOGI("Applying style 0x%08x (force=%d) theme %p...\n", resID, force, this); //dumpToLog(); return NO_ERROR; @@ -1639,7 +1639,7 @@ status_t ResTable::Theme::applyStyle(uint32_t resID, bool force) status_t ResTable::Theme::setTo(const Theme& other) { - //LOGI("Setting theme %p from theme %p...\n", this, &other); + //ALOGI("Setting theme %p from theme %p...\n", this, &other); //dumpToLog(); //other.dumpToLog(); @@ -1670,7 +1670,7 @@ status_t ResTable::Theme::setTo(const Theme& other) } } - //LOGI("Final theme:"); + //ALOGI("Final theme:"); //dumpToLog(); return NO_ERROR; @@ -1712,7 +1712,7 @@ ssize_t ResTable::Theme::getAttribute(uint32_t resID, Res_value* outValue, resID = te.value.data; continue; } - LOGW("Too many attribute references, stopped at: 0x%08x\n", resID); + ALOGW("Too many attribute references, stopped at: 0x%08x\n", resID); return BAD_INDEX; } else if (type != Res_value::TYPE_NULL) { *outValue = te.value; @@ -1752,21 +1752,21 @@ ssize_t ResTable::Theme::resolveAttributeReference(Res_value* inOutValue, void ResTable::Theme::dumpToLog() const { - LOGI("Theme %p:\n", this); + ALOGI("Theme %p:\n", this); for (size_t i=0; i<Res_MAXPACKAGE; i++) { package_info* pi = mPackages[i]; if (pi == NULL) continue; - LOGI(" Package #0x%02x:\n", (int)(i+1)); + ALOGI(" Package #0x%02x:\n", (int)(i+1)); for (size_t j=0; j<pi->numTypes; j++) { type_info& ti = pi->types[j]; if (ti.numEntries == 0) continue; - LOGI(" Type #0x%02x:\n", (int)(j+1)); + ALOGI(" Type #0x%02x:\n", (int)(j+1)); for (size_t k=0; k<ti.numEntries; k++) { theme_entry& te = ti.entries[k]; if (te.value.dataType == Res_value::TYPE_NULL) continue; - LOGI(" 0x%08x: t=0x%x, d=0x%08x (block=%d)\n", + ALOGI(" 0x%08x: t=0x%x, d=0x%08x (block=%d)\n", (int)Res_MAKEID(i, j, k), te.value.dataType, (int)te.value.data, (int)te.stringBlock); } @@ -1779,7 +1779,7 @@ ResTable::ResTable() { memset(&mParams, 0, sizeof(mParams)); memset(mPackageMap, 0, sizeof(mPackageMap)); - //LOGI("Creating ResTable %p\n", this); + //ALOGI("Creating ResTable %p\n", this); } ResTable::ResTable(const void* data, size_t size, void* cookie, bool copyData) @@ -1789,12 +1789,12 @@ ResTable::ResTable(const void* data, size_t size, void* cookie, bool copyData) memset(mPackageMap, 0, sizeof(mPackageMap)); add(data, size, cookie, copyData); LOG_FATAL_IF(mError != NO_ERROR, "Error parsing resource table"); - //LOGI("Creating ResTable %p\n", this); + //ALOGI("Creating ResTable %p\n", this); } ResTable::~ResTable() { - //LOGI("Destroying ResTable in %p\n", this); + //ALOGI("Destroying ResTable in %p\n", this); uninit(); } @@ -1813,7 +1813,7 @@ status_t ResTable::add(Asset* asset, void* cookie, bool copyData, const void* id { const void* data = asset->getBuffer(true); if (data == NULL) { - LOGW("Unable to get buffer of resource asset file"); + ALOGW("Unable to get buffer of resource asset file"); return UNKNOWN_ERROR; } size_t size = (size_t)asset->getLength(); @@ -1867,7 +1867,7 @@ status_t ResTable::add(const void* data, size_t size, void* cookie, const bool notDeviceEndian = htods(0xf0) != 0xf0; LOAD_TABLE_NOISY( - LOGV("Adding resources to ResTable: data=%p, size=0x%x, cookie=%p, asset=%p, copy=%d " + ALOGV("Adding resources to ResTable: data=%p, size=0x%x, cookie=%p, asset=%p, copy=%d " "idmap=%p\n", data, size, cookie, asset, copyData, idmap)); if (copyData || notDeviceEndian) { @@ -1881,20 +1881,20 @@ status_t ResTable::add(const void* data, size_t size, void* cookie, header->header = (const ResTable_header*)data; header->size = dtohl(header->header->header.size); - //LOGI("Got size 0x%x, again size 0x%x, raw size 0x%x\n", header->size, + //ALOGI("Got size 0x%x, again size 0x%x, raw size 0x%x\n", header->size, // dtohl(header->header->header.size), header->header->header.size); LOAD_TABLE_NOISY(LOGV("Loading ResTable @%p:\n", header->header)); LOAD_TABLE_NOISY(printHexData(2, header->header, header->size < 256 ? header->size : 256, 16, 16, 0, false, printToLogFunc)); if (dtohs(header->header->header.headerSize) > header->size || header->size > size) { - LOGW("Bad resource table: header size 0x%x or total size 0x%x is larger than data size 0x%x\n", + ALOGW("Bad resource table: header size 0x%x or total size 0x%x is larger than data size 0x%x\n", (int)dtohs(header->header->header.headerSize), (int)header->size, (int)size); return (mError=BAD_TYPE); } if (((dtohs(header->header->header.headerSize)|header->size)&0x3) != 0) { - LOGW("Bad resource table: header size 0x%x or total size 0x%x is not on an integer boundary\n", + ALOGW("Bad resource table: header size 0x%x or total size 0x%x is not on an integer boundary\n", (int)dtohs(header->header->header.headerSize), (int)header->size); return (mError=BAD_TYPE); @@ -1927,11 +1927,11 @@ status_t ResTable::add(const void* data, size_t size, void* cookie, return (mError=err); } } else { - LOGW("Multiple string chunks found in resource table."); + ALOGW("Multiple string chunks found in resource table."); } } else if (ctype == RES_TABLE_PACKAGE_TYPE) { if (curPackage >= dtohl(header->header->packageCount)) { - LOGW("More package chunks were found than the %d declared in the header.", + ALOGW("More package chunks were found than the %d declared in the header.", dtohl(header->header->packageCount)); return (mError=BAD_TYPE); } @@ -1949,7 +1949,7 @@ status_t ResTable::add(const void* data, size_t size, void* cookie, } curPackage++; } else { - LOGW("Unknown chunk type %p in table at %p.\n", + ALOGW("Unknown chunk type %p in table at %p.\n", (void*)(int)(ctype), (void*)(((const uint8_t*)chunk) - ((const uint8_t*)header->header))); } @@ -1958,13 +1958,13 @@ status_t ResTable::add(const void* data, size_t size, void* cookie, } if (curPackage < dtohl(header->header->packageCount)) { - LOGW("Fewer package chunks (%d) were found than the %d declared in the header.", + ALOGW("Fewer package chunks (%d) were found than the %d declared in the header.", (int)curPackage, dtohl(header->header->packageCount)); return (mError=BAD_TYPE); } mError = header->values.getError(); if (mError != NO_ERROR) { - LOGW("No string values found in resource table!"); + ALOGW("No string values found in resource table!"); } TABLE_NOISY(LOGV("Returning from add with mError=%d\n", mError)); @@ -2011,20 +2011,20 @@ bool ResTable::getResourceName(uint32_t resID, resource_name* outName) const if (p < 0) { if (Res_GETPACKAGE(resID)+1 == 0) { - LOGW("No package identifier when getting name for resource number 0x%08x", resID); + ALOGW("No package identifier when getting name for resource number 0x%08x", resID); } else { - LOGW("No known package when getting name for resource number 0x%08x", resID); + ALOGW("No known package when getting name for resource number 0x%08x", resID); } return false; } if (t < 0) { - LOGW("No type identifier when getting name for resource number 0x%08x", resID); + ALOGW("No type identifier when getting name for resource number 0x%08x", resID); return false; } const PackageGroup* const grp = mPackageGroups[p]; if (grp == NULL) { - LOGW("Bad identifier when getting name for resource number 0x%08x", resID); + ALOGW("Bad identifier when getting name for resource number 0x%08x", resID); return false; } if (grp->packages.size() > 0) { @@ -2067,14 +2067,14 @@ ssize_t ResTable::getResource(uint32_t resID, Res_value* outValue, bool mayBeBag if (p < 0) { if (Res_GETPACKAGE(resID)+1 == 0) { - LOGW("No package identifier when getting value for resource number 0x%08x", resID); + ALOGW("No package identifier when getting value for resource number 0x%08x", resID); } else { - LOGW("No known package when getting value for resource number 0x%08x", resID); + ALOGW("No known package when getting value for resource number 0x%08x", resID); } return BAD_INDEX; } if (t < 0) { - LOGW("No type identifier when getting value for resource number 0x%08x", resID); + ALOGW("No type identifier when getting value for resource number 0x%08x", resID); return BAD_INDEX; } @@ -2089,7 +2089,7 @@ ssize_t ResTable::getResource(uint32_t resID, Res_value* outValue, bool mayBeBag // recently added. const PackageGroup* const grp = mPackageGroups[p]; if (grp == NULL) { - LOGW("Bad identifier when getting value for resource number 0x%08x", resID); + ALOGW("Bad identifier when getting value for resource number 0x%08x", resID); return BAD_INDEX; } @@ -2099,7 +2099,7 @@ ssize_t ResTable::getResource(uint32_t resID, Res_value* outValue, bool mayBeBag if (density > 0) { overrideConfig = (ResTable_config*) malloc(sizeof(ResTable_config)); if (overrideConfig == NULL) { - LOGE("Couldn't malloc ResTable_config for overrides: %s", strerror(errno)); + ALOGE("Couldn't malloc ResTable_config for overrides: %s", strerror(errno)); return BAD_INDEX; } memcpy(overrideConfig, &mParams, sizeof(ResTable_config)); @@ -2122,7 +2122,7 @@ ssize_t ResTable::getResource(uint32_t resID, Res_value* outValue, bool mayBeBag resID, &overlayResID); if (retval == NO_ERROR && overlayResID != 0x0) { // for this loop iteration, this is the type and entry we really want - LOGV("resource map 0x%08x -> 0x%08x\n", resID, overlayResID); + ALOGV("resource map 0x%08x -> 0x%08x\n", resID, overlayResID); T = Res_GETTYPE(overlayResID); E = Res_GETENTRY(overlayResID); } else { @@ -2141,7 +2141,7 @@ ssize_t ResTable::getResource(uint32_t resID, Res_value* outValue, bool mayBeBag // overlay package did not specify a default. // Non-overlay packages are still required to provide a default. if (offset < 0 && ip == 0) { - LOGW("Failure getting entry for 0x%08x (t=%d e=%d) in package %zd (error %d)\n", + ALOGW("Failure getting entry for 0x%08x (t=%d e=%d) in package %zd (error %d)\n", resID, T, E, ip, (int)offset); rc = offset; goto out; @@ -2151,7 +2151,7 @@ ssize_t ResTable::getResource(uint32_t resID, Res_value* outValue, bool mayBeBag if ((dtohs(entry->flags)&entry->FLAG_COMPLEX) != 0) { if (!mayBeBag) { - LOGW("Requesting resource %p failed because it is complex\n", + ALOGW("Requesting resource %p failed because it is complex\n", (void*)resID); } continue; @@ -2161,7 +2161,7 @@ ssize_t ResTable::getResource(uint32_t resID, Res_value* outValue, bool mayBeBag << HexDump(type, dtohl(type->header.size)) << endl); if ((size_t)offset > (dtohl(type->header.size)-sizeof(Res_value))) { - LOGW("ResTable_item at %d is beyond type chunk data %d", + ALOGW("ResTable_item at %d is beyond type chunk data %d", (int)offset, dtohl(type->header.size)); rc = BAD_TYPE; goto out; @@ -2307,23 +2307,23 @@ ssize_t ResTable::getBagLocked(uint32_t resID, const bag_entry** outBag, const int e = Res_GETENTRY(resID); if (p < 0) { - LOGW("Invalid package identifier when getting bag for resource number 0x%08x", resID); + ALOGW("Invalid package identifier when getting bag for resource number 0x%08x", resID); return BAD_INDEX; } if (t < 0) { - LOGW("No type identifier when getting bag for resource number 0x%08x", resID); + ALOGW("No type identifier when getting bag for resource number 0x%08x", resID); return BAD_INDEX; } //printf("Get bag: id=0x%08x, p=%d, t=%d\n", resID, p, t); PackageGroup* const grp = mPackageGroups[p]; if (grp == NULL) { - LOGW("Bad identifier when getting bag for resource number 0x%08x", resID); + ALOGW("Bad identifier when getting bag for resource number 0x%08x", resID); return false; } if (t >= (int)grp->typeCount) { - LOGW("Type identifier 0x%x is larger than type count 0x%x", + ALOGW("Type identifier 0x%x is larger than type count 0x%x", t+1, (int)grp->typeCount); return BAD_INDEX; } @@ -2334,7 +2334,7 @@ ssize_t ResTable::getBagLocked(uint32_t resID, const bag_entry** outBag, const size_t NENTRY = typeConfigs->entryCount; if (e >= (int)NENTRY) { - LOGW("Entry identifier 0x%x is larger than entry count 0x%x", + ALOGW("Entry identifier 0x%x is larger than entry count 0x%x", e, (int)typeConfigs->entryCount); return BAD_INDEX; } @@ -2350,10 +2350,10 @@ ssize_t ResTable::getBagLocked(uint32_t resID, const bag_entry** outBag, *outTypeSpecFlags = set->typeSpecFlags; } *outBag = (bag_entry*)(set+1); - //LOGI("Found existing bag for: %p\n", (void*)resID); + //ALOGI("Found existing bag for: %p\n", (void*)resID); return set->numAttrs; } - LOGW("Attempt to retrieve bag 0x%08x which is invalid or in a cycle.", + ALOGW("Attempt to retrieve bag 0x%08x which is invalid or in a cycle.", resID); return BAD_INDEX; } @@ -2401,7 +2401,7 @@ ssize_t ResTable::getBagLocked(uint32_t resID, const bag_entry** outBag, resID, &overlayResID); if (retval == NO_ERROR && overlayResID != 0x0) { // for this loop iteration, this is the type and entry we really want - LOGV("resource map 0x%08x -> 0x%08x\n", resID, overlayResID); + ALOGV("resource map 0x%08x -> 0x%08x\n", resID, overlayResID); T = Res_GETTYPE(overlayResID); E = Res_GETENTRY(overlayResID); } else { @@ -2413,9 +2413,9 @@ ssize_t ResTable::getBagLocked(uint32_t resID, const bag_entry** outBag, const ResTable_type* type; const ResTable_entry* entry; const Type* typeClass; - LOGV("Getting entry pkg=%p, t=%d, e=%d\n", package, T, E); + ALOGV("Getting entry pkg=%p, t=%d, e=%d\n", package, T, E); ssize_t offset = getEntry(package, T, E, &mParams, &type, &entry, &typeClass); - LOGV("Resulting offset=%d\n", offset); + ALOGV("Resulting offset=%d\n", offset); if (offset <= 0) { // No {entry, appropriate config} pair found in package. If this // package is an overlay package (ip != 0), this simply means the @@ -2429,7 +2429,7 @@ ssize_t ResTable::getBagLocked(uint32_t resID, const bag_entry** outBag, } if ((dtohs(entry->flags)&entry->FLAG_COMPLEX) == 0) { - LOGW("Skipping entry %p in package table %d because it is not complex!\n", + ALOGW("Skipping entry %p in package table %d because it is not complex!\n", (void*)resID, (int)ip); continue; } @@ -2505,7 +2505,7 @@ ssize_t ResTable::getBagLocked(uint32_t resID, const bag_entry** outBag, TABLE_NOISY(printf("Now at %p\n", (void*)curOff)); if ((size_t)curOff > (dtohl(type->header.size)-sizeof(ResTable_map))) { - LOGW("ResTable_map at %d is beyond type chunk data %d", + ALOGW("ResTable_map at %d is beyond type chunk data %d", (int)curOff, dtohl(type->header.size)); return BAD_TYPE; } @@ -2676,7 +2676,7 @@ nope: && name[6] == '_') { int index = atoi(String8(name + 7, nameLen - 7).string()); if (Res_CHECKID(index)) { - LOGW("Array resource index: %d is too large.", + ALOGW("Array resource index: %d is too large.", index); return 0; } @@ -2792,12 +2792,12 @@ nope: offset += typeOffset; if (offset > (dtohl(ty->header.size)-sizeof(ResTable_entry))) { - LOGW("ResTable_entry at %d is beyond type chunk data %d", + ALOGW("ResTable_entry at %d is beyond type chunk data %d", offset, dtohl(ty->header.size)); return 0; } if ((offset&0x3) != 0) { - LOGW("ResTable_entry at %d (pkg=%d type=%d ent=%d) is not on an integer boundary when looking for %s:%s/%s", + ALOGW("ResTable_entry at %d (pkg=%d type=%d ent=%d) is not on an integer boundary when looking for %s:%s/%s", (int)offset, (int)group->id, (int)ti+1, (int)i, String8(package, packageLen).string(), String8(type, typeLen).string(), @@ -2808,7 +2808,7 @@ nope: const ResTable_entry* const entry = (const ResTable_entry*) (((const uint8_t*)ty) + offset); if (dtohs(entry->size) < sizeof(*entry)) { - LOGW("ResTable_entry size %d is too small", dtohs(entry->size)); + ALOGW("ResTable_entry size %d is too small", dtohs(entry->size)); return BAD_TYPE; } @@ -3898,9 +3898,9 @@ void ResTable::getConfigurations(Vector<ResTable_config>* configs) const void ResTable::getLocales(Vector<String8>* locales) const { Vector<ResTable_config> configs; - LOGV("calling getConfigurations"); + ALOGV("calling getConfigurations"); getConfigurations(&configs); - LOGV("called getConfigurations size=%d", (int)configs.size()); + ALOGV("called getConfigurations size=%d", (int)configs.size()); const size_t I = configs.size(); for (size_t i=0; i<I; i++) { char locale[6]; @@ -3924,18 +3924,18 @@ ssize_t ResTable::getEntry( const ResTable_type** outType, const ResTable_entry** outEntry, const Type** outTypeClass) const { - LOGV("Getting entry from package %p\n", package); + ALOGV("Getting entry from package %p\n", package); const ResTable_package* const pkg = package->package; const Type* allTypes = package->getType(typeIndex); - LOGV("allTypes=%p\n", allTypes); + ALOGV("allTypes=%p\n", allTypes); if (allTypes == NULL) { - LOGV("Skipping entry type index 0x%02x because type is NULL!\n", typeIndex); + ALOGV("Skipping entry type index 0x%02x because type is NULL!\n", typeIndex); return 0; } if ((size_t)entryIndex >= allTypes->entryCount) { - LOGW("getEntry failing because entryIndex %d is beyond type entryCount %d", + ALOGW("getEntry failing because entryIndex %d is beyond type entryCount %d", entryIndex, (int)allTypes->entryCount); return BAD_TYPE; } @@ -4039,12 +4039,12 @@ ssize_t ResTable::getEntry( << ", offset=" << (void*)offset << endl); if (offset > (dtohl(type->header.size)-sizeof(ResTable_entry))) { - LOGW("ResTable_entry at 0x%x is beyond type chunk data 0x%x", + ALOGW("ResTable_entry at 0x%x is beyond type chunk data 0x%x", offset, dtohl(type->header.size)); return BAD_TYPE; } if ((offset&0x3) != 0) { - LOGW("ResTable_entry at 0x%x is not on an integer boundary", + ALOGW("ResTable_entry at 0x%x is not on an integer boundary", offset); return BAD_TYPE; } @@ -4052,7 +4052,7 @@ ssize_t ResTable::getEntry( const ResTable_entry* const entry = (const ResTable_entry*) (((const uint8_t*)type) + offset); if (dtohs(entry->size) < sizeof(*entry)) { - LOGW("ResTable_entry size 0x%x is too small", dtohs(entry->size)); + ALOGW("ResTable_entry size 0x%x is too small", dtohs(entry->size)); return BAD_TYPE; } @@ -4077,22 +4077,22 @@ status_t ResTable::parsePackage(const ResTable_package* const pkg, const size_t pkgSize = dtohl(pkg->header.size); if (dtohl(pkg->typeStrings) >= pkgSize) { - LOGW("ResTable_package type strings at %p are past chunk size %p.", + ALOGW("ResTable_package type strings at %p are past chunk size %p.", (void*)dtohl(pkg->typeStrings), (void*)pkgSize); return (mError=BAD_TYPE); } if ((dtohl(pkg->typeStrings)&0x3) != 0) { - LOGW("ResTable_package type strings at %p is not on an integer boundary.", + ALOGW("ResTable_package type strings at %p is not on an integer boundary.", (void*)dtohl(pkg->typeStrings)); return (mError=BAD_TYPE); } if (dtohl(pkg->keyStrings) >= pkgSize) { - LOGW("ResTable_package key strings at %p are past chunk size %p.", + ALOGW("ResTable_package key strings at %p are past chunk size %p.", (void*)dtohl(pkg->keyStrings), (void*)pkgSize); return (mError=BAD_TYPE); } if ((dtohl(pkg->keyStrings)&0x3) != 0) { - LOGW("ResTable_package key strings at %p is not on an integer boundary.", + ALOGW("ResTable_package key strings at %p is not on an integer boundary.", (void*)dtohl(pkg->keyStrings)); return (mError=BAD_TYPE); } @@ -4195,7 +4195,7 @@ status_t ResTable::parsePackage(const ResTable_package* const pkg, if ((dtohl(typeSpec->entryCount) > (INT32_MAX/sizeof(uint32_t)) || dtohs(typeSpec->header.headerSize)+(sizeof(uint32_t)*dtohl(typeSpec->entryCount)) > typeSpecSize)) { - LOGW("ResTable_typeSpec entry index to %p extends beyond chunk end %p.", + ALOGW("ResTable_typeSpec entry index to %p extends beyond chunk end %p.", (void*)(dtohs(typeSpec->header.headerSize) +(sizeof(uint32_t)*dtohl(typeSpec->entryCount))), (void*)typeSpecSize); @@ -4203,7 +4203,7 @@ status_t ResTable::parsePackage(const ResTable_package* const pkg, } if (typeSpec->id == 0) { - LOGW("ResTable_type has an id of 0."); + ALOGW("ResTable_type has an id of 0."); return (mError=BAD_TYPE); } @@ -4215,7 +4215,7 @@ status_t ResTable::parsePackage(const ResTable_package* const pkg, t = new Type(header, package, dtohl(typeSpec->entryCount)); package->types.editItemAt(typeSpec->id-1) = t; } else if (dtohl(typeSpec->entryCount) != t->entryCount) { - LOGW("ResTable_typeSpec entry count inconsistent: given %d, previously %d", + ALOGW("ResTable_typeSpec entry count inconsistent: given %d, previously %d", (int)dtohl(typeSpec->entryCount), (int)t->entryCount); return (mError=BAD_TYPE); } @@ -4240,7 +4240,7 @@ status_t ResTable::parsePackage(const ResTable_package* const pkg, (void*)typeSize)); if (dtohs(type->header.headerSize)+(sizeof(uint32_t)*dtohl(type->entryCount)) > typeSize) { - LOGW("ResTable_type entry index to %p extends beyond chunk end %p.", + ALOGW("ResTable_type entry index to %p extends beyond chunk end %p.", (void*)(dtohs(type->header.headerSize) +(sizeof(uint32_t)*dtohl(type->entryCount))), (void*)typeSize); @@ -4248,12 +4248,12 @@ status_t ResTable::parsePackage(const ResTable_package* const pkg, } if (dtohl(type->entryCount) != 0 && dtohl(type->entriesStart) > (typeSize-sizeof(ResTable_entry))) { - LOGW("ResTable_type entriesStart at %p extends beyond chunk end %p.", + ALOGW("ResTable_type entriesStart at %p extends beyond chunk end %p.", (void*)dtohl(type->entriesStart), (void*)typeSize); return (mError=BAD_TYPE); } if (type->id == 0) { - LOGW("ResTable_type has an id of 0."); + ALOGW("ResTable_type has an id of 0."); return (mError=BAD_TYPE); } @@ -4265,7 +4265,7 @@ status_t ResTable::parsePackage(const ResTable_package* const pkg, t = new Type(header, package, dtohl(type->entryCount)); package->types.editItemAt(type->id-1) = t; } else if (dtohl(type->entryCount) != t->entryCount) { - LOGW("ResTable_type entry count inconsistent: given %d, previously %d", + ALOGW("ResTable_type entry count inconsistent: given %d, previously %d", (int)dtohl(type->entryCount), (int)t->entryCount); return (mError=BAD_TYPE); } @@ -4273,7 +4273,7 @@ status_t ResTable::parsePackage(const ResTable_package* const pkg, TABLE_GETENTRY( ResTable_config thisConfig; thisConfig.copyFromDtoH(type->config); - LOGI("Adding config to type %d: imsi:%d/%d lang:%c%c cnt:%c%c " + ALOGI("Adding config to type %d: imsi:%d/%d lang:%c%c cnt:%c%c " "orien:%d touch:%d density:%d key:%d inp:%d nav:%d w:%d h:%d " "swdp:%d wdp:%d hdp:%d\n", type->id, @@ -4346,7 +4346,7 @@ status_t ResTable::createIdmap(const ResTable& overlay, uint32_t originalCrc, ui | (0x0000ffff & (entryIndex)); resource_name resName; if (!this->getResourceName(resID, &resName)) { - LOGW("idmap: resource 0x%08x has spec but lacks values, skipping\n", resID); + ALOGW("idmap: resource 0x%08x has spec but lacks values, skipping\n", resID); continue; } @@ -4368,7 +4368,7 @@ status_t ResTable::createIdmap(const ResTable& overlay, uint32_t originalCrc, ui } #if 0 if (overlayResID != 0) { - LOGD("%s/%s 0x%08x -> 0x%08x\n", + ALOGD("%s/%s 0x%08x -> 0x%08x\n", String8(String16(resName.type)).string(), String8(String16(resName.name)).string(), resID, overlayResID); diff --git a/libs/utils/Static.cpp b/libs/utils/Static.cpp index ceca435..bfcb2da 100644 --- a/libs/utils/Static.cpp +++ b/libs/utils/Static.cpp @@ -57,8 +57,8 @@ protected: virtual status_t writeLines(const struct iovec& vec, size_t N) { //android_writevLog(&vec, N); <-- this is now a no-op - if (N != 1) LOGI("WARNING: writeLines N=%d\n", N); - LOGI("%.*s", vec.iov_len, (const char*) vec.iov_base); + if (N != 1) ALOGI("WARNING: writeLines N=%d\n", N); + ALOGI("%.*s", vec.iov_len, (const char*) vec.iov_base); return NO_ERROR; } }; diff --git a/libs/utils/StopWatch.cpp b/libs/utils/StopWatch.cpp index b5dda2f..595aec3 100644 --- a/libs/utils/StopWatch.cpp +++ b/libs/utils/StopWatch.cpp @@ -39,11 +39,11 @@ StopWatch::~StopWatch() { nsecs_t elapsed = elapsedTime(); const int n = mNumLaps; - LOGD("StopWatch %s (us): %lld ", mName, ns2us(elapsed)); + ALOGD("StopWatch %s (us): %lld ", mName, ns2us(elapsed)); for (int i=0 ; i<n ; i++) { const nsecs_t soFar = mLaps[i].soFar; const nsecs_t thisLap = mLaps[i].thisLap; - LOGD(" [%d: %lld, %lld]", i, ns2us(soFar), ns2us(thisLap)); + ALOGD(" [%d: %lld, %lld]", i, ns2us(soFar), ns2us(thisLap)); } } diff --git a/libs/utils/StreamingZipInflater.cpp b/libs/utils/StreamingZipInflater.cpp index 00498bd..8512170 100644 --- a/libs/utils/StreamingZipInflater.cpp +++ b/libs/utils/StreamingZipInflater.cpp @@ -77,7 +77,7 @@ StreamingZipInflater::~StreamingZipInflater() { } void StreamingZipInflater::initInflateState() { - LOGV("Initializing inflate state"); + ALOGV("Initializing inflate state"); memset(&mInflateState, 0, sizeof(mInflateState)); mInflateState.zalloc = Z_NULL; @@ -138,7 +138,7 @@ ssize_t StreamingZipInflater::read(void* outBuf, size_t count) { if (mInflateState.avail_in == 0) { int err = readNextChunk(); if (err < 0) { - LOGE("Unable to access asset data: %d", err); + ALOGE("Unable to access asset data: %d", err); if (!mStreamNeedsInit) { ::inflateEnd(&mInflateState); initInflateState(); @@ -152,20 +152,20 @@ ssize_t StreamingZipInflater::read(void* outBuf, size_t count) { mInflateState.avail_out = mOutBufSize; /* - LOGV("Inflating to outbuf: avail_in=%u avail_out=%u next_in=%p next_out=%p", + ALOGV("Inflating to outbuf: avail_in=%u avail_out=%u next_in=%p next_out=%p", mInflateState.avail_in, mInflateState.avail_out, mInflateState.next_in, mInflateState.next_out); */ int result = Z_OK; if (mStreamNeedsInit) { - LOGV("Initializing zlib to inflate"); + ALOGV("Initializing zlib to inflate"); result = inflateInit2(&mInflateState, -MAX_WBITS); mStreamNeedsInit = false; } if (result == Z_OK) result = ::inflate(&mInflateState, Z_SYNC_FLUSH); if (result < 0) { // Whoops, inflation failed - LOGE("Error inflating asset: %d", result); + ALOGE("Error inflating asset: %d", result); ::inflateEnd(&mInflateState); initInflateState(); return -1; @@ -192,10 +192,10 @@ int StreamingZipInflater::readNextChunk() { size_t toRead = min_of(mInBufSize, mInTotalSize - mInNextChunkOffset); if (toRead > 0) { ssize_t didRead = ::read(mFd, mInBuf, toRead); - //LOGV("Reading input chunk, size %08x didread %08x", toRead, didRead); + //ALOGV("Reading input chunk, size %08x didread %08x", toRead, didRead); if (didRead < 0) { // TODO: error - LOGE("Error reading asset data"); + ALOGE("Error reading asset data"); return didRead; } else { mInNextChunkOffset += didRead; diff --git a/libs/utils/String16.cpp b/libs/utils/String16.cpp index 4ce1664..94e072f 100644 --- a/libs/utils/String16.cpp +++ b/libs/utils/String16.cpp @@ -112,7 +112,7 @@ String16::String16(const char16_t* o) { size_t len = strlen16(o); SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t)); - LOG_ASSERT(buf, "Unable to allocate shared buffer"); + ALOG_ASSERT(buf, "Unable to allocate shared buffer"); if (buf) { char16_t* str = (char16_t*)buf->data(); strcpy16(str, o); @@ -126,7 +126,7 @@ String16::String16(const char16_t* o) String16::String16(const char16_t* o, size_t len) { SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t)); - LOG_ASSERT(buf, "Unable to allocate shared buffer"); + ALOG_ASSERT(buf, "Unable to allocate shared buffer"); if (buf) { char16_t* str = (char16_t*)buf->data(); memcpy(str, o, len*sizeof(char16_t)); diff --git a/libs/utils/String8.cpp b/libs/utils/String8.cpp index 0bc5aff..562f026 100644 --- a/libs/utils/String8.cpp +++ b/libs/utils/String8.cpp @@ -80,7 +80,7 @@ static char* allocFromUTF8(const char* in, size_t len) { if (len > 0) { SharedBuffer* buf = SharedBuffer::alloc(len+1); - LOG_ASSERT(buf, "Unable to allocate shared buffer"); + ALOG_ASSERT(buf, "Unable to allocate shared buffer"); if (buf) { char* str = (char*)buf->data(); memcpy(str, in, len); @@ -103,7 +103,7 @@ static char* allocFromUTF16(const char16_t* in, size_t len) } SharedBuffer* buf = SharedBuffer::alloc(bytes+1); - LOG_ASSERT(buf, "Unable to allocate shared buffer"); + ALOG_ASSERT(buf, "Unable to allocate shared buffer"); if (!buf) { return getEmptyString(); } @@ -125,7 +125,7 @@ static char* allocFromUTF32(const char32_t* in, size_t len) } SharedBuffer* buf = SharedBuffer::alloc(bytes+1); - LOG_ASSERT(buf, "Unable to allocate shared buffer"); + ALOG_ASSERT(buf, "Unable to allocate shared buffer"); if (!buf) { return getEmptyString(); } diff --git a/libs/utils/SystemClock.cpp b/libs/utils/SystemClock.cpp index 062e6d7..8b8ac10 100644 --- a/libs/utils/SystemClock.cpp +++ b/libs/utils/SystemClock.cpp @@ -64,25 +64,25 @@ int setCurrentTimeMillis(int64_t millis) tv.tv_sec = (time_t) (millis / 1000LL); tv.tv_usec = (suseconds_t) ((millis % 1000LL) * 1000LL); - LOGD("Setting time of day to sec=%d\n", (int) tv.tv_sec); + ALOGD("Setting time of day to sec=%d\n", (int) tv.tv_sec); #ifdef HAVE_ANDROID_OS fd = open("/dev/alarm", O_RDWR); if(fd < 0) { - LOGW("Unable to open alarm driver: %s\n", strerror(errno)); + ALOGW("Unable to open alarm driver: %s\n", strerror(errno)); return -1; } ts.tv_sec = tv.tv_sec; ts.tv_nsec = tv.tv_usec * 1000; res = ioctl(fd, ANDROID_ALARM_SET_RTC, &ts); if(res < 0) { - LOGW("Unable to set rtc to %ld: %s\n", tv.tv_sec, strerror(errno)); + ALOGW("Unable to set rtc to %ld: %s\n", tv.tv_sec, strerror(errno)); ret = -1; } close(fd); #else if (settimeofday(&tv, NULL) != 0) { - LOGW("Unable to set clock to %d.%d: %s\n", + ALOGW("Unable to set clock to %d.%d: %s\n", (int) tv.tv_sec, (int) tv.tv_usec, strerror(errno)); ret = -1; } diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp index 5dbcb75..e343c62 100644 --- a/libs/utils/Threads.cpp +++ b/libs/utils/Threads.cpp @@ -163,7 +163,7 @@ int androidCreateRawThreadEtc(android_thread_func_t entryFunction, (android_pthread_entry)entryFunction, userData); pthread_attr_destroy(&attr); if (result != 0) { - LOGE("androidCreateRawThreadEtc failed (entry=%p, res=%d, errno=%d)\n" + ALOGE("androidCreateRawThreadEtc failed (entry=%p, res=%d, errno=%d)\n" "(android threadPriority=%d)", entryFunction, result, errno, threadPriority); return 0; @@ -205,7 +205,7 @@ static __stdcall unsigned int threadIntermediary(void* vDetails) delete pDetails; - LOG(LOG_VERBOSE, "thread", "thread exiting\n"); + ALOG(LOG_VERBOSE, "thread", "thread exiting\n"); return (unsigned int) result; } @@ -232,7 +232,7 @@ static bool doCreateThread(android_thread_func_t fn, void* arg, android_thread_i if (hThread == NULL) #endif { - LOG(LOG_WARN, "thread", "WARNING: thread create failed\n"); + ALOG(LOG_WARN, "thread", "WARNING: thread create failed\n"); return false; } @@ -470,7 +470,7 @@ status_t Mutex::lock() void Mutex::unlock() { if (!ReleaseMutex((HANDLE) mState)) - LOG(LOG_WARN, "thread", "WARNING: bad result from unlocking mutex\n"); + ALOG(LOG_WARN, "thread", "WARNING: bad result from unlocking mutex\n"); } status_t Mutex::tryLock() @@ -479,7 +479,7 @@ status_t Mutex::tryLock() dwWaitResult = WaitForSingleObject((HANDLE) mState, 0); if (dwWaitResult != WAIT_OBJECT_0 && dwWaitResult != WAIT_TIMEOUT) - LOG(LOG_WARN, "thread", "WARNING: bad result from try-locking mutex\n"); + ALOG(LOG_WARN, "thread", "WARNING: bad result from try-locking mutex\n"); return (dwWaitResult == WAIT_OBJECT_0) ? 0 : -1; } @@ -870,7 +870,7 @@ status_t Thread::requestExitAndWait() { Mutex::Autolock _l(mLock); if (mThread == getThreadId()) { - LOGW( + ALOGW( "Thread (this=%p): don't call waitForExit() from this " "Thread object's thread. It's a guaranteed deadlock!", this); @@ -894,7 +894,7 @@ status_t Thread::join() { Mutex::Autolock _l(mLock); if (mThread == getThreadId()) { - LOGW( + ALOGW( "Thread (this=%p): don't call join() from this " "Thread object's thread. It's a guaranteed deadlock!", this); diff --git a/libs/utils/Timers.cpp b/libs/utils/Timers.cpp index 64a29f5..64b4701 100644 --- a/libs/utils/Timers.cpp +++ b/libs/utils/Timers.cpp @@ -113,7 +113,7 @@ long long DurationTimer::durationUsecs(void) const /*static*/ void DurationTimer::addToTimeval(struct timeval* ptv, long usec) { if (usec < 0) { - LOG(LOG_WARN, "", "Negative values not supported in addToTimeval\n"); + ALOG(LOG_WARN, "", "Negative values not supported in addToTimeval\n"); return; } diff --git a/libs/utils/Tokenizer.cpp b/libs/utils/Tokenizer.cpp index b3445b7..efda2bf 100644 --- a/libs/utils/Tokenizer.cpp +++ b/libs/utils/Tokenizer.cpp @@ -55,12 +55,12 @@ status_t Tokenizer::open(const String8& filename, Tokenizer** outTokenizer) { int fd = ::open(filename.string(), O_RDONLY); if (fd < 0) { result = -errno; - LOGE("Error opening file '%s', %s.", filename.string(), strerror(errno)); + ALOGE("Error opening file '%s', %s.", filename.string(), strerror(errno)); } else { struct stat stat; if (fstat(fd, &stat)) { result = -errno; - LOGE("Error getting size of file '%s', %s.", filename.string(), strerror(errno)); + ALOGE("Error getting size of file '%s', %s.", filename.string(), strerror(errno)); } else { size_t length = size_t(stat.st_size); @@ -80,7 +80,7 @@ status_t Tokenizer::open(const String8& filename, Tokenizer** outTokenizer) { ssize_t nrd = read(fd, buffer, length); if (nrd < 0) { result = -errno; - LOGE("Error reading file '%s', %s.", filename.string(), strerror(errno)); + ALOGE("Error reading file '%s', %s.", filename.string(), strerror(errno)); delete[] buffer; buffer = NULL; } else { @@ -118,7 +118,7 @@ String8 Tokenizer::peekRemainderOfLine() const { String8 Tokenizer::nextToken(const char* delimiters) { #if DEBUG_TOKENIZER - LOGD("nextToken"); + ALOGD("nextToken"); #endif const char* end = getEnd(); const char* tokenStart = mCurrent; @@ -134,7 +134,7 @@ String8 Tokenizer::nextToken(const char* delimiters) { void Tokenizer::nextLine() { #if DEBUG_TOKENIZER - LOGD("nextLine"); + ALOGD("nextLine"); #endif const char* end = getEnd(); while (mCurrent != end) { @@ -148,7 +148,7 @@ void Tokenizer::nextLine() { void Tokenizer::skipDelimiters(const char* delimiters) { #if DEBUG_TOKENIZER - LOGD("skipDelimiters"); + ALOGD("skipDelimiters"); #endif const char* end = getEnd(); while (mCurrent != end) { diff --git a/libs/utils/VectorImpl.cpp b/libs/utils/VectorImpl.cpp index bfb37a6..220ae3e 100644 --- a/libs/utils/VectorImpl.cpp +++ b/libs/utils/VectorImpl.cpp @@ -56,7 +56,7 @@ VectorImpl::VectorImpl(const VectorImpl& rhs) VectorImpl::~VectorImpl() { - LOG_ASSERT(!mCount, + ALOG_ASSERT(!mCount, "[%p] " "subclasses of VectorImpl must call finish_vector()" " in their destructor. Leaking %d bytes.", @@ -66,7 +66,7 @@ VectorImpl::~VectorImpl() VectorImpl& VectorImpl::operator = (const VectorImpl& rhs) { - LOG_ASSERT(mItemSize == rhs.mItemSize, + ALOG_ASSERT(mItemSize == rhs.mItemSize, "Vector<> have different types (this=%p, rhs=%p)", this, &rhs); if (this != &rhs) { release_storage(); @@ -248,7 +248,7 @@ ssize_t VectorImpl::replaceAt(size_t index) ssize_t VectorImpl::replaceAt(const void* prototype, size_t index) { - LOG_ASSERT(index<size(), + ALOG_ASSERT(index<size(), "[%p] replace: index=%d, size=%d", this, (int)index, (int)size()); void* item = editItemLocation(index); @@ -267,7 +267,7 @@ ssize_t VectorImpl::replaceAt(const void* prototype, size_t index) ssize_t VectorImpl::removeItemsAt(size_t index, size_t count) { - LOG_ASSERT((index+count)<=size(), + ALOG_ASSERT((index+count)<=size(), "[%p] remove: index=%d, count=%d, size=%d", this, (int)index, (int)count, (int)size()); @@ -291,7 +291,7 @@ void VectorImpl::clear() void* VectorImpl::editItemLocation(size_t index) { - LOG_ASSERT(index<capacity(), + ALOG_ASSERT(index<capacity(), "[%p] editItemLocation: index=%d, capacity=%d, count=%d", this, (int)index, (int)capacity(), (int)mCount); @@ -303,7 +303,7 @@ void* VectorImpl::editItemLocation(size_t index) const void* VectorImpl::itemLocation(size_t index) const { - LOG_ASSERT(index<capacity(), + ALOG_ASSERT(index<capacity(), "[%p] itemLocation: index=%d, capacity=%d, count=%d", this, (int)index, (int)capacity(), (int)mCount); @@ -346,17 +346,17 @@ void VectorImpl::release_storage() void* VectorImpl::_grow(size_t where, size_t amount) { -// LOGV("_grow(this=%p, where=%d, amount=%d) count=%d, capacity=%d", +// ALOGV("_grow(this=%p, where=%d, amount=%d) count=%d, capacity=%d", // this, (int)where, (int)amount, (int)mCount, (int)capacity()); - LOG_ASSERT(where <= mCount, + ALOG_ASSERT(where <= mCount, "[%p] _grow: where=%d, amount=%d, count=%d", this, (int)where, (int)amount, (int)mCount); // caller already checked const size_t new_size = mCount + amount; if (capacity() < new_size) { const size_t new_capacity = max(kMinVectorCapacity, ((new_size*3)+1)/2); -// LOGV("grow vector %p, new_capacity=%d", this, (int)new_capacity); +// ALOGV("grow vector %p, new_capacity=%d", this, (int)new_capacity); if ((mStorage) && (mCount==where) && (mFlags & HAS_TRIVIAL_COPY) && @@ -399,17 +399,17 @@ void VectorImpl::_shrink(size_t where, size_t amount) if (!mStorage) return; -// LOGV("_shrink(this=%p, where=%d, amount=%d) count=%d, capacity=%d", +// ALOGV("_shrink(this=%p, where=%d, amount=%d) count=%d, capacity=%d", // this, (int)where, (int)amount, (int)mCount, (int)capacity()); - LOG_ASSERT(where + amount <= mCount, + ALOG_ASSERT(where + amount <= mCount, "[%p] _shrink: where=%d, amount=%d, count=%d", this, (int)where, (int)amount, (int)mCount); // caller already checked const size_t new_size = mCount - amount; if (new_size*3 < capacity()) { const size_t new_capacity = max(kMinVectorCapacity, new_size*2); -// LOGV("shrink vector %p, new_capacity=%d", this, (int)new_capacity); +// ALOGV("shrink vector %p, new_capacity=%d", this, (int)new_capacity); if ((where == new_size) && (mFlags & HAS_TRIVIAL_COPY) && (mFlags & HAS_TRIVIAL_DTOR)) diff --git a/libs/utils/ZipFileRO.cpp b/libs/utils/ZipFileRO.cpp index b18c383..1498aac 100644 --- a/libs/utils/ZipFileRO.cpp +++ b/libs/utils/ZipFileRO.cpp @@ -120,7 +120,7 @@ int ZipFileRO::entryToIndex(const ZipEntryRO entry) const { long ent = ((long) entry) - kZipEntryAdj; if (ent < 0 || ent >= mHashTableSize || mHashTable[ent].name == NULL) { - LOGW("Invalid ZipEntryRO %p (%ld)\n", entry, ent); + ALOGW("Invalid ZipEntryRO %p (%ld)\n", entry, ent); return -1; } return ent; @@ -142,7 +142,7 @@ status_t ZipFileRO::open(const char* zipFileName) */ fd = ::open(zipFileName, O_RDONLY | O_BINARY); if (fd < 0) { - LOGW("Unable to open zip '%s': %s\n", zipFileName, strerror(errno)); + ALOGW("Unable to open zip '%s': %s\n", zipFileName, strerror(errno)); return NAME_NOT_FOUND; } @@ -194,7 +194,7 @@ bool ZipFileRO::mapCentralDirectory(void) unsigned char* scanBuf = (unsigned char*) malloc(readAmount); if (scanBuf == NULL) { - LOGW("couldn't allocate scanBuf: %s", strerror(errno)); + ALOGW("couldn't allocate scanBuf: %s", strerror(errno)); free(scanBuf); return false; } @@ -203,14 +203,14 @@ bool ZipFileRO::mapCentralDirectory(void) * Make sure this is a Zip archive. */ if (lseek64(mFd, 0, SEEK_SET) != 0) { - LOGW("seek to start failed: %s", strerror(errno)); + ALOGW("seek to start failed: %s", strerror(errno)); free(scanBuf); return false; } ssize_t actual = TEMP_FAILURE_RETRY(read(mFd, scanBuf, sizeof(int32_t))); if (actual != (ssize_t) sizeof(int32_t)) { - LOGI("couldn't read first signature from zip archive: %s", strerror(errno)); + ALOGI("couldn't read first signature from zip archive: %s", strerror(errno)); free(scanBuf); return false; } @@ -218,11 +218,11 @@ bool ZipFileRO::mapCentralDirectory(void) { unsigned int header = get4LE(scanBuf); if (header == kEOCDSignature) { - LOGI("Found Zip archive, but it looks empty\n"); + ALOGI("Found Zip archive, but it looks empty\n"); free(scanBuf); return false; } else if (header != kLFHSignature) { - LOGV("Not a Zip archive (found 0x%08x)\n", header); + ALOGV("Not a Zip archive (found 0x%08x)\n", header); free(scanBuf); return false; } @@ -243,13 +243,13 @@ bool ZipFileRO::mapCentralDirectory(void) off64_t searchStart = mFileLength - readAmount; if (lseek64(mFd, searchStart, SEEK_SET) != searchStart) { - LOGW("seek %ld failed: %s\n", (long) searchStart, strerror(errno)); + ALOGW("seek %ld failed: %s\n", (long) searchStart, strerror(errno)); free(scanBuf); return false; } actual = TEMP_FAILURE_RETRY(read(mFd, scanBuf, readAmount)); if (actual != (ssize_t) readAmount) { - LOGW("Zip: read " ZD ", expected " ZD ". Failed: %s\n", + ALOGW("Zip: read " ZD ", expected " ZD ". Failed: %s\n", (ZD_TYPE) actual, (ZD_TYPE) readAmount, strerror(errno)); free(scanBuf); return false; @@ -264,12 +264,12 @@ bool ZipFileRO::mapCentralDirectory(void) int i; for (i = readAmount - kEOCDLen; i >= 0; i--) { if (scanBuf[i] == 0x50 && get4LE(&scanBuf[i]) == kEOCDSignature) { - LOGV("+++ Found EOCD at buf+%d\n", i); + ALOGV("+++ Found EOCD at buf+%d\n", i); break; } } if (i < 0) { - LOGD("Zip: EOCD not found, %s is not zip\n", mFileName); + ALOGD("Zip: EOCD not found, %s is not zip\n", mFileName); free(scanBuf); return false; } @@ -290,26 +290,26 @@ bool ZipFileRO::mapCentralDirectory(void) // Verify that they look reasonable. if ((long long) dirOffset + (long long) dirSize > (long long) eocdOffset) { - LOGW("bad offsets (dir %ld, size %u, eocd %ld)\n", + ALOGW("bad offsets (dir %ld, size %u, eocd %ld)\n", (long) dirOffset, dirSize, (long) eocdOffset); return false; } if (numEntries == 0) { - LOGW("empty archive?\n"); + ALOGW("empty archive?\n"); return false; } - LOGV("+++ numEntries=%d dirSize=%d dirOffset=%d\n", + ALOGV("+++ numEntries=%d dirSize=%d dirOffset=%d\n", numEntries, dirSize, dirOffset); mDirectoryMap = new FileMap(); if (mDirectoryMap == NULL) { - LOGW("Unable to create directory map: %s", strerror(errno)); + ALOGW("Unable to create directory map: %s", strerror(errno)); return false; } if (!mDirectoryMap->create(mFileName, mFd, dirOffset, dirSize, true)) { - LOGW("Unable to map '%s' (" ZD " to " ZD "): %s\n", mFileName, + ALOGW("Unable to map '%s' (" ZD " to " ZD "): %s\n", mFileName, (ZD_TYPE) dirOffset, (ZD_TYPE) (dirOffset + dirSize), strerror(errno)); return false; } @@ -341,17 +341,17 @@ bool ZipFileRO::parseZipArchive(void) const unsigned char* ptr = cdPtr; for (int i = 0; i < numEntries; i++) { if (get4LE(ptr) != kCDESignature) { - LOGW("Missed a central dir sig (at %d)\n", i); + ALOGW("Missed a central dir sig (at %d)\n", i); goto bail; } if (ptr + kCDELen > cdPtr + cdLength) { - LOGW("Ran off the end (at %d)\n", i); + ALOGW("Ran off the end (at %d)\n", i); goto bail; } long localHdrOffset = (long) get4LE(ptr + kCDELocalOffset); if (localHdrOffset >= mDirectoryOffset) { - LOGW("bad LFH offset %ld at entry %d\n", localHdrOffset, i); + ALOGW("bad LFH offset %ld at entry %d\n", localHdrOffset, i); goto bail; } @@ -367,12 +367,12 @@ bool ZipFileRO::parseZipArchive(void) ptr += kCDELen + fileNameLen + extraLen + commentLen; if ((size_t)(ptr - cdPtr) > cdLength) { - LOGW("bad CD advance (%d vs " ZD ") at entry %d\n", + ALOGW("bad CD advance (%d vs " ZD ") at entry %d\n", (int) (ptr - cdPtr), (ZD_TYPE) cdLength, i); goto bail; } } - LOGV("+++ zip good scan %d entries\n", numEntries); + ALOGV("+++ zip good scan %d entries\n", numEntries); result = true; bail: @@ -452,7 +452,7 @@ ZipEntryRO ZipFileRO::findEntryByName(const char* fileName) const ZipEntryRO ZipFileRO::findEntryByIndex(int idx) const { if (idx < 0 || idx >= mNumEntries) { - LOGW("Invalid index %d\n", idx); + ALOGW("Invalid index %d\n", idx); return NULL; } @@ -527,7 +527,7 @@ bool ZipFileRO::getEntryInfo(ZipEntryRO entry, int* pMethod, size_t* pUncompLen, if (pOffset != NULL) { long localHdrOffset = get4LE(ptr + kCDELocalOffset); if (localHdrOffset + kLFHLen >= cdOffset) { - LOGE("ERROR: bad local hdr offset in zip\n"); + ALOGE("ERROR: bad local hdr offset in zip\n"); return false; } @@ -544,12 +544,12 @@ bool ZipFileRO::getEntryInfo(ZipEntryRO entry, int* pMethod, size_t* pUncompLen, TEMP_FAILURE_RETRY(pread64(mFd, lfhBuf, sizeof(lfhBuf), localHdrOffset)); if (actual != sizeof(lfhBuf)) { - LOGW("failed reading lfh from offset %ld\n", localHdrOffset); + ALOGW("failed reading lfh from offset %ld\n", localHdrOffset); return false; } if (get4LE(lfhBuf) != kLFHSignature) { - LOGW("didn't find signature at start of lfh; wanted: offset=%ld data=0x%08x; " + ALOGW("didn't find signature at start of lfh; wanted: offset=%ld data=0x%08x; " "got: data=0x%08lx\n", localHdrOffset, kLFHSignature, get4LE(lfhBuf)); return false; @@ -567,20 +567,20 @@ bool ZipFileRO::getEntryInfo(ZipEntryRO entry, int* pMethod, size_t* pUncompLen, AutoMutex _l(mFdLock); if (lseek64(mFd, localHdrOffset, SEEK_SET) != localHdrOffset) { - LOGW("failed seeking to lfh at offset %ld\n", localHdrOffset); + ALOGW("failed seeking to lfh at offset %ld\n", localHdrOffset); return false; } ssize_t actual = TEMP_FAILURE_RETRY(read(mFd, lfhBuf, sizeof(lfhBuf))); if (actual != sizeof(lfhBuf)) { - LOGW("failed reading lfh from offset %ld\n", localHdrOffset); + ALOGW("failed reading lfh from offset %ld\n", localHdrOffset); return false; } if (get4LE(lfhBuf) != kLFHSignature) { off64_t actualOffset = lseek64(mFd, 0, SEEK_CUR); - LOGW("didn't find signature at start of lfh; wanted: offset=%ld data=0x%08x; " + ALOGW("didn't find signature at start of lfh; wanted: offset=%ld data=0x%08x; " "got: offset=" ZD " data=0x%08lx\n", localHdrOffset, kLFHSignature, (ZD_TYPE) actualOffset, get4LE(lfhBuf)); return false; @@ -591,13 +591,13 @@ bool ZipFileRO::getEntryInfo(ZipEntryRO entry, int* pMethod, size_t* pUncompLen, off64_t dataOffset = localHdrOffset + kLFHLen + get2LE(lfhBuf + kLFHNameLen) + get2LE(lfhBuf + kLFHExtraLen); if (dataOffset >= cdOffset) { - LOGW("bad data offset %ld in zip\n", (long) dataOffset); + ALOGW("bad data offset %ld in zip\n", (long) dataOffset); return false; } /* check lengths */ if ((off64_t)(dataOffset + compLen) > cdOffset) { - LOGW("bad compressed length in zip (%ld + " ZD " > %ld)\n", + ALOGW("bad compressed length in zip (%ld + " ZD " > %ld)\n", (long) dataOffset, (ZD_TYPE) compLen, (long) cdOffset); return false; } @@ -605,7 +605,7 @@ bool ZipFileRO::getEntryInfo(ZipEntryRO entry, int* pMethod, size_t* pUncompLen, if (method == kCompressStored && (off64_t)(dataOffset + uncompLen) > cdOffset) { - LOGE("ERROR: bad uncompressed length in zip (%ld + " ZD " > %ld)\n", + ALOGE("ERROR: bad uncompressed length in zip (%ld + " ZD " > %ld)\n", (long) dataOffset, (ZD_TYPE) uncompLen, (long) cdOffset); return false; } @@ -754,14 +754,14 @@ bool ZipFileRO::uncompressEntry(ZipEntryRO entry, int fd) const if (method == kCompressStored) { ssize_t actual = write(fd, ptr, uncompLen); if (actual < 0) { - LOGE("Write failed: %s\n", strerror(errno)); + ALOGE("Write failed: %s\n", strerror(errno)); goto unmap; } else if ((size_t) actual != uncompLen) { - LOGE("Partial write during uncompress (" ZD " of " ZD ")\n", + ALOGE("Partial write during uncompress (" ZD " of " ZD ")\n", (ZD_TYPE) actual, (ZD_TYPE) uncompLen); goto unmap; } else { - LOGI("+++ successful write\n"); + ALOGI("+++ successful write\n"); } } else { if (!inflateBuffer(fd, ptr, uncompLen, compLen)) @@ -806,10 +806,10 @@ bail: zerr = inflateInit2(&zstream, -MAX_WBITS); if (zerr != Z_OK) { if (zerr == Z_VERSION_ERROR) { - LOGE("Installed zlib is not compatible with linked version (%s)\n", + ALOGE("Installed zlib is not compatible with linked version (%s)\n", ZLIB_VERSION); } else { - LOGE("Call to inflateInit2 failed (zerr=%d)\n", zerr); + ALOGE("Call to inflateInit2 failed (zerr=%d)\n", zerr); } goto bail; } @@ -819,7 +819,7 @@ bail: */ zerr = inflate(&zstream, Z_FINISH); if (zerr != Z_STREAM_END) { - LOGW("Zip inflate failed, zerr=%d (nIn=%p aIn=%u nOut=%p aOut=%u)\n", + ALOGW("Zip inflate failed, zerr=%d (nIn=%p aIn=%u nOut=%p aOut=%u)\n", zerr, zstream.next_in, zstream.avail_in, zstream.next_out, zstream.avail_out); goto z_bail; @@ -827,7 +827,7 @@ bail: /* paranoia */ if (zstream.total_out != uncompLen) { - LOGW("Size mismatch on inflated file (%ld vs " ZD ")\n", + ALOGW("Size mismatch on inflated file (%ld vs " ZD ")\n", zstream.total_out, (ZD_TYPE) uncompLen); goto z_bail; } @@ -873,10 +873,10 @@ bail: zerr = inflateInit2(&zstream, -MAX_WBITS); if (zerr != Z_OK) { if (zerr == Z_VERSION_ERROR) { - LOGE("Installed zlib is not compatible with linked version (%s)\n", + ALOGE("Installed zlib is not compatible with linked version (%s)\n", ZLIB_VERSION); } else { - LOGE("Call to inflateInit2 failed (zerr=%d)\n", zerr); + ALOGE("Call to inflateInit2 failed (zerr=%d)\n", zerr); } goto bail; } @@ -890,7 +890,7 @@ bail: */ zerr = inflate(&zstream, Z_NO_FLUSH); if (zerr != Z_OK && zerr != Z_STREAM_END) { - LOGW("zlib inflate: zerr=%d (nIn=%p aIn=%u nOut=%p aOut=%u)\n", + ALOGW("zlib inflate: zerr=%d (nIn=%p aIn=%u nOut=%p aOut=%u)\n", zerr, zstream.next_in, zstream.avail_in, zstream.next_out, zstream.avail_out); goto z_bail; @@ -903,7 +903,7 @@ bail: long writeSize = zstream.next_out - writeBuf; int cc = write(fd, writeBuf, writeSize); if (cc != (int) writeSize) { - LOGW("write failed in inflate (%d vs %ld)\n", cc, writeSize); + ALOGW("write failed in inflate (%d vs %ld)\n", cc, writeSize); goto z_bail; } @@ -916,7 +916,7 @@ bail: /* paranoia */ if (zstream.total_out != uncompLen) { - LOGW("Size mismatch on inflated file (%ld vs " ZD ")\n", + ALOGW("Size mismatch on inflated file (%ld vs " ZD ")\n", zstream.total_out, (ZD_TYPE) uncompLen); goto z_bail; } diff --git a/libs/utils/ZipUtils.cpp b/libs/utils/ZipUtils.cpp index 9138878..2dbdc1d 100644 --- a/libs/utils/ZipUtils.cpp +++ b/libs/utils/ZipUtils.cpp @@ -77,10 +77,10 @@ using namespace android; zerr = inflateInit2(&zstream, -MAX_WBITS); if (zerr != Z_OK) { if (zerr == Z_VERSION_ERROR) { - LOGE("Installed zlib is not compatible with linked version (%s)\n", + ALOGE("Installed zlib is not compatible with linked version (%s)\n", ZLIB_VERSION); } else { - LOGE("Call to inflateInit2 failed (zerr=%d)\n", zerr); + ALOGE("Call to inflateInit2 failed (zerr=%d)\n", zerr); } goto bail; } @@ -95,12 +95,12 @@ using namespace android; if (zstream.avail_in == 0) { getSize = (compRemaining > kReadBufSize) ? kReadBufSize : compRemaining; - LOGV("+++ reading %ld bytes (%ld left)\n", + ALOGV("+++ reading %ld bytes (%ld left)\n", getSize, compRemaining); int cc = read(fd, readBuf, getSize); if (cc != (int) getSize) { - LOGD("inflate read failed (%d vs %ld)\n", + ALOGD("inflate read failed (%d vs %ld)\n", cc, getSize); goto z_bail; } @@ -114,7 +114,7 @@ using namespace android; /* uncompress the data */ zerr = inflate(&zstream, Z_NO_FLUSH); if (zerr != Z_OK && zerr != Z_STREAM_END) { - LOGD("zlib inflate call failed (zerr=%d)\n", zerr); + ALOGD("zlib inflate call failed (zerr=%d)\n", zerr); goto z_bail; } @@ -124,7 +124,7 @@ using namespace android; assert(zerr == Z_STREAM_END); /* other errors should've been caught */ if ((long) zstream.total_out != uncompressedLen) { - LOGW("Size mismatch on inflated file (%ld vs %ld)\n", + ALOGW("Size mismatch on inflated file (%ld vs %ld)\n", zstream.total_out, uncompressedLen); goto z_bail; } @@ -189,10 +189,10 @@ bail: zerr = inflateInit2(&zstream, -MAX_WBITS); if (zerr != Z_OK) { if (zerr == Z_VERSION_ERROR) { - LOGE("Installed zlib is not compatible with linked version (%s)\n", + ALOGE("Installed zlib is not compatible with linked version (%s)\n", ZLIB_VERSION); } else { - LOGE("Call to inflateInit2 failed (zerr=%d)\n", zerr); + ALOGE("Call to inflateInit2 failed (zerr=%d)\n", zerr); } goto bail; } @@ -207,12 +207,12 @@ bail: if (zstream.avail_in == 0) { getSize = (compRemaining > kReadBufSize) ? kReadBufSize : compRemaining; - LOGV("+++ reading %ld bytes (%ld left)\n", + ALOGV("+++ reading %ld bytes (%ld left)\n", getSize, compRemaining); int cc = fread(readBuf, 1, getSize, fp); if (cc != (int) getSize) { - LOGD("inflate read failed (%d vs %ld)\n", + ALOGD("inflate read failed (%d vs %ld)\n", cc, getSize); goto z_bail; } @@ -226,7 +226,7 @@ bail: /* uncompress the data */ zerr = inflate(&zstream, Z_NO_FLUSH); if (zerr != Z_OK && zerr != Z_STREAM_END) { - LOGD("zlib inflate call failed (zerr=%d)\n", zerr); + ALOGD("zlib inflate call failed (zerr=%d)\n", zerr); goto z_bail; } @@ -236,7 +236,7 @@ bail: assert(zerr == Z_STREAM_END); /* other errors should've been caught */ if ((long) zstream.total_out != uncompressedLen) { - LOGW("Size mismatch on inflated file (%ld vs %ld)\n", + ALOGW("Size mismatch on inflated file (%ld vs %ld)\n", zstream.total_out, uncompressedLen); goto z_bail; } |