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
diff --git a/libs/binder/BpBinder.cpp b/libs/binder/BpBinder.cpp
index e8fb1d9..47a62db 100644
--- a/libs/binder/BpBinder.cpp
+++ b/libs/binder/BpBinder.cpp
@@ -50,7 +50,7 @@
     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;
     }
diff --git a/libs/binder/CursorWindow.cpp b/libs/binder/CursorWindow.cpp
index 19b7631..a6e5f71 100644
--- a/libs/binder/CursorWindow.cpp
+++ b/libs/binder/CursorWindow.cpp
@@ -150,7 +150,7 @@
 
     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::FieldSlot* CursorWindow::getFieldSlot(uint32_t row, uint32_t column) {
     if (row >= mHeader->numRows || column >= mHeader->numColumns) {
-        LOGE("Failed to read row %d, column %d from a CursorWindow which "
+        ALOGE("Failed to read row %d, column %d from a CursorWindow which "
                 "has %d rows, %d columns.",
                 row, column, mHeader->numRows, mHeader->numColumns);
         return NULL;
     }
     RowSlot* rowSlot = getRowSlot(row);
     if (!rowSlot) {
-        LOGE("Failed to find rowSlot for row %d.", row);
+        ALOGE("Failed to find rowSlot for row %d.", row);
         return NULL;
     }
     FieldSlot* fieldDir = static_cast<FieldSlot*>(offsetToPtr(rowSlot->offset));
diff --git a/libs/binder/IMemory.cpp b/libs/binder/IMemory.cpp
index 2111fe8..cd2451a 100644
--- a/libs/binder/IMemory.cpp
+++ b/libs/binder/IMemory.cpp
@@ -298,11 +298,11 @@
         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 @@
             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 @@
                 mHeapCache.removeItemsAt(i);
             }
         } else {
-            LOGE("free_heap binder=%p not found!!!", binder.unsafe_get());
+            ALOGE("free_heap binder=%p not found!!!", binder.unsafe_get());
         }
     }
 }
diff --git a/libs/binder/MemoryDealer.cpp b/libs/binder/MemoryDealer.cpp
index 4b958d1..8d0e0a7 100644
--- a/libs/binder/MemoryDealer.cpp
+++ b/libs/binder/MemoryDealer.cpp
@@ -348,7 +348,7 @@
                 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!!!");
 
diff --git a/libs/binder/MemoryHeapBase.cpp b/libs/binder/MemoryHeapBase.cpp
index e171374..d1cbf1c 100644
--- a/libs/binder/MemoryHeapBase.cpp
+++ b/libs/binder/MemoryHeapBase.cpp
@@ -53,7 +53,7 @@
     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 @@
         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 @@
         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;
diff --git a/libs/binder/MemoryHeapPmem.cpp b/libs/binder/MemoryHeapPmem.cpp
index 03322ea..66bcf4d 100644
--- a/libs/binder/MemoryHeapPmem.cpp
+++ b/libs/binder/MemoryHeapPmem.cpp
@@ -79,7 +79,7 @@
         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 @@
         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 @@
 #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 @@
     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 @@
     int our_fd = getHeapID();
     struct pmem_region sub = { 0, size };
     int err = ioctl(our_fd, PMEM_UNMAP, &sub);
-    LOGE_IF(err<0, "PMEM_UNMAP failed (%s), "
+    ALOGE_IF(err<0, "PMEM_UNMAP failed (%s), "
             "mFD=%d, sub.offset=%lu, sub.size=%lu",
             strerror(errno), our_fd, sub.offset, sub.len);
     return -errno;
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index affe1a4..dea14bb 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -139,7 +139,7 @@
         }
     }
 
-    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 @@
         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 @@
             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 @@
         // 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 @@
     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 @@
         
         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;
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp
index b6d4f1a..f96fe50 100644
--- a/libs/binder/ProcessState.cpp
+++ b/libs/binder/ProcessState.cpp
@@ -109,7 +109,7 @@
 
     // 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 @@
         } 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 @@
         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 @@
         mVMStart = mmap(0, BINDER_VM_SIZE, PROT_READ, MAP_PRIVATE | MAP_NORESERVE, mDriverFD, 0);
         if (mVMStart == MAP_FAILED) {
             // *sigh*
-            LOGE("Using /dev/binder failed: unable to mmap transaction memory.\n");
+            ALOGE("Using /dev/binder failed: unable to mmap transaction memory.\n");
             close(mDriverFD);
             mDriverFD = -1;
         }
diff --git a/libs/gui/BitTube.cpp b/libs/gui/BitTube.cpp
index fa8d0ea..785da39 100644
--- a/libs/gui/BitTube.cpp
+++ b/libs/gui/BitTube.cpp
@@ -40,7 +40,7 @@
         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 @@
         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));
     }
 }
diff --git a/libs/gui/DisplayEventReceiver.cpp b/libs/gui/DisplayEventReceiver.cpp
index fee1feb..3b3ccaa 100644
--- a/libs/gui/DisplayEventReceiver.cpp
+++ b/libs/gui/DisplayEventReceiver.cpp
@@ -81,7 +81,7 @@
 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) {
diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp
index ca7c8f8..95b2379 100644
--- a/libs/gui/ISurfaceComposer.cpp
+++ b/libs/gui/ISurfaceComposer.cpp
@@ -148,27 +148,27 @@
         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 @@
                 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;
         }
diff --git a/libs/gui/SensorEventQueue.cpp b/libs/gui/SensorEventQueue.cpp
index ee21c45..b95dd90 100644
--- a/libs/gui/SensorEventQueue.cpp
+++ b/libs/gui/SensorEventQueue.cpp
@@ -70,12 +70,12 @@
 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 @@
     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;
         }
diff --git a/libs/gui/SensorManager.cpp b/libs/gui/SensorManager.cpp
index 3b39601..b80da56 100644
--- a/libs/gui/SensorManager.cpp
+++ b/libs/gui/SensorManager.cpp
@@ -137,7 +137,7 @@
                 mSensorServer->createSensorEventConnection();
         if (connection == NULL) {
             // SensorService just died.
-            LOGE("createEventQueue: connection is NULL. SensorService died.");
+            ALOGE("createEventQueue: connection is NULL. SensorService died.");
             continue;
         }
         queue = new SensorEventQueue(connection);
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp
index ff45fa3..337950c 100644
--- a/libs/gui/Surface.cpp
+++ b/libs/gui/Surface.cpp
@@ -167,7 +167,7 @@
 status_t SurfaceControl::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 @@
     } 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::init(const sp<ISurfaceTexture>& surfaceTexture)
 {
     if (mSurface != NULL || surfaceTexture != NULL) {
-        LOGE_IF(surfaceTexture==0, "got a NULL ISurfaceTexture from ISurface");
+        ALOGE_IF(surfaceTexture==0, "got a NULL ISurfaceTexture from ISurface");
         if (surfaceTexture != NULL) {
             setISurfaceTexture(surfaceTexture);
             setUsage(GraphicBuffer::USAGE_HW_RENDER);
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index 62ab92d..3abe84a 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -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 @@
         // 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 @@
                 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;
                 }
diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp
index aaff897..d0934ba 100644
--- a/libs/gui/SurfaceTextureClient.cpp
+++ b/libs/gui/SurfaceTextureClient.cpp
@@ -157,7 +157,7 @@
     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 @@
             return i;
         }
     }
-    LOGE("getSlotFromBufferLocked: unknown buffer: %p", buffer->handle);
+    ALOGE("getSlotFromBufferLocked: unknown buffer: %p", buffer->handle);
     return BAD_VALUE;
 }
 
@@ -230,7 +230,7 @@
     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 @@
     }
 
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
         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 @@
 
     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::unlockAndPost()
 {
     if (mLockedBuffer == 0) {
-        LOGE("Surface::unlockAndPost failed, no locked buffer");
+        ALOGE("Surface::unlockAndPost failed, no locked buffer");
         return INVALID_OPERATION;
     }
 
     status_t err = mLockedBuffer->unlock();
-    LOGE_IF(err, "failed unlocking buffer (%p)", mLockedBuffer->handle);
+    ALOGE_IF(err, "failed unlocking buffer (%p)", mLockedBuffer->handle);
 
     err = queueBuffer(mLockedBuffer.get());
-    LOGE_IF(err, "queueBuffer (handle=%p) failed (%s)",
+    ALOGE_IF(err, "queueBuffer (handle=%p) failed (%s)",
             mLockedBuffer->handle, strerror(-err));
 
     mPostedBuffer = mLockedBuffer;
diff --git a/libs/ui/FramebufferNativeWindow.cpp b/libs/ui/FramebufferNativeWindow.cpp
index 8949730..f5ed981 100644
--- a/libs/ui/FramebufferNativeWindow.cpp
+++ b/libs/ui/FramebufferNativeWindow.cpp
@@ -85,10 +85,10 @@
         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 @@
                         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 @@
         const_cast<int&>(ANativeWindow::maxSwapInterval) = 
             fbDev->maxSwapInterval;
     } else {
-        LOGE("Couldn't get gralloc module");
+        ALOGE("Couldn't get gralloc module");
     }
 
     ANativeWindow::setSwapInterval = setSwapInterval;
diff --git a/libs/ui/GraphicBuffer.cpp b/libs/ui/GraphicBuffer.cpp
index 54a3ffa..f549a37 100644
--- a/libs/ui/GraphicBuffer.cpp
+++ b/libs/ui/GraphicBuffer.cpp
@@ -167,7 +167,7 @@
 {
     if (rect.left < 0 || rect.right  > this->width || 
         rect.top  < 0 || rect.bottom > this->height) {
-        LOGE("locking pixels (%d,%d,%d,%d) outside of buffer (w=%d, h=%d)",
+        ALOGE("locking pixels (%d,%d,%d,%d) outside of buffer (w=%d, h=%d)",
                 rect.left, rect.top, rect.right, rect.bottom, 
                 this->width, this->height);
         return BAD_VALUE;
diff --git a/libs/ui/GraphicBufferAllocator.cpp b/libs/ui/GraphicBufferAllocator.cpp
index 466fce6..d344737 100644
--- a/libs/ui/GraphicBufferAllocator.cpp
+++ b/libs/ui/GraphicBufferAllocator.cpp
@@ -38,7 +38,7 @@
 {
     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);
     }
diff --git a/libs/ui/GraphicBufferMapper.cpp b/libs/ui/GraphicBufferMapper.cpp
index ac53da8..b173c85 100644
--- a/libs/ui/GraphicBufferMapper.cpp
+++ b/libs/ui/GraphicBufferMapper.cpp
@@ -38,7 +38,7 @@
 {
     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;
     }
diff --git a/libs/ui/InputTransport.cpp b/libs/ui/InputTransport.cpp
index 00716d7..09cbb31 100644
--- a/libs/ui/InputTransport.cpp
+++ b/libs/ui/InputTransport.cpp
@@ -88,12 +88,12 @@
     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 @@
             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 @@
     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 @@
     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 @@
             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 @@
 
             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 @@
         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 @@
         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 @@
     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 @@
 
     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 @@
 #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 @@
 #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 @@
 #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 @@
     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 @@
     } 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 @@
     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 @@
     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 @@
     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 @@
     // 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 @@
     }
 
     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 @@
         return result;
     }
     if (signal != INPUT_SIGNAL_DISPATCH) {
-        LOGE("channel '%s' consumer ~ Received unexpected signal '%c' from publisher",
+        ALOGE("channel '%s' consumer ~ Received unexpected signal '%c' from publisher",
                 mChannel->getName().string(), signal);
         return UNKNOWN_ERROR;
     }
diff --git a/libs/ui/KeyCharacterMap.cpp b/libs/ui/KeyCharacterMap.cpp
index e1d5e8b..485234c 100644
--- a/libs/ui/KeyCharacterMap.cpp
+++ b/libs/ui/KeyCharacterMap.cpp
@@ -95,11 +95,11 @@
     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 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 @@
 
             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 @@
     }
 
     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::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 @@
     } 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 @@
     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 @@
     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 @@
             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 @@
             }
         }
 
-        LOGE("%s: Expected ',' or ':' after property name.",
+        ALOGE("%s: Expected ',' or ':' after property name.",
                 mTokenizer->getLocation().string());
         return BAD_VALUE;
     }
@@ -634,12 +634,12 @@
             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 @@
             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 @@
                 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 @@
         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 @@
             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 @@
         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 @@
                 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 @@
     }
 
 Error:
-    LOGE("%s: Malformed character literal.", mTokenizer->getLocation().string());
+    ALOGE("%s: Malformed character literal.", mTokenizer->getLocation().string());
     return BAD_VALUE;
 }
 
diff --git a/libs/ui/KeyLayoutMap.cpp b/libs/ui/KeyLayoutMap.cpp
index 7ba654a..44a9420 100644
--- a/libs/ui/KeyLayoutMap.cpp
+++ b/libs/ui/KeyLayoutMap.cpp
@@ -53,11 +53,11 @@
     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 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 @@
     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 @@
     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 @@
         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 @@
     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 @@
         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 @@
         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 @@
         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 @@
         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 @@
             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;
         }
diff --git a/libs/ui/Keyboard.cpp b/libs/ui/Keyboard.cpp
index 10bb39c..e4611f7 100644
--- a/libs/ui/Keyboard.cpp
+++ b/libs/ui/Keyboard.cpp
@@ -50,7 +50,7 @@
                 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 @@
                 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 @@
     }
 
     // Give up!
-    LOGE("Could not determine key map for device '%s' and no default key maps were found!",
+    ALOGE("Could not determine key map for device '%s' and no default key maps were found!",
             deviceIdenfifier.name.string());
     return NAME_NOT_FOUND;
 }
diff --git a/libs/ui/Region.cpp b/libs/ui/Region.cpp
index d9ad863..8cd047a 100644
--- a/libs/ui/Region.cpp
+++ b/libs/ui/Region.cpp
@@ -69,7 +69,7 @@
 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 @@
         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 @@
     }
     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 @@
         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;
     }
diff --git a/libs/ui/VirtualKeyMap.cpp b/libs/ui/VirtualKeyMap.cpp
index 90c092d..62d5b59 100644
--- a/libs/ui/VirtualKeyMap.cpp
+++ b/libs/ui/VirtualKeyMap.cpp
@@ -51,11 +51,11 @@
     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 @@
             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 @@
                         && 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 @@
             } 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 @@
     char* end;
     *outValue = strtol(token.string(), &end, 0);
     if (token.isEmpty() || *end != '\0') {
-        LOGE("Expected an integer, got '%s'.", token.string());
+        ALOGE("Expected an integer, got '%s'.", token.string());
         return false;
     }
     return true;
diff --git a/libs/utils/Asset.cpp b/libs/utils/Asset.cpp
index 22af816..50e701a 100644
--- a/libs/utils/Asset.cpp
+++ b/libs/utils/Asset.cpp
@@ -473,7 +473,7 @@
         /* 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 @@
 
         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 @@
             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 @@
             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);
diff --git a/libs/utils/AssetManager.cpp b/libs/utils/AssetManager.cpp
index 8a8551f..47a2b99 100644
--- a/libs/utils/AssetManager.cpp
+++ b/libs/utils/AssetManager.cpp
@@ -1461,7 +1461,7 @@
         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());
diff --git a/libs/utils/BackupHelpers.cpp b/libs/utils/BackupHelpers.cpp
index 04b2e71..f77a891 100644
--- a/libs/utils/BackupHelpers.cpp
+++ b/libs/utils/BackupHelpers.cpp
@@ -232,7 +232,7 @@
     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 @@
                 }
             }
         }
-        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 @@
     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 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 @@
     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 @@
             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;
diff --git a/libs/utils/BlobCache.cpp b/libs/utils/BlobCache.cpp
index 0011d29..e52cf2f 100644
--- a/libs/utils/BlobCache.cpp
+++ b/libs/utils/BlobCache.cpp
@@ -183,13 +183,13 @@
 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 @@
 
         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 @@
     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 @@
     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 @@
 
         if (byteOffset + entrySize > size) {
             mCacheEntries.clear();
-            LOGE("unflatten: not enough room for cache entry headers");
+            ALOGE("unflatten: not enough room for cache entry headers");
             return BAD_VALUE;
         }
 
diff --git a/libs/utils/FileMap.cpp b/libs/utils/FileMap.cpp
index c9a423e..9ce370e 100644
--- a/libs/utils/FileMap.cpp
+++ b/libs/utils/FileMap.cpp
@@ -108,7 +108,7 @@
     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 @@
                               (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 @@
 #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 @@
     		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;
     }
diff --git a/libs/utils/Looper.cpp b/libs/utils/Looper.cpp
index 28ed0e8..d1aa664 100644
--- a/libs/utils/Looper.cpp
+++ b/libs/utils/Looper.cpp
@@ -520,12 +520,12 @@
 
     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 @@
         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 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;
         }
 
diff --git a/libs/utils/PropertyMap.cpp b/libs/utils/PropertyMap.cpp
index d801609..5520702 100644
--- a/libs/utils/PropertyMap.cpp
+++ b/libs/utils/PropertyMap.cpp
@@ -121,11 +121,11 @@
     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 @@
         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 @@
 
             String8 valueToken = mTokenizer->nextToken(WHITESPACE);
             if (valueToken.find("\\", 0) >= 0 || valueToken.find("\"", 0) >= 0) {
-                LOGE("%s: Found reserved character '\\' or '\"' in property value.",
+                ALOGE("%s: Found reserved character '\\' or '\"' in property value.",
                         mTokenizer->getLocation().string());
                 return BAD_VALUE;
             }
 
             mTokenizer->skipDelimiters(WHITESPACE);
             if (!mTokenizer->isEol()) {
-                LOGE("%s: Expected end of line, got '%s'.",
+                ALOGE("%s: Expected end of line, got '%s'.",
                         mTokenizer->getLocation().string(),
                         mTokenizer->peekRemainderOfLine().string());
                 return BAD_VALUE;
             }
 
             if (mMap->hasProperty(keyToken)) {
-                LOGE("%s: Duplicate property value for key '%s'.",
+                ALOGE("%s: Duplicate property value for key '%s'.",
                         mTokenizer->getLocation().string(), keyToken.string());
                 return BAD_VALUE;
             }
diff --git a/libs/utils/RefBase.cpp b/libs/utils/RefBase.cpp
index 0b7dd92..ad0939e 100644
--- a/libs/utils/RefBase.cpp
+++ b/libs/utils/RefBase.cpp
@@ -98,7 +98,7 @@
 #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 @@
 #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 @@
             }
         }
         if (dumpStack) {
-            LOGE("above errors at:");
+            ALOGE("above errors at:");
             CallStack stack;
             stack.update();
             stack.dump();
@@ -205,7 +205,7 @@
                 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 @@
                     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);
 
diff --git a/libs/utils/ResourceTypes.cpp b/libs/utils/ResourceTypes.cpp
index 9a8816f..15b83bb 100644
--- a/libs/utils/ResourceTypes.cpp
+++ b/libs/utils/ResourceTypes.cpp
@@ -296,7 +296,7 @@
 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 @@
         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 @@
         }
         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 @@
             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 @@
     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));
diff --git a/libs/utils/StreamingZipInflater.cpp b/libs/utils/StreamingZipInflater.cpp
index 59a46f9..8512170 100644
--- a/libs/utils/StreamingZipInflater.cpp
+++ b/libs/utils/StreamingZipInflater.cpp
@@ -138,7 +138,7 @@
             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 @@
             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 @@
             //ALOGV("Reading input chunk, size %08x didread %08x", toRead, didRead);
             if (didRead < 0) {
                 // TODO: error
-                LOGE("Error reading asset data");
+                ALOGE("Error reading asset data");
                 return didRead;
             } else {
                 mInNextChunkOffset += didRead;
diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp
index fb52d7c..e343c62 100644
--- a/libs/utils/Threads.cpp
+++ b/libs/utils/Threads.cpp
@@ -163,7 +163,7 @@
                     (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;
diff --git a/libs/utils/Tokenizer.cpp b/libs/utils/Tokenizer.cpp
index 68752b4..efda2bf 100644
--- a/libs/utils/Tokenizer.cpp
+++ b/libs/utils/Tokenizer.cpp
@@ -55,12 +55,12 @@
     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 @@
                 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 {
diff --git a/libs/utils/ZipFileRO.cpp b/libs/utils/ZipFileRO.cpp
index a6cce7e..1498aac 100644
--- a/libs/utils/ZipFileRO.cpp
+++ b/libs/utils/ZipFileRO.cpp
@@ -527,7 +527,7 @@
     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 @@
         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 @@
     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 @@
     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 @@
     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;
     }
diff --git a/libs/utils/ZipUtils.cpp b/libs/utils/ZipUtils.cpp
index 0fe1a7b..2dbdc1d 100644
--- a/libs/utils/ZipUtils.cpp
+++ b/libs/utils/ZipUtils.cpp
@@ -77,10 +77,10 @@
     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 @@
     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;
     }