Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
This commit is contained in:
Steve Block 2012-01-06 19:20:56 +00:00
parent 50d76ddfb0
commit e6f43ddce7
64 changed files with 299 additions and 299 deletions

View File

@ -133,7 +133,7 @@ public:
const char* randomDevice = "/dev/urandom";
mRandom = ::open(randomDevice, O_RDONLY);
if (mRandom == -1) {
LOGE("open: %s: %s", randomDevice, strerror(errno));
ALOGE("open: %s: %s", randomDevice, strerror(errno));
return false;
}
return true;
@ -754,11 +754,11 @@ static ResponseCode process(KeyStore* keyStore, int sock, uid_t uid, int8_t code
int main(int argc, char* argv[]) {
int controlSocket = android_get_control_socket("keystore");
if (argc < 2) {
LOGE("A directory must be specified!");
ALOGE("A directory must be specified!");
return 1;
}
if (chdir(argv[1]) == -1) {
LOGE("chdir: %s: %s", argv[1], strerror(errno));
ALOGE("chdir: %s: %s", argv[1], strerror(errno));
return 1;
}
@ -767,7 +767,7 @@ int main(int argc, char* argv[]) {
return 1;
}
if (listen(controlSocket, 3) == -1) {
LOGE("listen: %s", strerror(errno));
ALOGE("listen: %s", strerror(errno));
return 1;
}
@ -805,6 +805,6 @@ int main(int argc, char* argv[]) {
}
close(sock);
}
LOGE("accept: %s", strerror(errno));
ALOGE("accept: %s", strerror(errno));
return 1;
}

View File

@ -205,7 +205,7 @@ bool GenerationCache<K, V>::removeOldest() {
removeAt(index);
return true;
}
LOGE("GenerationCache: removeOldest failed to find the item in the cache "
ALOGE("GenerationCache: removeOldest failed to find the item in the cache "
"with the given key, but we know it must be in there. "
"Is the key comparator kaput?");
}

View File

@ -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;
}

View File

@ -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;
@ -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));

View File

@ -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 {
@ -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());
}
}
}

View File

@ -348,7 +348,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!!!");

View File

@ -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,7 +127,7 @@ 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;

View File

@ -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;

View File

@ -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;
@ -1018,7 +1018,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();
}
@ -1511,7 +1511,7 @@ 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;

View File

@ -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;
@ -302,19 +302,19 @@ 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 {
ALOGW("Opening '/dev/binder' failed: %s\n", strerror(errno));
@ -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;
}

View File

@ -40,7 +40,7 @@ BitTube::BitTube()
fcntl(mSendFd, F_SETFL, O_NONBLOCK);
} else {
mReceiveFd = -errno;
LOGE("BitTube: pipe creation failed (%s)", strerror(-mReceiveFd));
ALOGE("BitTube: pipe creation failed (%s)", strerror(-mReceiveFd));
}
}
@ -52,7 +52,7 @@ BitTube::BitTube(const Parcel& data)
fcntl(mReceiveFd, F_SETFL, O_NONBLOCK);
} else {
mReceiveFd = -errno;
LOGE("BitTube(Parcel): can't dup filedescriptor (%s)",
ALOGE("BitTube(Parcel): can't dup filedescriptor (%s)",
strerror(-mReceiveFd));
}
}

View File

@ -81,7 +81,7 @@ status_t DisplayEventReceiver::requestNextVsync() {
ssize_t DisplayEventReceiver::getEvents(DisplayEventReceiver::Event* events,
size_t count) {
ssize_t size = mDataChannel->read(events, sizeof(events[0])*count);
LOGE_IF(size<0,
ALOGE_IF(size<0,
"DisplayEventReceiver::getEvents error (%s)",
strerror(-size));
if (size >= 0) {

View File

@ -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;
}
@ -188,7 +188,7 @@ public:
BnSurfaceComposer::CREATE_DISPLAY_EVENT_CONNECTION,
data, &reply);
if (err != NO_ERROR) {
LOGE("ISurfaceComposer::createDisplayEventConnection: error performing "
ALOGE("ISurfaceComposer::createDisplayEventConnection: error performing "
"transaction: %s (%d)", strerror(-err), -err);
return result;
}

View File

@ -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("SensorEventQueue::waitForEvent error (errno=%d)", errno);
ALOGE("SensorEventQueue::waitForEvent error (errno=%d)", errno);
result = -EPIPE; // unknown error, so we make up one
break;
}

View File

@ -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);

View File

@ -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);

View File

@ -66,7 +66,7 @@
#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, ...) LOGE("[%s] "x, mName.string(), ##__VA_ARGS__)
#define ST_LOGE(x, ...) ALOGE("[%s] "x, mName.string(), ##__VA_ARGS__)
namespace android {
@ -493,9 +493,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);
}
@ -804,7 +804,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;
}

View File

@ -157,7 +157,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;
}
@ -202,7 +202,7 @@ int SurfaceTextureClient::getSlotFromBufferLocked(
return i;
}
}
LOGE("getSlotFromBufferLocked: unknown buffer: %p", buffer->handle);
ALOGE("getSlotFromBufferLocked: unknown buffer: %p", buffer->handle);
return BAD_VALUE;
}
@ -230,7 +230,7 @@ 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;
}
@ -452,7 +452,7 @@ 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;
}
@ -463,7 +463,7 @@ int SurfaceTextureClient::setBufferCount(int bufferCount)
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) {
@ -488,7 +488,7 @@ 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;
}
@ -512,7 +512,7 @@ int SurfaceTextureClient::setScalingMode(int 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;
@ -553,11 +553,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());
@ -600,7 +600,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;
}
@ -615,11 +615,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);
@ -680,15 +680,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;

View File

@ -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;

View File

@ -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;

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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;
@ -220,7 +220,7 @@ status_t InputPublisher::initialize() {
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;
}
@ -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;
}
@ -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;
}
@ -444,7 +444,7 @@ status_t InputPublisher::appendMotionSample(
#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;
@ -478,7 +478,7 @@ status_t InputPublisher::appendMotionSample(
#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;
}
@ -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;
}
@ -559,7 +559,7 @@ status_t InputConsumer::initialize() {
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;
}
@ -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;
}
@ -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;
}

View File

@ -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
@ -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,7 +535,7 @@ 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;
}
@ -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,7 +564,7 @@ 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;
}
@ -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,7 +688,7 @@ 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;
}
@ -699,7 +699,7 @@ status_t KeyCharacterMap::Parser::parseKeyProperty() {
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;
}
@ -711,7 +711,7 @@ status_t KeyCharacterMap::Parser::parseKeyProperty() {
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;
}
@ -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;
}

View File

@ -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
@ -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;
}
@ -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,12 +316,12 @@ 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;
}

View File

@ -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;
}

View File

@ -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()
@ -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);
@ -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;
}

View File

@ -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
@ -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,7 +116,7 @@ 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;
}
@ -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;

View File

@ -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,7 +581,7 @@ 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;
}
@ -590,7 +590,7 @@ const void* _FileAsset::getBuffer(bool wordAligned)
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;
}
@ -658,7 +658,7 @@ const void* _FileAsset::ensureAlignment(FileMap* map)
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);

View File

@ -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());

View File

@ -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;
}
@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -520,12 +520,12 @@ int Looper::addFd(int fd, int ident, int events, ALooper_callbackFunc callback,
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);
@ -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;
}

View File

@ -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
@ -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;
}

View File

@ -98,7 +98,7 @@ 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) {
@ -116,7 +116,7 @@ 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) {
@ -129,7 +129,7 @@ public:
}
}
if (dumpStack) {
LOGE("above errors at:");
ALOGE("above errors at:");
CallStack stack;
stack.update();
stack.dump();
@ -205,7 +205,7 @@ public:
close(rc);
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,7 +263,7 @@ 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);

View File

@ -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);
@ -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;
}
@ -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));

View File

@ -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();
@ -165,7 +165,7 @@ ssize_t StreamingZipInflater::read(void* outBuf, size_t count) {
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;
@ -195,7 +195,7 @@ int StreamingZipInflater::readNextChunk() {
//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;

View File

@ -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;

View File

@ -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 {

View File

@ -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;
}
@ -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,10 +754,10 @@ 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 {
@ -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;
}
@ -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;
}

View File

@ -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;
}
@ -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;
}

View File

@ -184,7 +184,7 @@ egl_surface_t::~egl_surface_t()
free(depth.data);
}
bool egl_surface_t::isValid() const {
LOGE_IF(magic != MAGIC, "invalid EGLSurface (%p)", this);
ALOGE_IF(magic != MAGIC, "invalid EGLSurface (%p)", this);
return magic == MAGIC;
}
@ -397,7 +397,7 @@ EGLBoolean egl_window_surface_v2_t::connect()
// pin the buffer down
if (lock(buffer, GRALLOC_USAGE_SW_READ_OFTEN |
GRALLOC_USAGE_SW_WRITE_OFTEN, &bits) != NO_ERROR) {
LOGE("connect() failed to lock buffer %p (%ux%u)",
ALOGE("connect() failed to lock buffer %p (%ux%u)",
buffer, buffer->width, buffer->height);
return setError(EGL_BAD_ACCESS, EGL_FALSE);
// FIXME: we should make sure we're not accessing the buffer anymore
@ -552,7 +552,7 @@ EGLBoolean egl_window_surface_v2_t::swapBuffers()
// finally pin the buffer down
if (lock(buffer, GRALLOC_USAGE_SW_READ_OFTEN |
GRALLOC_USAGE_SW_WRITE_OFTEN, &bits) != NO_ERROR) {
LOGE("eglSwapBuffers() failed to lock buffer %p (%ux%u)",
ALOGE("eglSwapBuffers() failed to lock buffer %p (%ux%u)",
buffer, buffer->width, buffer->height);
return setError(EGL_BAD_ACCESS, EGL_FALSE);
// FIXME: we should make sure we're not accessing the buffer anymore
@ -721,7 +721,7 @@ egl_pbuffer_surface_t::egl_pbuffer_surface_t(EGLDisplay dpy,
case GGL_PIXEL_FORMAT_RGBA_8888: size *= 4; break;
case GGL_PIXEL_FORMAT_RGBX_8888: size *= 4; break;
default:
LOGE("incompatible pixel format for pbuffer (format=%d)", f);
ALOGE("incompatible pixel format for pbuffer (format=%d)", f);
pbuffer.data = 0;
break;
}

View File

@ -174,7 +174,7 @@ status_t buildAPyramid(ogles_context_t* c, EGLTextureObject* tex)
}
}
} else {
LOGE("Unsupported format (%d)", base->format);
ALOGE("Unsupported format (%d)", base->format);
return BAD_TYPE;
}

View File

@ -278,7 +278,7 @@ void *Loader::load_driver(const char* kind, const char *tag,
void* dso = dlopen(driver_absolute_path, RTLD_NOW | RTLD_LOCAL);
if (dso == 0) {
const char* err = dlerror();
LOGE("load_driver(%s): %s", driver_absolute_path, err?err:"unknown");
ALOGE("load_driver(%s): %s", driver_absolute_path, err?err:"unknown");
return 0;
}
@ -287,7 +287,7 @@ void *Loader::load_driver(const char* kind, const char *tag,
if (mask & EGL) {
getProcAddress = (getProcAddressType)dlsym(dso, "eglGetProcAddress");
LOGE_IF(!getProcAddress,
ALOGE_IF(!getProcAddress,
"can't find eglGetProcAddress() in %s", driver_absolute_path);
egl_t* egl = &cnx->egl;

View File

@ -141,7 +141,7 @@ void setGLHooksThreadSpecific(gl_hooks_t const *value) {
static int gl_no_context() {
if (egl_tls_t::logNoContextCall()) {
LOGE("call to OpenGL ES API with no current context "
ALOGE("call to OpenGL ES API with no current context "
"(logged once per thread)");
char value[PROPERTY_VALUE_MAX];
property_get("debug.egl.callstack", value, "0");
@ -287,7 +287,7 @@ EGLBoolean egl_init_drivers() {
}
void gl_unimplemented() {
LOGE("called unimplemented OpenGL ES API");
ALOGE("called unimplemented OpenGL ES API");
}
// ----------------------------------------------------------------------------

View File

@ -352,7 +352,7 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config,
EGLint format;
if (native_window_api_connect(window, NATIVE_WINDOW_API_EGL) != OK) {
LOGE("EGLNativeWindowType %p already connected to another API",
ALOGE("EGLNativeWindowType %p already connected to another API",
window);
return setError(EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
}
@ -363,7 +363,7 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config,
if (format != 0) {
int err = native_window_set_buffers_format(window, format);
if (err != 0) {
LOGE("error setting native window pixel format: %s (%d)",
ALOGE("error setting native window pixel format: %s (%d)",
strerror(-err), err);
native_window_api_disconnect(window, NATIVE_WINDOW_API_EGL);
return setError(EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
@ -674,7 +674,7 @@ EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw,
egl_tls_t::setContext(EGL_NO_CONTEXT);
}
} else {
// this will LOGE the error
// this will ALOGE the error
result = setError(c->cnx->egl.eglGetError(), EGL_FALSE);
}
return result;
@ -886,7 +886,7 @@ __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname)
addr = sGLExtentionMap.valueFor(name);
const int slot = sGLExtentionSlot;
LOGE_IF(slot >= MAX_NUMBER_OF_GL_EXTENSIONS,
ALOGE_IF(slot >= MAX_NUMBER_OF_GL_EXTENSIONS,
"no more slots for eglGetProcAddress(\"%s\")",
procname);

View File

@ -101,7 +101,7 @@ void egl_cache_t::initialize(egl_display_t *display) {
cnx->egl.eglGetProcAddress(
"eglSetBlobCacheFuncsANDROID"));
if (eglSetBlobCacheFuncsANDROID == NULL) {
LOGE("EGL_ANDROID_blob_cache advertised by display %d, "
ALOGE("EGL_ANDROID_blob_cache advertised by display %d, "
"but unable to get eglSetBlobCacheFuncsANDROID", i);
continue;
}
@ -110,7 +110,7 @@ void egl_cache_t::initialize(egl_display_t *display) {
android::setBlob, android::getBlob);
EGLint err = cnx->egl.eglGetError();
if (err != EGL_SUCCESS) {
LOGE("eglSetBlobCacheFuncsANDROID resulted in an error: "
ALOGE("eglSetBlobCacheFuncsANDROID resulted in an error: "
"%#x", err);
}
}
@ -226,7 +226,7 @@ void egl_cache_t::saveBlobCacheLocked() {
// The file exists, delete it and try again.
if (unlink(fname) == -1) {
// No point in retrying if the unlink failed.
LOGE("error unlinking cache file %s: %s (%d)", fname,
ALOGE("error unlinking cache file %s: %s (%d)", fname,
strerror(errno), errno);
return;
}
@ -234,7 +234,7 @@ void egl_cache_t::saveBlobCacheLocked() {
fd = open(fname, O_CREAT | O_EXCL | O_RDWR, 0);
}
if (fd == -1) {
LOGE("error creating cache file %s: %s (%d)", fname,
ALOGE("error creating cache file %s: %s (%d)", fname,
strerror(errno), errno);
return;
}
@ -242,7 +242,7 @@ void egl_cache_t::saveBlobCacheLocked() {
size_t fileSize = headerSize + cacheSize;
if (ftruncate(fd, fileSize) == -1) {
LOGE("error setting cache file size: %s (%d)", strerror(errno),
ALOGE("error setting cache file size: %s (%d)", strerror(errno),
errno);
close(fd);
unlink(fname);
@ -252,7 +252,7 @@ void egl_cache_t::saveBlobCacheLocked() {
uint8_t* buf = reinterpret_cast<uint8_t*>(mmap(NULL, fileSize,
PROT_WRITE, MAP_SHARED, fd, 0));
if (buf == MAP_FAILED) {
LOGE("error mmaping cache file: %s (%d)", strerror(errno),
ALOGE("error mmaping cache file: %s (%d)", strerror(errno),
errno);
close(fd);
unlink(fname);
@ -262,7 +262,7 @@ void egl_cache_t::saveBlobCacheLocked() {
status_t err = mBlobCache->flatten(buf + headerSize, cacheSize, NULL,
0);
if (err != OK) {
LOGE("error writing cache contents: %s (%d)", strerror(-err),
ALOGE("error writing cache contents: %s (%d)", strerror(-err),
-err);
munmap(buf, fileSize);
close(fd);
@ -288,7 +288,7 @@ void egl_cache_t::loadBlobCacheLocked() {
int fd = open(mFilename.string(), O_RDONLY, 0);
if (fd == -1) {
if (errno != ENOENT) {
LOGE("error opening cache file %s: %s (%d)", mFilename.string(),
ALOGE("error opening cache file %s: %s (%d)", mFilename.string(),
strerror(errno), errno);
}
return;
@ -296,7 +296,7 @@ void egl_cache_t::loadBlobCacheLocked() {
struct stat statBuf;
if (fstat(fd, &statBuf) == -1) {
LOGE("error stat'ing cache file: %s (%d)", strerror(errno), errno);
ALOGE("error stat'ing cache file: %s (%d)", strerror(errno), errno);
close(fd);
return;
}
@ -304,7 +304,7 @@ void egl_cache_t::loadBlobCacheLocked() {
// Sanity check the size before trying to mmap it.
size_t fileSize = statBuf.st_size;
if (fileSize > maxTotalSize * 2) {
LOGE("cache file is too large: %#llx", statBuf.st_size);
ALOGE("cache file is too large: %#llx", statBuf.st_size);
close(fd);
return;
}
@ -312,7 +312,7 @@ void egl_cache_t::loadBlobCacheLocked() {
uint8_t* buf = reinterpret_cast<uint8_t*>(mmap(NULL, fileSize,
PROT_READ, MAP_PRIVATE, fd, 0));
if (buf == MAP_FAILED) {
LOGE("error mmaping cache file: %s (%d)", strerror(errno),
ALOGE("error mmaping cache file: %s (%d)", strerror(errno),
errno);
close(fd);
return;
@ -321,13 +321,13 @@ void egl_cache_t::loadBlobCacheLocked() {
// Check the file magic and CRC
size_t cacheSize = fileSize - headerSize;
if (memcmp(buf, cacheFileMagic, 4) != 0) {
LOGE("cache file has bad mojo");
ALOGE("cache file has bad mojo");
close(fd);
return;
}
uint32_t* crc = reinterpret_cast<uint32_t*>(buf + 4);
if (crc32c(buf + headerSize, cacheSize) != *crc) {
LOGE("cache file failed CRC check");
ALOGE("cache file failed CRC check");
close(fd);
return;
}
@ -335,7 +335,7 @@ void egl_cache_t::loadBlobCacheLocked() {
status_t err = mBlobCache->unflatten(buf + headerSize, cacheSize, NULL,
0);
if (err != OK) {
LOGE("error reading cache contents: %s (%d)", strerror(-err),
ALOGE("error reading cache contents: %s (%d)", strerror(-err),
-err);
munmap(buf, fileSize);
close(fd);

View File

@ -45,7 +45,7 @@ void egl_object_t::terminate() {
display->removeObject(this);
if (decRef() == 1) {
// shouldn't happen because this is called from LocalRef
LOGE("egl_object_t::terminate() removed the last reference!");
ALOGE("egl_object_t::terminate() removed the last reference!");
}
}

View File

@ -110,7 +110,7 @@ void egl_object_t::LocalRef<N,T>::release() const {
if (ref) {
if (ref->decRef() == 1) {
// shouldn't happen because this is called from LocalRef
LOGE("LocalRef::release() removed the last reference!");
ALOGE("LocalRef::release() removed the last reference!");
}
}
}

View File

@ -73,7 +73,7 @@ void egl_tls_t::setErrorEtcImpl(
egl_tls_t* tls = getTLS();
if (tls->error != error) {
if (!quiet) {
LOGE("%s:%d error %x (%s)",
ALOGE("%s:%d error %x (%s)",
caller, line, error, egl_strerror(error));
char value[PROPERTY_VALUE_MAX];
property_get("debug.egl.callstack", value, "0");

View File

@ -100,7 +100,7 @@ unsigned GetBytesPerPixel(const GLenum format, const GLenum type)
case GL_UNSIGNED_BYTE:
break;
default:
LOGE("GetBytesPerPixel: unknown type %x", type);
ALOGE("GetBytesPerPixel: unknown type %x", type);
}
switch (format) {
@ -115,7 +115,7 @@ unsigned GetBytesPerPixel(const GLenum format, const GLenum type)
case 0x80E1: // GL_BGRA_EXT
return 4;
default:
LOGE("GetBytesPerPixel: unknown format %x", format);
ALOGE("GetBytesPerPixel: unknown format %x", format);
}
return 1; // in doubt...

View File

@ -132,7 +132,7 @@ GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
#define CHECK_GL_ERRORS(_api) \
do { GLint err = glGetError(); \
LOGE_IF(err != GL_NO_ERROR, "%s failed (0x%04X)", #_api, err); \
ALOGE_IF(err != GL_NO_ERROR, "%s failed (0x%04X)", #_api, err); \
} while(false);
#else

View File

@ -84,7 +84,7 @@ void GLTrace_start() {
int clientSocket = gltrace::acceptClientConnection(port);
if (clientSocket < 0) {
LOGE("Error creating GLTrace server socket. Quitting application.");
ALOGE("Error creating GLTrace server socket. Quitting application.");
exit(-1);
}

View File

@ -51,7 +51,7 @@ unsigned getBytesPerTexel(const GLenum format, const GLenum type) {
case GL_UNSIGNED_BYTE:
break;
default:
LOGE("GetBytesPerPixel: unknown type %x", type);
ALOGE("GetBytesPerPixel: unknown type %x", type);
}
switch (format) {
@ -66,7 +66,7 @@ unsigned getBytesPerTexel(const GLenum format, const GLenum type) {
case 0x80E1: // GL_BGRA_EXT
return 4;
default:
LOGE("GetBytesPerPixel: unknown format %x", format);
ALOGE("GetBytesPerPixel: unknown format %x", format);
}
return 1; // in doubt...
@ -139,7 +139,7 @@ void fixup_glTexImage2D(GLMessage *glmsg) {
if (data != NULL) {
arg_data->add_rawbytes(data, bytesPerTexel * width * height);
} else {
LOGE("fixup_glTexImage2D: image data is NULL.\n");
ALOGE("fixup_glTexImage2D: image data is NULL.\n");
arg_data->set_type(GLMessage::DataType::VOID);
// FIXME:
// This will create the texture, but it will be uninitialized.

View File

@ -31,7 +31,7 @@ namespace gltrace {
int acceptClientConnection(int serverPort) {
int serverSocket = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (serverSocket < 0) {
LOGE("Error (%d) while creating socket. Check if app has network permissions.",
ALOGE("Error (%d) while creating socket. Check if app has network permissions.",
serverSocket);
return -1;
}
@ -45,13 +45,13 @@ int acceptClientConnection(int serverPort) {
socklen_t sockaddr_len = sizeof(sockaddr_in);
if (bind(serverSocket, (struct sockaddr *) &server, sizeof(server)) < 0) {
close(serverSocket);
LOGE("Failed to bind the server socket");
ALOGE("Failed to bind the server socket");
return -1;
}
if (listen(serverSocket, 1) < 0) {
close(serverSocket);
LOGE("Failed to listen on server socket");
ALOGE("Failed to listen on server socket");
return -1;
}
@ -60,7 +60,7 @@ int acceptClientConnection(int serverPort) {
int clientSocket = accept(serverSocket, (struct sockaddr *)&client, &sockaddr_len);
if (clientSocket < 0) {
close(serverSocket);
LOGE("Failed to accept client connection");
ALOGE("Failed to accept client connection");
return -1;
}

View File

@ -48,7 +48,7 @@ GLuint loadShader(GLenum shaderType, const char* pSource) {
char* buf = (char*) malloc(infoLen);
if (buf) {
glGetShaderInfoLog(shader, infoLen, NULL, buf);
LOGE("Could not compile shader %d:\n%s\n",
ALOGE("Could not compile shader %d:\n%s\n",
shaderType, buf);
free(buf);
}
@ -87,7 +87,7 @@ GLuint createProgram(const char* pVertexSource, const char* pFragmentSource) {
char* buf = (char*) malloc(bufLength);
if (buf) {
glGetProgramInfoLog(program, bufLength, NULL, buf);
LOGE("Could not link program:\n%s\n", buf);
ALOGE("Could not link program:\n%s\n", buf);
free(buf);
}
}
@ -110,7 +110,7 @@ bool setupGraphics(int w, int h) {
ALOGI("setupGraphics(%d, %d)", w, h);
gProgram = createProgram(gVertexShader, gFragmentShader);
if (!gProgram) {
LOGE("Could not create program.");
ALOGE("Could not create program.");
return false;
}
gvPositionHandle = glGetAttribLocation(gProgram, "vPosition");

View File

@ -26,7 +26,7 @@ static uint32_t gHeight = 0;
static void checkGlError(const char* op) {
for (GLint error = glGetError(); error; error
= glGetError()) {
LOGE("after %s() glError (0x%x)\n", op, error);
ALOGE("after %s() glError (0x%x)\n", op, error);
}
}
@ -44,7 +44,7 @@ GLuint loadShader(GLenum shaderType, const char* pSource) {
char* buf = (char*) malloc(infoLen);
if (buf) {
glGetShaderInfoLog(shader, infoLen, NULL, buf);
LOGE("Could not compile shader %d:\n%s\n", shaderType, buf);
ALOGE("Could not compile shader %d:\n%s\n", shaderType, buf);
free(buf);
}
glDeleteShader(shader);
@ -94,7 +94,7 @@ GLuint createProgram(const char* pVertexSource, const char* pFragmentSource) {
char* buf = (char*) malloc(bufLength);
if (buf) {
glGetProgramInfoLog(program, bufLength, NULL, buf);
LOGE("Could not link program:\n%s\n", buf);
ALOGE("Could not link program:\n%s\n", buf);
free(buf);
}
}

View File

@ -81,7 +81,7 @@ JNIEXPORT void JNICALL Java_com_android_glperf_GLPerfLib_init(JNIEnv * env, jobj
ALOGI("Writing to: %s\n",fileName);
fOut = fopen(fileName, "w");
if (fOut == NULL) {
LOGE("Could not open: %s\n", fileName);
ALOGE("Could not open: %s\n", fileName);
}
ALOGI("\nvarColor, texCount, modulate, extraMath, texSize, blend, Mpps, DC60\n");

View File

@ -48,7 +48,7 @@ GLuint loadShader(GLenum shaderType, const char* pSource) {
char* buf = (char*) malloc(infoLen);
if (buf) {
glGetShaderInfoLog(shader, infoLen, NULL, buf);
LOGE("Could not compile shader %d:\n%s\n",
ALOGE("Could not compile shader %d:\n%s\n",
shaderType, buf);
free(buf);
}
@ -87,7 +87,7 @@ GLuint createProgram(const char* pVertexSource, const char* pFragmentSource) {
char* buf = (char*) malloc(bufLength);
if (buf) {
glGetProgramInfoLog(program, bufLength, NULL, buf);
LOGE("Could not link program:\n%s\n", buf);
ALOGE("Could not link program:\n%s\n", buf);
free(buf);
}
}
@ -110,7 +110,7 @@ bool setupGraphics(int w, int h) {
ALOGI("setupGraphics(%d, %d)", w, h);
gProgram = createProgram(gVertexShader, gFragmentShader);
if (!gProgram) {
LOGE("Could not create program.");
ALOGE("Could not create program.");
return false;
}
gvPositionHandle = glGetAttribLocation(gProgram, "vPosition");

View File

@ -53,7 +53,7 @@ void checkGLErrors()
GLenum error = glGetError();
if (error == GL_NO_ERROR)
break;
LOGE("GL error 0x%04x", int(error));
ALOGE("GL error 0x%04x", int(error));
} while(true);
}
@ -62,7 +62,7 @@ void checkEGLErrors(const char* token)
{
EGLint error = eglGetError();
if (error && error != EGL_SUCCESS) {
LOGE("%s: EGL error 0x%04x (%s)",
ALOGE("%s: EGL error 0x%04x (%s)",
token, int(error), EGLUtils::strerror(error));
}
}
@ -130,7 +130,7 @@ void DisplayHardware::init(uint32_t dpy)
mNativeWindow = new FramebufferNativeWindow();
framebuffer_device_t const * fbDev = mNativeWindow->getDevice();
if (!fbDev) {
LOGE("Display subsystem failed to initialize. check logs. exiting...");
ALOGE("Display subsystem failed to initialize. check logs. exiting...");
exit(0);
}
@ -188,7 +188,7 @@ void DisplayHardware::init(uint32_t dpy)
EGLConfig config = NULL;
err = selectConfigForPixelFormat(display, attribs, format, &config);
LOGE_IF(err, "couldn't find an EGLConfig matching the screen format");
ALOGE_IF(err, "couldn't find an EGLConfig matching the screen format");
EGLint r,g,b,a;
eglGetConfigAttrib(display, config, EGL_RED_SIZE, &r);
@ -270,7 +270,7 @@ void DisplayHardware::init(uint32_t dpy)
result = eglMakeCurrent(display, surface, surface, context);
if (!result) {
LOGE("Couldn't create a working GLES context. check logs. exiting...");
ALOGE("Couldn't create a working GLES context. check logs. exiting...");
exit(0);
}

View File

@ -47,7 +47,7 @@ HWComposer::HWComposer(const sp<SurfaceFlinger>& flinger)
ALOGW_IF(err, "%s module not found", HWC_HARDWARE_MODULE_ID);
if (err == 0) {
err = hwc_open(mModule, &mHwc);
LOGE_IF(err, "%s device failed to initialize (%s)",
ALOGE_IF(err, "%s device failed to initialize (%s)",
HWC_HARDWARE_COMPOSER, strerror(-err));
if (err == 0) {
if (mHwc->registerProcs) {

View File

@ -70,12 +70,12 @@ void MessageQueue::waitMessage() {
continue;
case ALOOPER_POLL_ERROR:
LOGE("ALOOPER_POLL_ERROR");
ALOGE("ALOOPER_POLL_ERROR");
continue;
default:
// should not happen
LOGE("Looper::pollOnce() returned unknown status %d", ret);
ALOGE("Looper::pollOnce() returned unknown status %d", ret);
continue;
}
} while (true);

View File

@ -161,7 +161,7 @@ sp<IGraphicBufferAlloc> SurfaceFlinger::createGraphicBufferAlloc()
const GraphicPlane& SurfaceFlinger::graphicPlane(int dpy) const
{
LOGE_IF(uint32_t(dpy) >= DISPLAY_COUNT, "Invalid DisplayID %d", dpy);
ALOGE_IF(uint32_t(dpy) >= DISPLAY_COUNT, "Invalid DisplayID %d", dpy);
const GraphicPlane& plane(mGraphicPlanes[dpy]);
return plane;
}
@ -231,10 +231,10 @@ status_t SurfaceFlinger::readyToRun()
// create the shared control-block
mServerHeap = new MemoryHeapBase(4096,
MemoryHeapBase::READ_ONLY, "SurfaceFlinger read-only heap");
LOGE_IF(mServerHeap==0, "can't create shared memory dealer");
ALOGE_IF(mServerHeap==0, "can't create shared memory dealer");
mServerCblk = static_cast<surface_flinger_cblk_t*>(mServerHeap->getBase());
LOGE_IF(mServerCblk==0, "can't get to shared control block's address");
ALOGE_IF(mServerCblk==0, "can't get to shared control block's address");
new(mServerCblk) surface_flinger_cblk_t;
@ -874,7 +874,7 @@ void SurfaceFlinger::setupHardwareComposer(Region& dirtyInOut)
const Vector< sp<LayerBase> >& layers(mVisibleLayersSortedByZ);
size_t count = layers.size();
LOGE_IF(hwc.getNumLayers() != count,
ALOGE_IF(hwc.getNumLayers() != count,
"HAL number of layers (%d) doesn't match surfaceflinger (%d)",
hwc.getNumLayers(), count);
@ -893,7 +893,7 @@ void SurfaceFlinger::setupHardwareComposer(Region& dirtyInOut)
}
const size_t fbLayerCount = hwc.getLayerCount(HWC_FRAMEBUFFER);
status_t err = hwc.prepare();
LOGE_IF(err, "HWComposer::prepare failed (%s)", strerror(-err));
ALOGE_IF(err, "HWComposer::prepare failed (%s)", strerror(-err));
if (err == NO_ERROR) {
// what's happening here is tricky.
@ -1285,7 +1285,7 @@ sp<ISurface> SurfaceFlinger::createSurface(
sp<ISurface> surfaceHandle;
if (int32_t(w|h) < 0) {
LOGE("createSurface() failed, w or h is negative (w=%d, h=%d)",
ALOGE("createSurface() failed, w or h is negative (w=%d, h=%d)",
int(w), int(h));
return surfaceHandle;
}
@ -1357,7 +1357,7 @@ sp<Layer> SurfaceFlinger::createNormalSurface(
sp<Layer> layer = new Layer(this, display, client);
status_t err = layer->setBuffers(w, h, format, flags);
if (CC_LIKELY(err != NO_ERROR)) {
LOGE("createNormalSurfaceLocked() failed (%s)", strerror(-err));
ALOGE("createNormalSurfaceLocked() failed (%s)", strerror(-err));
layer.clear();
}
return layer;
@ -1415,10 +1415,10 @@ status_t SurfaceFlinger::destroySurface(const wp<LayerBaseClient>& layer)
// removed already, which means it is in the purgatory,
// and need to be removed from there.
ssize_t idx = mLayerPurgatory.remove(l);
LOGE_IF(idx < 0,
ALOGE_IF(idx < 0,
"layer=%p is not in the purgatory list", l.get());
}
LOGE_IF(err<0 && err != NAME_NOT_FOUND,
ALOGE_IF(err<0 && err != NAME_NOT_FOUND,
"error removing layer=%p (%s)", l.get(), strerror(-err));
}
return err;
@ -1651,7 +1651,7 @@ status_t SurfaceFlinger::onTransact(
const int uid = ipc->getCallingUid();
if ((uid != AID_GRAPHICS) &&
!PermissionCache::checkPermission(sAccessSurfaceFlinger, pid, uid)) {
LOGE("Permission Denial: "
ALOGE("Permission Denial: "
"can't access SurfaceFlinger pid=%d, uid=%d", pid, uid);
return PERMISSION_DENIED;
}
@ -1665,7 +1665,7 @@ status_t SurfaceFlinger::onTransact(
const int uid = ipc->getCallingUid();
if ((uid != AID_GRAPHICS) &&
!PermissionCache::checkPermission(sReadFramebuffer, pid, uid)) {
LOGE("Permission Denial: "
ALOGE("Permission Denial: "
"can't read framebuffer pid=%d, uid=%d", pid, uid);
return PERMISSION_DENIED;
}
@ -1680,7 +1680,7 @@ status_t SurfaceFlinger::onTransact(
IPCThreadState* ipc = IPCThreadState::self();
const int pid = ipc->getCallingPid();
const int uid = ipc->getCallingUid();
LOGE("Permission Denial: "
ALOGE("Permission Denial: "
"can't access SurfaceFlinger pid=%d, uid=%d", pid, uid);
return PERMISSION_DENIED;
}
@ -2497,7 +2497,7 @@ sp<LayerBaseClient> Client::getLayerUser(int32_t i) const
wp<LayerBaseClient> layer(mLayers.valueFor(i));
if (layer != 0) {
lbc = layer.promote();
LOGE_IF(lbc==0, "getLayerUser(name=%d) is dead", int(i));
ALOGE_IF(lbc==0, "getLayerUser(name=%d) is dead", int(i));
}
return lbc;
}
@ -2515,7 +2515,7 @@ status_t Client::onTransact(
// we're called from a different process, do the real check
if (!PermissionCache::checkCallingPermission(sAccessSurfaceFlinger))
{
LOGE("Permission Denial: "
ALOGE("Permission Denial: "
"can't openGlobalTransaction pid=%d, uid=%d", pid, uid);
return PERMISSION_DENIED;
}
@ -2587,7 +2587,7 @@ sp<GraphicBuffer> GraphicBufferAlloc::createGraphicBuffer(uint32_t w, uint32_t h
if (err == NO_MEMORY) {
GraphicBuffer::dumpAllocationsToSystemLog();
}
LOGE("GraphicBufferAlloc::createGraphicBuffer(w=%d, h=%d) "
ALOGE("GraphicBufferAlloc::createGraphicBuffer(w=%d, h=%d) "
"failed (%s), handle=%p",
w, h, strerror(-err), graphicBuffer->handle);
return 0;