Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF)  DO NOT MERGE

See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
diff --git a/libs/binder/IMemory.cpp b/libs/binder/IMemory.cpp
index 1ace8f8..2111fe8 100644
--- a/libs/binder/IMemory.cpp
+++ b/libs/binder/IMemory.cpp
@@ -244,7 +244,7 @@
                 sp<IBinder> binder = const_cast<BpMemoryHeap*>(this)->asBinder();
 
                 if (VERBOSE) {
-                    LOGD("UNMAPPING binder=%p, heap=%p, size=%d, fd=%d",
+                    ALOGD("UNMAPPING binder=%p, heap=%p, size=%d, fd=%d",
                             binder.get(), this, mSize, mHeapId);
                     CallStack stack;
                     stack.update();
@@ -393,7 +393,7 @@
 
 void HeapCache::binderDied(const wp<IBinder>& binder)
 {
-    //LOGD("binderDied binder=%p", binder.unsafe_get());
+    //ALOGD("binderDied binder=%p", binder.unsafe_get());
     free_heap(binder);
 }
 
@@ -403,7 +403,7 @@
     ssize_t i = mHeapCache.indexOfKey(binder);
     if (i>=0) {
         heap_info_t& info = mHeapCache.editValueAt(i);
-        LOGD_IF(VERBOSE,
+        ALOGD_IF(VERBOSE,
                 "found binder=%p, heap=%p, size=%d, fd=%d, count=%d",
                 binder.get(), info.heap.get(),
                 static_cast<BpMemoryHeap*>(info.heap.get())->mSize,
@@ -415,7 +415,7 @@
         heap_info_t info;
         info.heap = interface_cast<IMemoryHeap>(binder);
         info.count = 1;
-        //LOGD("adding binder=%p, heap=%p, count=%d",
+        //ALOGD("adding binder=%p, heap=%p, count=%d",
         //      binder.get(), info.heap.get(), info.count);
         mHeapCache.add(binder, info);
         return info.heap;
@@ -436,7 +436,7 @@
             heap_info_t& info(mHeapCache.editValueAt(i));
             int32_t c = android_atomic_dec(&info.count);
             if (c == 1) {
-                LOGD_IF(VERBOSE,
+                ALOGD_IF(VERBOSE,
                         "removing binder=%p, heap=%p, size=%d, fd=%d, count=%d",
                         binder.unsafe_get(), info.heap.get(),
                         static_cast<BpMemoryHeap*>(info.heap.get())->mSize,
@@ -468,7 +468,7 @@
     for (int i=0 ; i<c ; i++) {
         const heap_info_t& info = mHeapCache.valueAt(i);
         BpMemoryHeap const* h(static_cast<BpMemoryHeap const *>(info.heap.get()));
-        LOGD("hey=%p, heap=%p, count=%d, (fd=%d, base=%p, size=%d)",
+        ALOGD("hey=%p, heap=%p, count=%d, (fd=%d, base=%p, size=%d)",
                 mHeapCache.keyAt(i).unsafe_get(),
                 info.heap.get(), info.count,
                 h->mHeapId, h->mBase, h->mSize);
diff --git a/libs/binder/MemoryDealer.cpp b/libs/binder/MemoryDealer.cpp
index fc3e31e..f299924 100644
--- a/libs/binder/MemoryDealer.cpp
+++ b/libs/binder/MemoryDealer.cpp
@@ -415,7 +415,7 @@
 {
     String8 result;
     dump_l(result, what);
-    LOGD("%s", result.string());
+    ALOGD("%s", result.string());
 }
 
 void SimpleBestFitAllocator::dump(String8& result,
diff --git a/libs/binder/MemoryHeapBase.cpp b/libs/binder/MemoryHeapBase.cpp
index bf4a73f..e171374 100644
--- a/libs/binder/MemoryHeapBase.cpp
+++ b/libs/binder/MemoryHeapBase.cpp
@@ -132,7 +132,7 @@
             close(fd);
             return -errno;
         }
-        //LOGD("mmap(fd=%d, base=%p, size=%lu)", fd, base, size);
+        //ALOGD("mmap(fd=%d, base=%p, size=%lu)", fd, base, size);
         mBase = base;
         mNeedUnmap = true;
     } else  {
@@ -155,7 +155,7 @@
     int fd = android_atomic_or(-1, &mFD);
     if (fd >= 0) {
         if (mNeedUnmap) {
-            //LOGD("munmap(fd=%d, base=%p, size=%lu)", fd, mBase, mSize);
+            //ALOGD("munmap(fd=%d, base=%p, size=%lu)", fd, mBase, mSize);
             munmap(mBase, mSize);
         }
         mBase = 0;
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index 6cd43aa..4ec2243 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -103,7 +103,7 @@
         }
     }
 
-    LOGD("Invalid object type 0x%08lx", obj.type);
+    ALOGD("Invalid object type 0x%08lx", obj.type);
 }
 
 void release_object(const sp<ProcessState>& proc,
@@ -703,7 +703,7 @@
         err = writeDupFileDescriptor(handle->data[i]);
 
     if (err != NO_ERROR) {
-        LOGD("write native handle, write dup fd failed");
+        ALOGD("write native handle, write dup fd failed");
         return err;
     }
     err = write(handle->data + handle->numFds, sizeof(int)*handle->numInts);
diff --git a/libs/binder/PermissionCache.cpp b/libs/binder/PermissionCache.cpp
index 7278187..a503be8 100644
--- a/libs/binder/PermissionCache.cpp
+++ b/libs/binder/PermissionCache.cpp
@@ -101,7 +101,7 @@
         nsecs_t t = -systemTime();
         granted = android::checkPermission(permission, pid, uid);
         t += systemTime();
-        LOGD("checking %s for uid=%d => %s (%d us)",
+        ALOGD("checking %s for uid=%d => %s (%d us)",
                 String8(permission).string(), uid,
                 granted?"granted":"denied", (int)ns2us(t));
         pc.cache(permission, uid, granted);
diff --git a/libs/camera/Camera.cpp b/libs/camera/Camera.cpp
index da21d1a..eef1dd2 100644
--- a/libs/camera/Camera.cpp
+++ b/libs/camera/Camera.cpp
@@ -178,7 +178,7 @@
     if (surface != 0) {
         return c->setPreviewDisplay(surface);
     } else {
-        LOGD("app passed NULL surface");
+        ALOGD("app passed NULL surface");
         return c->setPreviewDisplay(0);
     }
 }
@@ -192,7 +192,7 @@
     if (surfaceTexture != 0) {
         return c->setPreviewTexture(surfaceTexture);
     } else {
-        LOGD("app passed NULL surface");
+        ALOGD("app passed NULL surface");
         return c->setPreviewTexture(0);
     }
 }
diff --git a/libs/camera/CameraParameters.cpp b/libs/camera/CameraParameters.cpp
index c6087b4..209d84a 100644
--- a/libs/camera/CameraParameters.cpp
+++ b/libs/camera/CameraParameters.cpp
@@ -449,12 +449,12 @@
 
 void CameraParameters::dump() const
 {
-    LOGD("dump: mMap.size = %d", mMap.size());
+    ALOGD("dump: mMap.size = %d", mMap.size());
     for (size_t i = 0; i < mMap.size(); i++) {
         String8 k, v;
         k = mMap.keyAt(i);
         v = mMap.valueAt(i);
-        LOGD("%s: %s\n", k.string(), v.string());
+        ALOGD("%s: %s\n", k.string(), v.string());
     }
 }
 
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index 4310bed..fa0ee8c 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -63,7 +63,7 @@
 
 // Macros for including the SurfaceTexture name in log messages
 #define ST_LOGV(x, ...) ALOGV("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define ST_LOGD(x, ...) LOGD("[%s] "x, mName.string(), ##__VA_ARGS__)
+#define ST_LOGD(x, ...) ALOGD("[%s] "x, mName.string(), ##__VA_ARGS__)
 #define ST_LOGI(x, ...) LOGI("[%s] "x, mName.string(), ##__VA_ARGS__)
 #define ST_LOGW(x, ...) LOGW("[%s] "x, mName.string(), ##__VA_ARGS__)
 #define ST_LOGE(x, ...) LOGE("[%s] "x, mName.string(), ##__VA_ARGS__)
diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp
index 691b52d..b6f3c11 100644
--- a/libs/gui/SurfaceTextureClient.cpp
+++ b/libs/gui/SurfaceTextureClient.cpp
@@ -185,13 +185,13 @@
         // a buffer.
         if (mSlots[i] == NULL) {
             if (!dumpedState) {
-                LOGD("getSlotFromBufferLocked: encountered NULL buffer in slot %d "
+                ALOGD("getSlotFromBufferLocked: encountered NULL buffer in slot %d "
                         "looking for buffer %p", i, buffer->handle);
                 for (int j = 0; j < NUM_BUFFER_SLOTS; j++) {
                     if (mSlots[j] == NULL) {
-                        LOGD("getSlotFromBufferLocked:   %02d: NULL", j);
+                        ALOGD("getSlotFromBufferLocked:   %02d: NULL", j);
                     } else {
-                        LOGD("getSlotFromBufferLocked:   %02d: %p", j, mSlots[j]->handle);
+                        ALOGD("getSlotFromBufferLocked:   %02d: %p", j, mSlots[j]->handle);
                     }
                 }
                 dumpedState = true;
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index b151b20..fa1e9b8 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -37,7 +37,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 #if DEBUG_CACHE_FLUSH
-    #define FLUSH_LOGD(...) LOGD(__VA_ARGS__)
+    #define FLUSH_LOGD(...) ALOGD(__VA_ARGS__)
 #else
     #define FLUSH_LOGD(...)
 #endif
@@ -58,7 +58,7 @@
     init();
 
     mDebugLevel = readDebugLevel();
-    LOGD("Enabling debug mode %d", mDebugLevel);
+    ALOGD("Enabling debug mode %d", mDebugLevel);
 
 #if RENDER_LAYERS_AS_REGIONS
     INIT_LOGD("Layers will be composited as regions");
@@ -119,7 +119,7 @@
 void Caches::dumpMemoryUsage() {
     String8 stringLog;
     dumpMemoryUsage(stringLog);
-    LOGD("%s", stringLog.string());
+    ALOGD("%s", stringLog.string());
 }
 
 void Caches::dumpMemoryUsage(String8 &log) {
diff --git a/libs/hwui/Debug.h b/libs/hwui/Debug.h
index 7cbb39d..0ad0c2a 100644
--- a/libs/hwui/Debug.h
+++ b/libs/hwui/Debug.h
@@ -66,7 +66,7 @@
 #define DEBUG_DISPLAY_LIST 0
 
 #if DEBUG_INIT
-    #define INIT_LOGD(...) LOGD(__VA_ARGS__)
+    #define INIT_LOGD(...) ALOGD(__VA_ARGS__)
 #else
     #define INIT_LOGD(...)
 #endif
diff --git a/libs/hwui/DisplayListRenderer.cpp b/libs/hwui/DisplayListRenderer.cpp
index 5a52464..b8ba23d 100644
--- a/libs/hwui/DisplayListRenderer.cpp
+++ b/libs/hwui/DisplayListRenderer.cpp
@@ -214,7 +214,7 @@
         indent[i] = ' ';
     }
     indent[count] = '\0';
-    LOGD("%sStart display list (%p)", (char*) indent + 2, this);
+    ALOGD("%sStart display list (%p)", (char*) indent + 2, this);
 
     int saveCount = renderer.getSaveCount() - 1;
 
@@ -226,21 +226,21 @@
         switch (op) {
             case DrawGLFunction: {
                 Functor *functor = (Functor *) getInt();
-                LOGD("%s%s %p", (char*) indent, OP_NAMES[op], functor);
+                ALOGD("%s%s %p", (char*) indent, OP_NAMES[op], functor);
             }
             break;
             case Save: {
                 int rendererNum = getInt();
-                LOGD("%s%s %d", (char*) indent, OP_NAMES[op], rendererNum);
+                ALOGD("%s%s %d", (char*) indent, OP_NAMES[op], rendererNum);
             }
             break;
             case Restore: {
-                LOGD("%s%s", (char*) indent, OP_NAMES[op]);
+                ALOGD("%s%s", (char*) indent, OP_NAMES[op]);
             }
             break;
             case RestoreToCount: {
                 int restoreCount = saveCount + getInt();
-                LOGD("%s%s %d", (char*) indent, OP_NAMES[op], restoreCount);
+                ALOGD("%s%s %d", (char*) indent, OP_NAMES[op], restoreCount);
             }
             break;
             case SaveLayer: {
@@ -250,7 +250,7 @@
                 float f4 = getFloat();
                 SkPaint* paint = getPaint();
                 int flags = getInt();
-                LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p, 0x%x", (char*) indent,
+                ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p, 0x%x", (char*) indent,
                     OP_NAMES[op], f1, f2, f3, f4, paint, flags);
             }
             break;
@@ -261,41 +261,41 @@
                 float f4 = getFloat();
                 int alpha = getInt();
                 int flags = getInt();
-                LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %d, 0x%x", (char*) indent,
+                ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %d, 0x%x", (char*) indent,
                     OP_NAMES[op], f1, f2, f3, f4, alpha, flags);
             }
             break;
             case Translate: {
                 float f1 = getFloat();
                 float f2 = getFloat();
-                LOGD("%s%s %.2f, %.2f", (char*) indent, OP_NAMES[op], f1, f2);
+                ALOGD("%s%s %.2f, %.2f", (char*) indent, OP_NAMES[op], f1, f2);
             }
             break;
             case Rotate: {
                 float rotation = getFloat();
-                LOGD("%s%s %.2f", (char*) indent, OP_NAMES[op], rotation);
+                ALOGD("%s%s %.2f", (char*) indent, OP_NAMES[op], rotation);
             }
             break;
             case Scale: {
                 float sx = getFloat();
                 float sy = getFloat();
-                LOGD("%s%s %.2f, %.2f", (char*) indent, OP_NAMES[op], sx, sy);
+                ALOGD("%s%s %.2f, %.2f", (char*) indent, OP_NAMES[op], sx, sy);
             }
             break;
             case Skew: {
                 float sx = getFloat();
                 float sy = getFloat();
-                LOGD("%s%s %.2f, %.2f", (char*) indent, OP_NAMES[op], sx, sy);
+                ALOGD("%s%s %.2f, %.2f", (char*) indent, OP_NAMES[op], sx, sy);
             }
             break;
             case SetMatrix: {
                 SkMatrix* matrix = getMatrix();
-                LOGD("%s%s %p", (char*) indent, OP_NAMES[op], matrix);
+                ALOGD("%s%s %p", (char*) indent, OP_NAMES[op], matrix);
             }
             break;
             case ConcatMatrix: {
                 SkMatrix* matrix = getMatrix();
-                LOGD("%s%s %p", (char*) indent, OP_NAMES[op], matrix);
+                ALOGD("%s%s %p", (char*) indent, OP_NAMES[op], matrix);
             }
             break;
             case ClipRect: {
@@ -304,7 +304,7 @@
                 float f3 = getFloat();
                 float f4 = getFloat();
                 int regionOp = getInt();
-                LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %d", (char*) indent, OP_NAMES[op],
+                ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %d", (char*) indent, OP_NAMES[op],
                     f1, f2, f3, f4, regionOp);
             }
             break;
@@ -312,7 +312,7 @@
                 DisplayList* displayList = getDisplayList();
                 uint32_t width = getUInt();
                 uint32_t height = getUInt();
-                LOGD("%s%s %p, %dx%d, %d", (char*) indent, OP_NAMES[op],
+                ALOGD("%s%s %p, %dx%d, %d", (char*) indent, OP_NAMES[op],
                     displayList, width, height, level + 1);
                 renderer.outputDisplayList(displayList, level + 1);
             }
@@ -322,7 +322,7 @@
                 float x = getFloat();
                 float y = getFloat();
                 SkPaint* paint = getPaint();
-                LOGD("%s%s %p, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op],
+                ALOGD("%s%s %p, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op],
                     layer, x, y, paint);
             }
             break;
@@ -331,7 +331,7 @@
                 float x = getFloat();
                 float y = getFloat();
                 SkPaint* paint = getPaint();
-                LOGD("%s%s %p, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op],
+                ALOGD("%s%s %p, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op],
                     bitmap, x, y, paint);
             }
             break;
@@ -339,7 +339,7 @@
                 SkBitmap* bitmap = getBitmap();
                 SkMatrix* matrix = getMatrix();
                 SkPaint* paint = getPaint();
-                LOGD("%s%s %p, %p, %p", (char*) indent, OP_NAMES[op],
+                ALOGD("%s%s %p, %p, %p", (char*) indent, OP_NAMES[op],
                     bitmap, matrix, paint);
             }
             break;
@@ -354,7 +354,7 @@
                 float f7 = getFloat();
                 float f8 = getFloat();
                 SkPaint* paint = getPaint();
-                LOGD("%s%s %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %p",
+                ALOGD("%s%s %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %p",
                     (char*) indent, OP_NAMES[op], bitmap, f1, f2, f3, f4, f5, f6, f7, f8, paint);
             }
             break;
@@ -368,7 +368,7 @@
                 bool hasColors = getInt();
                 int* colors = hasColors ? getInts(colorsCount) : NULL;
                 SkPaint* paint = getPaint();
-                LOGD("%s%s", (char*) indent, OP_NAMES[op]);
+                ALOGD("%s%s", (char*) indent, OP_NAMES[op]);
             }
             break;
             case DrawPatch: {
@@ -387,14 +387,14 @@
                 float right = getFloat();
                 float bottom = getFloat();
                 SkPaint* paint = getPaint();
-                LOGD("%s%s %.2f, %.2f, %.2f, %.2f", (char*) indent, OP_NAMES[op],
+                ALOGD("%s%s %.2f, %.2f, %.2f, %.2f", (char*) indent, OP_NAMES[op],
                         left, top, right, bottom);
             }
             break;
             case DrawColor: {
                 int color = getInt();
                 int xferMode = getInt();
-                LOGD("%s%s 0x%x %d", (char*) indent, OP_NAMES[op], color, xferMode);
+                ALOGD("%s%s 0x%x %d", (char*) indent, OP_NAMES[op], color, xferMode);
             }
             break;
             case DrawRect: {
@@ -403,7 +403,7 @@
                 float f3 = getFloat();
                 float f4 = getFloat();
                 SkPaint* paint = getPaint();
-                LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op],
+                ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p", (char*) indent, OP_NAMES[op],
                     f1, f2, f3, f4, paint);
             }
             break;
@@ -415,7 +415,7 @@
                 float f5 = getFloat();
                 float f6 = getFloat();
                 SkPaint* paint = getPaint();
-                LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %p",
+                ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %p",
                     (char*) indent, OP_NAMES[op], f1, f2, f3, f4, f5, f6, paint);
             }
             break;
@@ -424,7 +424,7 @@
                 float f2 = getFloat();
                 float f3 = getFloat();
                 SkPaint* paint = getPaint();
-                LOGD("%s%s %.2f, %.2f, %.2f, %p",
+                ALOGD("%s%s %.2f, %.2f, %.2f, %p",
                     (char*) indent, OP_NAMES[op], f1, f2, f3, paint);
             }
             break;
@@ -434,7 +434,7 @@
                 float f3 = getFloat();
                 float f4 = getFloat();
                 SkPaint* paint = getPaint();
-                LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p",
+                ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %p",
                     (char*) indent, OP_NAMES[op], f1, f2, f3, f4, paint);
             }
             break;
@@ -447,28 +447,28 @@
                 float f6 = getFloat();
                 int i1 = getInt();
                 SkPaint* paint = getPaint();
-                LOGD("%s%s %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %d, %p",
+                ALOGD("%s%s %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %d, %p",
                     (char*) indent, OP_NAMES[op], f1, f2, f3, f4, f5, f6, i1, paint);
             }
             break;
             case DrawPath: {
                 SkPath* path = getPath();
                 SkPaint* paint = getPaint();
-                LOGD("%s%s %p, %p", (char*) indent, OP_NAMES[op], path, paint);
+                ALOGD("%s%s %p, %p", (char*) indent, OP_NAMES[op], path, paint);
             }
             break;
             case DrawLines: {
                 int count = 0;
                 float* points = getFloats(count);
                 SkPaint* paint = getPaint();
-                LOGD("%s%s", (char*) indent, OP_NAMES[op]);
+                ALOGD("%s%s", (char*) indent, OP_NAMES[op]);
             }
             break;
             case DrawPoints: {
                 int count = 0;
                 float* points = getFloats(count);
                 SkPaint* paint = getPaint();
-                LOGD("%s%s", (char*) indent, OP_NAMES[op]);
+                ALOGD("%s%s", (char*) indent, OP_NAMES[op]);
             }
             break;
             case DrawText: {
@@ -478,30 +478,30 @@
                 float y = getFloat();
                 SkPaint* paint = getPaint();
                 float length = getFloat();
-                LOGD("%s%s %s, %d, %d, %.2f, %.2f, %p, %.2f", (char*) indent, OP_NAMES[op],
+                ALOGD("%s%s %s, %d, %d, %.2f, %.2f, %p, %.2f", (char*) indent, OP_NAMES[op],
                     text.text(), text.length(), count, x, y, paint, length);
             }
             break;
             case ResetShader: {
-                LOGD("%s%s", (char*) indent, OP_NAMES[op]);
+                ALOGD("%s%s", (char*) indent, OP_NAMES[op]);
             }
             break;
             case SetupShader: {
                 SkiaShader* shader = getShader();
-                LOGD("%s%s %p", (char*) indent, OP_NAMES[op], shader);
+                ALOGD("%s%s %p", (char*) indent, OP_NAMES[op], shader);
             }
             break;
             case ResetColorFilter: {
-                LOGD("%s%s", (char*) indent, OP_NAMES[op]);
+                ALOGD("%s%s", (char*) indent, OP_NAMES[op]);
             }
             break;
             case SetupColorFilter: {
                 SkiaColorFilter *colorFilter = getColorFilter();
-                LOGD("%s%s %p", (char*) indent, OP_NAMES[op], colorFilter);
+                ALOGD("%s%s %p", (char*) indent, OP_NAMES[op], colorFilter);
             }
             break;
             case ResetShadow: {
-                LOGD("%s%s", (char*) indent, OP_NAMES[op]);
+                ALOGD("%s%s", (char*) indent, OP_NAMES[op]);
             }
             break;
             case SetupShadow: {
@@ -509,18 +509,18 @@
                 float dx = getFloat();
                 float dy = getFloat();
                 int color = getInt();
-                LOGD("%s%s %.2f, %.2f, %.2f, 0x%x", (char*) indent, OP_NAMES[op],
+                ALOGD("%s%s %.2f, %.2f, %.2f, 0x%x", (char*) indent, OP_NAMES[op],
                     radius, dx, dy, color);
             }
             break;
             default:
-                LOGD("Display List error: op not handled: %s%s",
+                ALOGD("Display List error: op not handled: %s%s",
                     (char*) indent, OP_NAMES[op]);
                 break;
         }
     }
 
-    LOGD("%sDone", (char*) indent + 2);
+    ALOGD("%sDone", (char*) indent + 2);
 }
 
 /**
diff --git a/libs/hwui/DisplayListRenderer.h b/libs/hwui/DisplayListRenderer.h
index c09760e..5d922db 100644
--- a/libs/hwui/DisplayListRenderer.h
+++ b/libs/hwui/DisplayListRenderer.h
@@ -43,7 +43,7 @@
 
 // Debug
 #if DEBUG_DISPLAY_LIST
-    #define DISPLAY_LIST_LOGD(...) LOGD(__VA_ARGS__)
+    #define DISPLAY_LIST_LOGD(...) ALOGD(__VA_ARGS__)
 #else
     #define DISPLAY_LIST_LOGD(...)
 #endif
diff --git a/libs/hwui/Extensions.h b/libs/hwui/Extensions.h
index 48e4247..1069e3f 100644
--- a/libs/hwui/Extensions.h
+++ b/libs/hwui/Extensions.h
@@ -34,7 +34,7 @@
 
 // Debug
 #if DEBUG_EXTENSIONS
-    #define EXT_LOGD(...) LOGD(__VA_ARGS__)
+    #define EXT_LOGD(...) ALOGD(__VA_ARGS__)
 #else
     #define EXT_LOGD(...)
 #endif
@@ -89,7 +89,7 @@
     }
 
     void dump() {
-        LOGD("Supported extensions:\n%s", mExtensions);
+        ALOGD("Supported extensions:\n%s", mExtensions);
     }
 
 private:
diff --git a/libs/hwui/LayerCache.h b/libs/hwui/LayerCache.h
index c14c9ca..fd698e2 100644
--- a/libs/hwui/LayerCache.h
+++ b/libs/hwui/LayerCache.h
@@ -31,7 +31,7 @@
 
 // Debug
 #if DEBUG_LAYERS
-    #define LAYER_LOGD(...) LOGD(__VA_ARGS__)
+    #define LAYER_LOGD(...) ALOGD(__VA_ARGS__)
 #else
     #define LAYER_LOGD(...)
 #endif
diff --git a/libs/hwui/LayerRenderer.cpp b/libs/hwui/LayerRenderer.cpp
index 38630b8..f122396 100644
--- a/libs/hwui/LayerRenderer.cpp
+++ b/libs/hwui/LayerRenderer.cpp
@@ -217,7 +217,7 @@
         layer->allocateTexture(GL_RGBA, GL_UNSIGNED_BYTE);
 
         if (glGetError() != GL_NO_ERROR) {
-            LOGD("Could not allocate texture for layer (fbo=%d %dx%d)",
+            ALOGD("Could not allocate texture for layer (fbo=%d %dx%d)",
                     fbo, width, height);
 
             glBindFramebuffer(GL_FRAMEBUFFER, previousFbo);
@@ -463,7 +463,7 @@
 
 #if DEBUG_OPENGL
         if (error != GL_NO_ERROR) {
-            LOGD("GL error while copying layer into bitmap = 0x%x", error);
+            ALOGD("GL error while copying layer into bitmap = 0x%x", error);
         }
 #endif
 
diff --git a/libs/hwui/LayerRenderer.h b/libs/hwui/LayerRenderer.h
index 72d8d81..c461ea7 100644
--- a/libs/hwui/LayerRenderer.h
+++ b/libs/hwui/LayerRenderer.h
@@ -33,7 +33,7 @@
 
 // Debug
 #if DEBUG_LAYER_RENDERER
-    #define LAYER_RENDERER_LOGD(...) LOGD(__VA_ARGS__)
+    #define LAYER_RENDERER_LOGD(...) ALOGD(__VA_ARGS__)
 #else
     #define LAYER_RENDERER_LOGD(...)
 #endif
diff --git a/libs/hwui/Matrix.cpp b/libs/hwui/Matrix.cpp
index 769c99c..a8f937d 100644
--- a/libs/hwui/Matrix.cpp
+++ b/libs/hwui/Matrix.cpp
@@ -374,12 +374,12 @@
 }
 
 void Matrix4::dump() const {
-    LOGD("Matrix4[simple=%d", mSimpleMatrix);
-    LOGD("  %f %f %f %f", data[kScaleX], data[kSkewX], data[8], data[kTranslateX]);
-    LOGD("  %f %f %f %f", data[kSkewY], data[kScaleY], data[9], data[kTranslateY]);
-    LOGD("  %f %f %f %f", data[2], data[6], data[kScaleZ], data[kTranslateZ]);
-    LOGD("  %f %f %f %f", data[kPerspective0], data[kPerspective1], data[11], data[kPerspective2]);
-    LOGD("]");
+    ALOGD("Matrix4[simple=%d", mSimpleMatrix);
+    ALOGD("  %f %f %f %f", data[kScaleX], data[kSkewX], data[8], data[kTranslateX]);
+    ALOGD("  %f %f %f %f", data[kSkewY], data[kScaleY], data[9], data[kTranslateY]);
+    ALOGD("  %f %f %f %f", data[2], data[6], data[kScaleZ], data[kTranslateZ]);
+    ALOGD("  %f %f %f %f", data[kPerspective0], data[kPerspective1], data[11], data[kPerspective2]);
+    ALOGD("]");
 }
 
 }; // namespace uirenderer
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index d1b469f..9101953 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -169,7 +169,7 @@
 #if DEBUG_OPENGL
     GLenum status = GL_NO_ERROR;
     while ((status = glGetError()) != GL_NO_ERROR) {
-        LOGD("GL error from OpenGLRenderer: 0x%x", status);
+        ALOGD("GL error from OpenGLRenderer: 0x%x", status);
         switch (status) {
             case GL_OUT_OF_MEMORY:
                 LOGE("  OpenGLRenderer is out of memory!");
@@ -2122,7 +2122,7 @@
 
     FontRenderer& fontRenderer = mCaches.fontRenderer.getFontRenderer(paint);
 #if DEBUG_GLYPHS
-    LOGD("OpenGLRenderer drawText() with FontID=%d", SkTypeface::UniqueID(paint->getTypeface()));
+    ALOGD("OpenGLRenderer drawText() with FontID=%d", SkTypeface::UniqueID(paint->getTypeface()));
 #endif
     fontRenderer.setFont(paint, SkTypeface::UniqueID(paint->getTypeface()),
             paint->getTextSize());
diff --git a/libs/hwui/PatchCache.h b/libs/hwui/PatchCache.h
index 91b603f..505798a 100644
--- a/libs/hwui/PatchCache.h
+++ b/libs/hwui/PatchCache.h
@@ -32,7 +32,7 @@
 
 // Debug
 #if DEBUG_PATCHES
-    #define PATCH_LOGD(...) LOGD(__VA_ARGS__)
+    #define PATCH_LOGD(...) ALOGD(__VA_ARGS__)
 #else
     #define PATCH_LOGD(...)
 #endif
diff --git a/libs/hwui/Program.h b/libs/hwui/Program.h
index eed909d..eb9ee7b 100644
--- a/libs/hwui/Program.h
+++ b/libs/hwui/Program.h
@@ -36,7 +36,7 @@
 
 // Debug
 #if DEBUG_PROGRAMS
-    #define PROGRAM_LOGD(...) LOGD(__VA_ARGS__)
+    #define PROGRAM_LOGD(...) ALOGD(__VA_ARGS__)
 #else
     #define PROGRAM_LOGD(...)
 #endif
diff --git a/libs/hwui/ProgramCache.h b/libs/hwui/ProgramCache.h
index e3ed79e..6cfe0c7 100644
--- a/libs/hwui/ProgramCache.h
+++ b/libs/hwui/ProgramCache.h
@@ -36,7 +36,7 @@
 
 // Debug
 #if DEBUG_PROGRAMS
-    #define PROGRAM_LOGD(...) LOGD(__VA_ARGS__)
+    #define PROGRAM_LOGD(...) ALOGD(__VA_ARGS__)
 #else
     #define PROGRAM_LOGD(...)
 #endif
diff --git a/libs/hwui/Rect.h b/libs/hwui/Rect.h
index fff9f6c..2ca4f50 100644
--- a/libs/hwui/Rect.h
+++ b/libs/hwui/Rect.h
@@ -167,7 +167,7 @@
     }
 
     void dump() const {
-        LOGD("Rect[l=%f t=%f r=%f b=%f]", left, top, right, bottom);
+        ALOGD("Rect[l=%f t=%f r=%f b=%f]", left, top, right, bottom);
     }
 
 private:
diff --git a/libs/hwui/ResourceCache.cpp b/libs/hwui/ResourceCache.cpp
index ee73983..9ffad88 100644
--- a/libs/hwui/ResourceCache.cpp
+++ b/libs/hwui/ResourceCache.cpp
@@ -26,12 +26,12 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 void ResourceCache::logCache() {
-    LOGD("ResourceCache: cacheReport:");
+    ALOGD("ResourceCache: cacheReport:");
     for (size_t i = 0; i < mCache->size(); ++i) {
         ResourceReference* ref = mCache->valueAt(i);
-        LOGD("  ResourceCache: mCache(%d): resource, ref = 0x%p, 0x%p",
+        ALOGD("  ResourceCache: mCache(%d): resource, ref = 0x%p, 0x%p",
                 i, mCache->keyAt(i), mCache->valueAt(i));
-        LOGD("  ResourceCache: mCache(%d): refCount, recycled, destroyed, type = %d, %d, %d, %d",
+        ALOGD("  ResourceCache: mCache(%d): refCount, recycled, destroyed, type = %d, %d, %d, %d",
                 i, ref->refCount, ref->recycled, ref->destroyed, ref->resourceType);
     }
 }
diff --git a/libs/hwui/ShapeCache.h b/libs/hwui/ShapeCache.h
index f64c074..2c0f3ab 100644
--- a/libs/hwui/ShapeCache.h
+++ b/libs/hwui/ShapeCache.h
@@ -40,7 +40,7 @@
 
 // Debug
 #if DEBUG_SHAPES
-    #define SHAPE_LOGD(...) LOGD(__VA_ARGS__)
+    #define SHAPE_LOGD(...) ALOGD(__VA_ARGS__)
 #else
     #define SHAPE_LOGD(...)
 #endif
@@ -481,7 +481,7 @@
         SHAPE_LOGD("ShapeCache::callback: delete %s: name, size, mSize = %d, %d, %d",
                 mName, texture->id, size, mSize);
         if (mDebugEnabled) {
-            LOGD("Shape %s deleted, size = %d", mName, size);
+            ALOGD("Shape %s deleted, size = %d", mName, size);
         }
 
         glDeleteTextures(1, &texture->id);
@@ -552,7 +552,7 @@
         SHAPE_LOGD("ShapeCache::get: create %s: name, size, mSize = %d, %d, %d",
                 mName, texture->id, size, mSize);
         if (mDebugEnabled) {
-            LOGD("Shape %s created, size = %d", mName, size);
+            ALOGD("Shape %s created, size = %d", mName, size);
         }
         mCache.put(entry, texture);
     } else {
diff --git a/libs/hwui/TextDropShadowCache.cpp b/libs/hwui/TextDropShadowCache.cpp
index bbefec6..bef1373 100644
--- a/libs/hwui/TextDropShadowCache.cpp
+++ b/libs/hwui/TextDropShadowCache.cpp
@@ -85,7 +85,7 @@
         mSize -= texture->bitmapSize;
 
         if (mDebugEnabled) {
-            LOGD("Shadow texture deleted, size = %d", texture->bitmapSize);
+            ALOGD("Shadow texture deleted, size = %d", texture->bitmapSize);
         }
 
         glDeleteTextures(1, &texture->id);
@@ -142,7 +142,7 @@
 
         if (size < mMaxSize) {
             if (mDebugEnabled) {
-                LOGD("Shadow texture created, size = %d", texture->bitmapSize);
+                ALOGD("Shadow texture created, size = %d", texture->bitmapSize);
             }
 
             entry.copyTextLocally();
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp
index 60f4ca1..237911b 100644
--- a/libs/hwui/TextureCache.cpp
+++ b/libs/hwui/TextureCache.cpp
@@ -109,7 +109,7 @@
         TEXTURE_LOGD("TextureCache::callback: name, removed size, mSize = %d, %d, %d",
                 texture->id, texture->bitmapSize, mSize);
         if (mDebugEnabled) {
-            LOGD("Texture deleted, size = %d", texture->bitmapSize);
+            ALOGD("Texture deleted, size = %d", texture->bitmapSize);
         }
         glDeleteTextures(1, &texture->id);
         delete texture;
@@ -147,7 +147,7 @@
             TEXTURE_LOGD("TextureCache::get: create texture(%p): name, size, mSize = %d, %d, %d",
                      bitmap, texture->id, size, mSize);
             if (mDebugEnabled) {
-                LOGD("Texture created, size = %d", size);
+                ALOGD("Texture created, size = %d", size);
             }
             mCache.put(bitmap, texture);
         } else {
diff --git a/libs/hwui/TextureCache.h b/libs/hwui/TextureCache.h
index ce924b4..d879392 100644
--- a/libs/hwui/TextureCache.h
+++ b/libs/hwui/TextureCache.h
@@ -34,7 +34,7 @@
 
 // Debug
 #if DEBUG_TEXTURES
-    #define TEXTURE_LOGD(...) LOGD(__VA_ARGS__)
+    #define TEXTURE_LOGD(...) ALOGD(__VA_ARGS__)
 #else
     #define TEXTURE_LOGD(...)
 #endif
diff --git a/libs/hwui/Vector.h b/libs/hwui/Vector.h
index 46dded5..497924e 100644
--- a/libs/hwui/Vector.h
+++ b/libs/hwui/Vector.h
@@ -103,7 +103,7 @@
     }
 
     void dump() {
-        LOGD("Vector2[%.2f, %.2f]", x, y);
+        ALOGD("Vector2[%.2f, %.2f]", x, y);
     }
 }; // class Vector2
 
diff --git a/libs/rs/driver/rsdRuntimeStubs.cpp b/libs/rs/driver/rsdRuntimeStubs.cpp
index 90c8928..b457d8b 100644
--- a/libs/rs/driver/rsdRuntimeStubs.cpp
+++ b/libs/rs/driver/rsdRuntimeStubs.cpp
@@ -439,51 +439,51 @@
 }
 
 static void SC_debugF(const char *s, float f) {
-    LOGD("%s %f, 0x%08x", s, f, *((int *) (&f)));
+    ALOGD("%s %f, 0x%08x", s, f, *((int *) (&f)));
 }
 static void SC_debugFv2(const char *s, float f1, float f2) {
-    LOGD("%s {%f, %f}", s, f1, f2);
+    ALOGD("%s {%f, %f}", s, f1, f2);
 }
 static void SC_debugFv3(const char *s, float f1, float f2, float f3) {
-    LOGD("%s {%f, %f, %f}", s, f1, f2, f3);
+    ALOGD("%s {%f, %f, %f}", s, f1, f2, f3);
 }
 static void SC_debugFv4(const char *s, float f1, float f2, float f3, float f4) {
-    LOGD("%s {%f, %f, %f, %f}", s, f1, f2, f3, f4);
+    ALOGD("%s {%f, %f, %f, %f}", s, f1, f2, f3, f4);
 }
 static void SC_debugD(const char *s, double d) {
-    LOGD("%s %f, 0x%08llx", s, d, *((long long *) (&d)));
+    ALOGD("%s %f, 0x%08llx", s, d, *((long long *) (&d)));
 }
 static void SC_debugFM4v4(const char *s, const float *f) {
-    LOGD("%s {%f, %f, %f, %f", s, f[0], f[4], f[8], f[12]);
-    LOGD("%s  %f, %f, %f, %f", s, f[1], f[5], f[9], f[13]);
-    LOGD("%s  %f, %f, %f, %f", s, f[2], f[6], f[10], f[14]);
-    LOGD("%s  %f, %f, %f, %f}", s, f[3], f[7], f[11], f[15]);
+    ALOGD("%s {%f, %f, %f, %f", s, f[0], f[4], f[8], f[12]);
+    ALOGD("%s  %f, %f, %f, %f", s, f[1], f[5], f[9], f[13]);
+    ALOGD("%s  %f, %f, %f, %f", s, f[2], f[6], f[10], f[14]);
+    ALOGD("%s  %f, %f, %f, %f}", s, f[3], f[7], f[11], f[15]);
 }
 static void SC_debugFM3v3(const char *s, const float *f) {
-    LOGD("%s {%f, %f, %f", s, f[0], f[3], f[6]);
-    LOGD("%s  %f, %f, %f", s, f[1], f[4], f[7]);
-    LOGD("%s  %f, %f, %f}",s, f[2], f[5], f[8]);
+    ALOGD("%s {%f, %f, %f", s, f[0], f[3], f[6]);
+    ALOGD("%s  %f, %f, %f", s, f[1], f[4], f[7]);
+    ALOGD("%s  %f, %f, %f}",s, f[2], f[5], f[8]);
 }
 static void SC_debugFM2v2(const char *s, const float *f) {
-    LOGD("%s {%f, %f", s, f[0], f[2]);
-    LOGD("%s  %f, %f}",s, f[1], f[3]);
+    ALOGD("%s {%f, %f", s, f[0], f[2]);
+    ALOGD("%s  %f, %f}",s, f[1], f[3]);
 }
 
 static void SC_debugI32(const char *s, int32_t i) {
-    LOGD("%s %i  0x%x", s, i, i);
+    ALOGD("%s %i  0x%x", s, i, i);
 }
 static void SC_debugU32(const char *s, uint32_t i) {
-    LOGD("%s %u  0x%x", s, i, i);
+    ALOGD("%s %u  0x%x", s, i, i);
 }
 static void SC_debugLL64(const char *s, long long ll) {
-    LOGD("%s %lld  0x%llx", s, ll, ll);
+    ALOGD("%s %lld  0x%llx", s, ll, ll);
 }
 static void SC_debugULL64(const char *s, unsigned long long ll) {
-    LOGD("%s %llu  0x%llx", s, ll, ll);
+    ALOGD("%s %llu  0x%llx", s, ll, ll);
 }
 
 static void SC_debugP(const char *s, const void *p) {
-    LOGD("%s %p", s, p);
+    ALOGD("%s %p", s, p);
 }
 
 
diff --git a/libs/storage/IMountService.cpp b/libs/storage/IMountService.cpp
index 8ddbeae..4ec8b25 100644
--- a/libs/storage/IMountService.cpp
+++ b/libs/storage/IMountService.cpp
@@ -66,12 +66,12 @@
         data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
         data.writeStrongBinder(listener->asBinder());
         if (remote()->transact(TRANSACTION_registerListener, data, &reply) != NO_ERROR) {
-            LOGD("registerListener could not contact remote\n");
+            ALOGD("registerListener could not contact remote\n");
             return;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("registerListener caught exception %d\n", err);
+            ALOGD("registerListener caught exception %d\n", err);
             return;
         }
     }
@@ -82,12 +82,12 @@
         data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
         data.writeStrongBinder(listener->asBinder());
         if (remote()->transact(TRANSACTION_unregisterListener, data, &reply) != NO_ERROR) {
-            LOGD("unregisterListener could not contact remote\n");
+            ALOGD("unregisterListener could not contact remote\n");
             return;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("unregisterListener caught exception %d\n", err);
+            ALOGD("unregisterListener caught exception %d\n", err);
             return;
         }
     }
@@ -97,12 +97,12 @@
         Parcel data, reply;
         data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
         if (remote()->transact(TRANSACTION_isUsbMassStorageConnected, data, &reply) != NO_ERROR) {
-            LOGD("isUsbMassStorageConnected could not contact remote\n");
+            ALOGD("isUsbMassStorageConnected could not contact remote\n");
             return false;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("isUsbMassStorageConnected caught exception %d\n", err);
+            ALOGD("isUsbMassStorageConnected caught exception %d\n", err);
             return false;
         }
         return reply.readInt32() != 0;
@@ -114,12 +114,12 @@
         data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
         data.writeInt32(enable != 0);
         if (remote()->transact(TRANSACTION_setUsbMassStorageEnabled, data, &reply) != NO_ERROR) {
-            LOGD("setUsbMassStorageEnabled could not contact remote\n");
+            ALOGD("setUsbMassStorageEnabled could not contact remote\n");
             return;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("setUsbMassStorageEnabled caught exception %d\n", err);
+            ALOGD("setUsbMassStorageEnabled caught exception %d\n", err);
             return;
         }
     }
@@ -129,12 +129,12 @@
         Parcel data, reply;
         data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
         if (remote()->transact(TRANSACTION_isUsbMassStorageEnabled, data, &reply) != NO_ERROR) {
-            LOGD("isUsbMassStorageEnabled could not contact remote\n");
+            ALOGD("isUsbMassStorageEnabled could not contact remote\n");
             return false;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("isUsbMassStorageEnabled caught exception %d\n", err);
+            ALOGD("isUsbMassStorageEnabled caught exception %d\n", err);
             return false;
         }
         return reply.readInt32() != 0;
@@ -146,12 +146,12 @@
         data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
         data.writeString16(mountPoint);
         if (remote()->transact(TRANSACTION_mountVolume, data, &reply) != NO_ERROR) {
-            LOGD("mountVolume could not contact remote\n");
+            ALOGD("mountVolume could not contact remote\n");
             return -1;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("mountVolume caught exception %d\n", err);
+            ALOGD("mountVolume caught exception %d\n", err);
             return err;
         }
         return reply.readInt32();
@@ -165,12 +165,12 @@
         data.writeInt32(force ? 1 : 0);
         data.writeInt32(removeEncryption ? 1 : 0);
         if (remote()->transact(TRANSACTION_unmountVolume, data, &reply) != NO_ERROR) {
-            LOGD("unmountVolume could not contact remote\n");
+            ALOGD("unmountVolume could not contact remote\n");
             return -1;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("unmountVolume caught exception %d\n", err);
+            ALOGD("unmountVolume caught exception %d\n", err);
             return err;
         }
         return reply.readInt32();
@@ -182,12 +182,12 @@
         data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
         data.writeString16(mountPoint);
         if (remote()->transact(TRANSACTION_formatVolume, data, &reply) != NO_ERROR) {
-            LOGD("formatVolume could not contact remote\n");
+            ALOGD("formatVolume could not contact remote\n");
             return -1;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("formatVolume caught exception %d\n", err);
+            ALOGD("formatVolume caught exception %d\n", err);
             return err;
         }
         return reply.readInt32();
@@ -199,12 +199,12 @@
         data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
         data.writeString16(mountPoint);
         if (remote()->transact(TRANSACTION_getStorageUsers, data, &reply) != NO_ERROR) {
-            LOGD("getStorageUsers could not contact remote\n");
+            ALOGD("getStorageUsers could not contact remote\n");
             return -1;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("getStorageUsers caught exception %d\n", err);
+            ALOGD("getStorageUsers caught exception %d\n", err);
             return err;
         }
         const int32_t numUsers = reply.readInt32();
@@ -221,12 +221,12 @@
         data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
         data.writeString16(mountPoint);
         if (remote()->transact(TRANSACTION_getVolumeState, data, &reply) != NO_ERROR) {
-            LOGD("getVolumeState could not contact remote\n");
+            ALOGD("getVolumeState could not contact remote\n");
             return -1;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("getVolumeState caught exception %d\n", err);
+            ALOGD("getVolumeState caught exception %d\n", err);
             return err;
         }
         return reply.readInt32();
@@ -243,12 +243,12 @@
         data.writeString16(key);
         data.writeInt32(ownerUid);
         if (remote()->transact(TRANSACTION_createSecureContainer, data, &reply) != NO_ERROR) {
-            LOGD("createSecureContainer could not contact remote\n");
+            ALOGD("createSecureContainer could not contact remote\n");
             return -1;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("createSecureContainer caught exception %d\n", err);
+            ALOGD("createSecureContainer caught exception %d\n", err);
             return err;
         }
         return reply.readInt32();
@@ -260,12 +260,12 @@
         data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
         data.writeString16(id);
         if (remote()->transact(TRANSACTION_finalizeSecureContainer, data, &reply) != NO_ERROR) {
-            LOGD("finalizeSecureContainer couldn't call remote\n");
+            ALOGD("finalizeSecureContainer couldn't call remote\n");
             return -1;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("finalizeSecureContainer caught exception %d\n", err);
+            ALOGD("finalizeSecureContainer caught exception %d\n", err);
             return err;
         }
         return reply.readInt32();
@@ -277,12 +277,12 @@
         data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
         data.writeString16(id);
         if (remote()->transact(TRANSACTION_destroySecureContainer, data, &reply) != NO_ERROR) {
-            LOGD("destroySecureContainer couldn't call remote");
+            ALOGD("destroySecureContainer couldn't call remote");
             return -1;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("destroySecureContainer caught exception %d\n", err);
+            ALOGD("destroySecureContainer caught exception %d\n", err);
             return err;
         }
         return reply.readInt32();
@@ -296,12 +296,12 @@
         data.writeString16(key);
         data.writeInt32(ownerUid);
         if (remote()->transact(TRANSACTION_mountSecureContainer, data, &reply) != NO_ERROR) {
-            LOGD("mountSecureContainer couldn't call remote");
+            ALOGD("mountSecureContainer couldn't call remote");
             return -1;
         }
         int32_t err = reply.readExceptionCode(); // What to do...
         if (err < 0) {
-            LOGD("mountSecureContainer caught exception %d\n", err);
+            ALOGD("mountSecureContainer caught exception %d\n", err);
             return err;
         }
         return reply.readInt32();
@@ -314,12 +314,12 @@
         data.writeString16(id);
         data.writeInt32(force ? 1 : 0);
         if (remote()->transact(TRANSACTION_getSecureContainerPath, data, &reply) != NO_ERROR) {
-            LOGD("unmountSecureContainer couldn't call remote");
+            ALOGD("unmountSecureContainer couldn't call remote");
             return -1;
         }
         int32_t err = reply.readExceptionCode(); // What to do...
         if (err < 0) {
-            LOGD("unmountSecureContainer caught exception %d\n", err);
+            ALOGD("unmountSecureContainer caught exception %d\n", err);
             return err;
         }
         return reply.readInt32();
@@ -331,12 +331,12 @@
         data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
         data.writeString16(id);
         if (remote()->transact(TRANSACTION_isSecureContainerMounted, data, &reply) != NO_ERROR) {
-            LOGD("isSecureContainerMounted couldn't call remote");
+            ALOGD("isSecureContainerMounted couldn't call remote");
             return false;
         }
         int32_t err = reply.readExceptionCode(); // What to do...
         if (err < 0) {
-            LOGD("isSecureContainerMounted caught exception %d\n", err);
+            ALOGD("isSecureContainerMounted caught exception %d\n", err);
             return false;
         }
         return reply.readInt32() != 0;
@@ -349,12 +349,12 @@
         data.writeString16(oldId);
         data.writeString16(newId);
         if (remote()->transact(TRANSACTION_renameSecureContainer, data, &reply) != NO_ERROR) {
-            LOGD("renameSecureContainer couldn't call remote");
+            ALOGD("renameSecureContainer couldn't call remote");
             return -1;
         }
         int32_t err = reply.readExceptionCode(); // What to do...
         if (err < 0) {
-            LOGD("renameSecureContainer caught exception %d\n", err);
+            ALOGD("renameSecureContainer caught exception %d\n", err);
             return err;
         }
         return reply.readInt32();
@@ -366,12 +366,12 @@
         data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
         data.writeString16(id);
         if (remote()->transact(TRANSACTION_getSecureContainerPath, data, &reply) != NO_ERROR) {
-            LOGD("getSecureContainerPath couldn't call remote");
+            ALOGD("getSecureContainerPath couldn't call remote");
             return false;
         }
         int32_t err = reply.readExceptionCode(); // What to do...
         if (err < 0) {
-            LOGD("getSecureContainerPath caught exception %d\n", err);
+            ALOGD("getSecureContainerPath caught exception %d\n", err);
             return false;
         }
         path = reply.readString16();
@@ -384,12 +384,12 @@
         data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
         data.writeString16(id);
         if (remote()->transact(TRANSACTION_getSecureContainerList, data, &reply) != NO_ERROR) {
-            LOGD("getSecureContainerList couldn't call remote");
+            ALOGD("getSecureContainerList couldn't call remote");
             return -1;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("getSecureContainerList caught exception %d\n", err);
+            ALOGD("getSecureContainerList caught exception %d\n", err);
             return err;
         }
         const int32_t numStrings = reply.readInt32();
@@ -406,12 +406,12 @@
         data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
         data.writeStrongBinder(observer->asBinder());
         if (remote()->transact(TRANSACTION_shutdown, data, &reply) != NO_ERROR) {
-            LOGD("shutdown could not contact remote\n");
+            ALOGD("shutdown could not contact remote\n");
             return;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("shutdown caught exception %d\n", err);
+            ALOGD("shutdown caught exception %d\n", err);
             return;
         }
         reply.readExceptionCode();
@@ -422,12 +422,12 @@
         Parcel data, reply;
         data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
         if (remote()->transact(TRANSACTION_finishMediaUpdate, data, &reply) != NO_ERROR) {
-            LOGD("finishMediaUpdate could not contact remote\n");
+            ALOGD("finishMediaUpdate could not contact remote\n");
             return;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("finishMediaUpdate caught exception %d\n", err);
+            ALOGD("finishMediaUpdate caught exception %d\n", err);
             return;
         }
         reply.readExceptionCode();
@@ -443,12 +443,12 @@
         data.writeStrongBinder(token->asBinder());
         data.writeInt32(nonce);
         if (remote()->transact(TRANSACTION_mountObb, data, &reply) != NO_ERROR) {
-            LOGD("mountObb could not contact remote\n");
+            ALOGD("mountObb could not contact remote\n");
             return;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("mountObb caught exception %d\n", err);
+            ALOGD("mountObb caught exception %d\n", err);
             return;
         }
     }
@@ -463,12 +463,12 @@
         data.writeStrongBinder(token->asBinder());
         data.writeInt32(nonce);
         if (remote()->transact(TRANSACTION_unmountObb, data, &reply) != NO_ERROR) {
-            LOGD("unmountObb could not contact remote\n");
+            ALOGD("unmountObb could not contact remote\n");
             return;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("unmountObb caught exception %d\n", err);
+            ALOGD("unmountObb caught exception %d\n", err);
             return;
         }
     }
@@ -479,12 +479,12 @@
         data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
         data.writeString16(filename);
         if (remote()->transact(TRANSACTION_isObbMounted, data, &reply) != NO_ERROR) {
-            LOGD("isObbMounted could not contact remote\n");
+            ALOGD("isObbMounted could not contact remote\n");
             return false;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("isObbMounted caught exception %d\n", err);
+            ALOGD("isObbMounted caught exception %d\n", err);
             return false;
         }
         return reply.readInt32() != 0;
@@ -496,12 +496,12 @@
         data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
         data.writeString16(filename);
         if (remote()->transact(TRANSACTION_getMountedObbPath, data, &reply) != NO_ERROR) {
-            LOGD("getMountedObbPath could not contact remote\n");
+            ALOGD("getMountedObbPath could not contact remote\n");
             return false;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("getMountedObbPath caught exception %d\n", err);
+            ALOGD("getMountedObbPath caught exception %d\n", err);
             return false;
         }
         path = reply.readString16();
@@ -514,12 +514,12 @@
         data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
         data.writeString16(password);
         if (remote()->transact(TRANSACTION_decryptStorage, data, &reply) != NO_ERROR) {
-            LOGD("decryptStorage could not contact remote\n");
+            ALOGD("decryptStorage could not contact remote\n");
             return -1;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("decryptStorage caught exception %d\n", err);
+            ALOGD("decryptStorage caught exception %d\n", err);
             return err;
         }
         return reply.readInt32();
@@ -531,12 +531,12 @@
         data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
         data.writeString16(password);
         if (remote()->transact(TRANSACTION_encryptStorage, data, &reply) != NO_ERROR) {
-            LOGD("encryptStorage could not contact remote\n");
+            ALOGD("encryptStorage could not contact remote\n");
             return -1;
         }
         int32_t err = reply.readExceptionCode();
         if (err < 0) {
-            LOGD("encryptStorage caught exception %d\n", err);
+            ALOGD("encryptStorage caught exception %d\n", err);
             return err;
         }
         return reply.readInt32();
diff --git a/libs/ui/GraphicBufferAllocator.cpp b/libs/ui/GraphicBufferAllocator.cpp
index e75415b..b2b70c1 100644
--- a/libs/ui/GraphicBufferAllocator.cpp
+++ b/libs/ui/GraphicBufferAllocator.cpp
@@ -85,7 +85,7 @@
 {
     String8 s;
     GraphicBufferAllocator::getInstance().dump(s);
-    LOGD("%s", s.string());
+    ALOGD("%s", s.string());
 }
 
 status_t GraphicBufferAllocator::alloc(uint32_t w, uint32_t h, PixelFormat format,
diff --git a/libs/ui/Input.cpp b/libs/ui/Input.cpp
index 3de75ba..267a9f7 100644
--- a/libs/ui/Input.cpp
+++ b/libs/ui/Input.cpp
@@ -106,11 +106,11 @@
     path.append("/usr/");
     appendInputDeviceConfigurationFileRelativePath(path, name, type);
 #if DEBUG_PROBE
-    LOGD("Probing for system provided input device configuration file: path='%s'", path.string());
+    ALOGD("Probing for system provided input device configuration file: path='%s'", path.string());
 #endif
     if (!access(path.string(), R_OK)) {
 #if DEBUG_PROBE
-        LOGD("Found");
+        ALOGD("Found");
 #endif
         return path;
     }
@@ -121,18 +121,18 @@
     path.append("/system/devices/");
     appendInputDeviceConfigurationFileRelativePath(path, name, type);
 #if DEBUG_PROBE
-    LOGD("Probing for system user input device configuration file: path='%s'", path.string());
+    ALOGD("Probing for system user input device configuration file: path='%s'", path.string());
 #endif
     if (!access(path.string(), R_OK)) {
 #if DEBUG_PROBE
-        LOGD("Found");
+        ALOGD("Found");
 #endif
         return path;
     }
 
     // Not found.
 #if DEBUG_PROBE
-    LOGD("Probe failed to find input device configuration file: name='%s', type=%d",
+    ALOGD("Probe failed to find input device configuration file: name='%s', type=%d",
             name.string(), type);
 #endif
     return String8();
@@ -782,7 +782,7 @@
     }
 
 #if DEBUG_VELOCITY
-    LOGD("VelocityTracker: addMovement eventTime=%lld, idBits=0x%08x, activePointerId=%d",
+    ALOGD("VelocityTracker: addMovement eventTime=%lld, idBits=0x%08x, activePointerId=%d",
             eventTime, idBits.value, mActivePointerId);
     for (BitSet32 iterBits(idBits); !iterBits.isEmpty(); ) {
         uint32_t id = iterBits.firstMarkedBit();
@@ -790,7 +790,7 @@
         iterBits.clearBit(id);
         Estimator estimator;
         getEstimator(id, DEFAULT_DEGREE, DEFAULT_HORIZON, &estimator);
-        LOGD("  %d: position (%0.3f, %0.3f), "
+        ALOGD("  %d: position (%0.3f, %0.3f), "
                 "estimator (degree=%d, xCoeff=%s, yCoeff=%s, confidence=%f)",
                 id, positions[index].x, positions[index].y,
                 int(estimator.degree),
@@ -903,7 +903,7 @@
 static bool solveLeastSquares(const float* x, const float* y, uint32_t m, uint32_t n,
         float* outB, float* outDet) {
 #if DEBUG_LEAST_SQUARES
-    LOGD("solveLeastSquares: m=%d, n=%d, x=%s, y=%s", int(m), int(n),
+    ALOGD("solveLeastSquares: m=%d, n=%d, x=%s, y=%s", int(m), int(n),
             vectorToString(x, m).string(), vectorToString(y, m).string());
 #endif
 
@@ -916,7 +916,7 @@
         }
     }
 #if DEBUG_LEAST_SQUARES
-    LOGD("  - a=%s", matrixToString(&a[0][0], m, n, false /*rowMajor*/).string());
+    ALOGD("  - a=%s", matrixToString(&a[0][0], m, n, false /*rowMajor*/).string());
 #endif
 
     // Apply the Gram-Schmidt process to A to obtain its QR decomposition.
@@ -937,7 +937,7 @@
         if (norm < 0.000001f) {
             // vectors are linearly dependent or zero so no solution
 #if DEBUG_LEAST_SQUARES
-            LOGD("  - no solution, norm=%f", norm);
+            ALOGD("  - no solution, norm=%f", norm);
 #endif
             return false;
         }
@@ -951,8 +951,8 @@
         }
     }
 #if DEBUG_LEAST_SQUARES
-    LOGD("  - q=%s", matrixToString(&q[0][0], m, n, false /*rowMajor*/).string());
-    LOGD("  - r=%s", matrixToString(&r[0][0], n, n, true /*rowMajor*/).string());
+    ALOGD("  - q=%s", matrixToString(&q[0][0], m, n, false /*rowMajor*/).string());
+    ALOGD("  - r=%s", matrixToString(&r[0][0], n, n, true /*rowMajor*/).string());
 
     // calculate QR, if we factored A correctly then QR should equal A
     float qr[n][m];
@@ -964,7 +964,7 @@
             }
         }
     }
-    LOGD("  - qr=%s", matrixToString(&qr[0][0], m, n, false /*rowMajor*/).string());
+    ALOGD("  - qr=%s", matrixToString(&qr[0][0], m, n, false /*rowMajor*/).string());
 #endif
 
     // Solve R B = Qt Y to find B.  This is easy because R is upper triangular.
@@ -977,7 +977,7 @@
         outB[i] /= r[i][i];
     }
 #if DEBUG_LEAST_SQUARES
-    LOGD("  - b=%s", vectorToString(outB, n).string());
+    ALOGD("  - b=%s", vectorToString(outB, n).string());
 #endif
 
     // Calculate the coefficient of determination as 1 - (SSerr / SStot) where
@@ -1004,9 +1004,9 @@
     }
     *outDet = sstot > 0.000001f ? 1.0f - (sserr / sstot) : 1;
 #if DEBUG_LEAST_SQUARES
-    LOGD("  - sserr=%f", sserr);
-    LOGD("  - sstot=%f", sstot);
-    LOGD("  - det=%f", *outDet);
+    ALOGD("  - sserr=%f", sserr);
+    ALOGD("  - sstot=%f", sstot);
+    ALOGD("  - det=%f", *outDet);
 #endif
     return true;
 }
@@ -1073,7 +1073,7 @@
             outEstimator->degree = degree;
             outEstimator->confidence = xdet * ydet;
 #if DEBUG_LEAST_SQUARES
-            LOGD("estimate: degree=%d, xCoeff=%s, yCoeff=%s, confidence=%f",
+            ALOGD("estimate: degree=%d, xCoeff=%s, yCoeff=%s, confidence=%f",
                     int(outEstimator->degree),
                     vectorToString(outEstimator->xCoeff, n).string(),
                     vectorToString(outEstimator->yCoeff, n).string(),
@@ -1116,7 +1116,7 @@
     if ((deltaX && *deltaX) || (deltaY && *deltaY)) {
         if (eventTime >= mLastMovementTime + STOP_TIME) {
 #if DEBUG_ACCELERATION
-            LOGD("VelocityControl: stopped, last movement was %0.3fms ago",
+            ALOGD("VelocityControl: stopped, last movement was %0.3fms ago",
                     (eventTime - mLastMovementTime) * 0.000001f);
 #endif
             reset();
@@ -1147,7 +1147,7 @@
             }
 
 #if DEBUG_ACCELERATION
-            LOGD("VelocityControl(%0.3f, %0.3f, %0.3f, %0.3f): "
+            ALOGD("VelocityControl(%0.3f, %0.3f, %0.3f, %0.3f): "
                     "vx=%0.3f, vy=%0.3f, speed=%0.3f, accel=%0.3f",
                     mParameters.scale, mParameters.lowThreshold, mParameters.highThreshold,
                     mParameters.acceleration,
@@ -1155,7 +1155,7 @@
 #endif
         } else {
 #if DEBUG_ACCELERATION
-            LOGD("VelocityControl(%0.3f, %0.3f, %0.3f, %0.3f): unknown velocity",
+            ALOGD("VelocityControl(%0.3f, %0.3f, %0.3f, %0.3f): unknown velocity",
                     mParameters.scale, mParameters.lowThreshold, mParameters.highThreshold,
                     mParameters.acceleration);
 #endif
diff --git a/libs/ui/InputTransport.cpp b/libs/ui/InputTransport.cpp
index 1e602e9..00716d7 100644
--- a/libs/ui/InputTransport.cpp
+++ b/libs/ui/InputTransport.cpp
@@ -55,7 +55,7 @@
         int32_t sendPipeFd) :
         mName(name), mAshmemFd(ashmemFd), mReceivePipeFd(receivePipeFd), mSendPipeFd(sendPipeFd) {
 #if DEBUG_CHANNEL_LIFECYCLE
-    LOGD("Input channel constructed: name='%s', ashmemFd=%d, receivePipeFd=%d, sendPipeFd=%d",
+    ALOGD("Input channel constructed: name='%s', ashmemFd=%d, receivePipeFd=%d, sendPipeFd=%d",
             mName.string(), ashmemFd, receivePipeFd, sendPipeFd);
 #endif
 
@@ -70,7 +70,7 @@
 
 InputChannel::~InputChannel() {
 #if DEBUG_CHANNEL_LIFECYCLE
-    LOGD("Input channel destroyed: name='%s', ashmemFd=%d, receivePipeFd=%d, sendPipeFd=%d",
+    ALOGD("Input channel destroyed: name='%s', ashmemFd=%d, receivePipeFd=%d, sendPipeFd=%d",
             mName.string(), mAshmemFd, mReceivePipeFd, mSendPipeFd);
 #endif
 
@@ -150,13 +150,13 @@
 
     if (nWrite == 1) {
 #if DEBUG_CHANNEL_SIGNALS
-        LOGD("channel '%s' ~ sent signal '%c'", mName.string(), signal);
+        ALOGD("channel '%s' ~ sent signal '%c'", mName.string(), signal);
 #endif
         return OK;
     }
 
 #if DEBUG_CHANNEL_SIGNALS
-    LOGD("channel '%s' ~ error sending signal '%c', errno=%d", mName.string(), signal, errno);
+    ALOGD("channel '%s' ~ error sending signal '%c', errno=%d", mName.string(), signal, errno);
 #endif
     return -errno;
 }
@@ -169,27 +169,27 @@
 
     if (nRead == 1) {
 #if DEBUG_CHANNEL_SIGNALS
-        LOGD("channel '%s' ~ received signal '%c'", mName.string(), *outSignal);
+        ALOGD("channel '%s' ~ received signal '%c'", mName.string(), *outSignal);
 #endif
         return OK;
     }
 
     if (nRead == 0) { // check for EOF
 #if DEBUG_CHANNEL_SIGNALS
-        LOGD("channel '%s' ~ receive signal failed because peer was closed", mName.string());
+        ALOGD("channel '%s' ~ receive signal failed because peer was closed", mName.string());
 #endif
         return DEAD_OBJECT;
     }
 
     if (errno == EAGAIN) {
 #if DEBUG_CHANNEL_SIGNALS
-        LOGD("channel '%s' ~ receive signal failed because no signal available", mName.string());
+        ALOGD("channel '%s' ~ receive signal failed because no signal available", mName.string());
 #endif
         return WOULD_BLOCK;
     }
 
 #if DEBUG_CHANNEL_SIGNALS
-    LOGD("channel '%s' ~ receive signal failed, errno=%d", mName.string(), errno);
+    ALOGD("channel '%s' ~ receive signal failed, errno=%d", mName.string(), errno);
 #endif
     return -errno;
 }
@@ -213,7 +213,7 @@
 
 status_t InputPublisher::initialize() {
 #if DEBUG_TRANSPORT_ACTIONS
-    LOGD("channel '%s' publisher ~ initialize",
+    ALOGD("channel '%s' publisher ~ initialize",
             mChannel->getName().string());
 #endif
 
@@ -242,7 +242,7 @@
 
 status_t InputPublisher::reset() {
 #if DEBUG_TRANSPORT_ACTIONS
-    LOGD("channel '%s' publisher ~ reset",
+    ALOGD("channel '%s' publisher ~ reset",
         mChannel->getName().string());
 #endif
 
@@ -337,7 +337,7 @@
         nsecs_t downTime,
         nsecs_t eventTime) {
 #if DEBUG_TRANSPORT_ACTIONS
-    LOGD("channel '%s' publisher ~ publishKeyEvent: deviceId=%d, source=0x%x, "
+    ALOGD("channel '%s' publisher ~ publishKeyEvent: deviceId=%d, source=0x%x, "
             "action=0x%x, flags=0x%x, keyCode=%d, scanCode=%d, metaState=0x%x, repeatCount=%d,"
             "downTime=%lld, eventTime=%lld",
             mChannel->getName().string(),
@@ -379,7 +379,7 @@
         const PointerProperties* pointerProperties,
         const PointerCoords* pointerCoords) {
 #if DEBUG_TRANSPORT_ACTIONS
-    LOGD("channel '%s' publisher ~ publishMotionEvent: deviceId=%d, source=0x%x, "
+    ALOGD("channel '%s' publisher ~ publishMotionEvent: deviceId=%d, source=0x%x, "
             "action=0x%x, flags=0x%x, edgeFlags=0x%x, metaState=0x%x, buttonState=0x%x, "
             "xOffset=%f, yOffset=%f, "
             "xPrecision=%f, yPrecision=%f, downTime=%lld, eventTime=%lld, "
@@ -439,7 +439,7 @@
         nsecs_t eventTime,
         const PointerCoords* pointerCoords) {
 #if DEBUG_TRANSPORT_ACTIONS
-    LOGD("channel '%s' publisher ~ appendMotionSample: eventTime=%lld",
+    ALOGD("channel '%s' publisher ~ appendMotionSample: eventTime=%lld",
             mChannel->getName().string(), eventTime);
 #endif
 
@@ -457,7 +457,7 @@
 
     if (newBytesUsed > mAshmemSize) {
 #if DEBUG_TRANSPORT_ACTIONS
-        LOGD("channel '%s' publisher ~ Cannot append motion sample because the shared memory "
+        ALOGD("channel '%s' publisher ~ Cannot append motion sample because the shared memory "
                 "buffer is full.  Buffer size: %d bytes, pointers: %d, samples: %d",
                 mChannel->getName().string(),
                 mAshmemSize, mMotionEventPointerCount, mSharedMessage->motion.sampleCount);
@@ -473,7 +473,7 @@
                 // Only possible source of contention is the consumer having consumed (or being in the
                 // process of consuming) the message and left the semaphore count at 0.
 #if DEBUG_TRANSPORT_ACTIONS
-                LOGD("channel '%s' publisher ~ Cannot append motion sample because the message has "
+                ALOGD("channel '%s' publisher ~ Cannot append motion sample because the message has "
                         "already been consumed.", mChannel->getName().string());
 #endif
                 return FAILED_TRANSACTION;
@@ -506,7 +506,7 @@
 
 status_t InputPublisher::sendDispatchSignal() {
 #if DEBUG_TRANSPORT_ACTIONS
-    LOGD("channel '%s' publisher ~ sendDispatchSignal",
+    ALOGD("channel '%s' publisher ~ sendDispatchSignal",
             mChannel->getName().string());
 #endif
 
@@ -516,7 +516,7 @@
 
 status_t InputPublisher::receiveFinishedSignal(bool* outHandled) {
 #if DEBUG_TRANSPORT_ACTIONS
-    LOGD("channel '%s' publisher ~ receiveFinishedSignal",
+    ALOGD("channel '%s' publisher ~ receiveFinishedSignal",
             mChannel->getName().string());
 #endif
 
@@ -552,7 +552,7 @@
 
 status_t InputConsumer::initialize() {
 #if DEBUG_TRANSPORT_ACTIONS
-    LOGD("channel '%s' consumer ~ initialize",
+    ALOGD("channel '%s' consumer ~ initialize",
             mChannel->getName().string());
 #endif
 
@@ -579,7 +579,7 @@
 
 status_t InputConsumer::consume(InputEventFactoryInterface* factory, InputEvent** outEvent) {
 #if DEBUG_TRANSPORT_ACTIONS
-    LOGD("channel '%s' consumer ~ consume",
+    ALOGD("channel '%s' consumer ~ consume",
             mChannel->getName().string());
 #endif
 
@@ -650,7 +650,7 @@
 
 status_t InputConsumer::sendFinishedSignal(bool handled) {
 #if DEBUG_TRANSPORT_ACTIONS
-    LOGD("channel '%s' consumer ~ sendFinishedSignal: handled=%d",
+    ALOGD("channel '%s' consumer ~ sendFinishedSignal: handled=%d",
             mChannel->getName().string(), handled);
 #endif
 
@@ -661,7 +661,7 @@
 
 status_t InputConsumer::receiveDispatchSignal() {
 #if DEBUG_TRANSPORT_ACTIONS
-    LOGD("channel '%s' consumer ~ receiveDispatchSignal",
+    ALOGD("channel '%s' consumer ~ receiveDispatchSignal",
             mChannel->getName().string());
 #endif
 
diff --git a/libs/ui/KeyCharacterMap.cpp b/libs/ui/KeyCharacterMap.cpp
index 77f18de..e1d5e8b 100644
--- a/libs/ui/KeyCharacterMap.cpp
+++ b/libs/ui/KeyCharacterMap.cpp
@@ -109,7 +109,7 @@
             status = parser.parse();
 #if DEBUG_PARSER_PERFORMANCE
             nsecs_t elapsedTime = systemTime(SYSTEM_TIME_MONOTONIC) - startTime;
-            LOGD("Parsed key character map file '%s' %d lines in %0.3fms.",
+            ALOGD("Parsed key character map file '%s' %d lines in %0.3fms.",
                     tokenizer->getFilename().string(), tokenizer->getLineNumber(),
                     elapsedTime / 1000000.0);
 #endif
@@ -135,7 +135,7 @@
         result = key->label;
     }
 #if DEBUG_MAPPING
-    LOGD("getDisplayLabel: keyCode=%d ~ Result %d.", keyCode, result);
+    ALOGD("getDisplayLabel: keyCode=%d ~ Result %d.", keyCode, result);
 #endif
     return result;
 }
@@ -147,7 +147,7 @@
         result = key->number;
     }
 #if DEBUG_MAPPING
-    LOGD("getNumber: keyCode=%d ~ Result %d.", keyCode, result);
+    ALOGD("getNumber: keyCode=%d ~ Result %d.", keyCode, result);
 #endif
     return result;
 }
@@ -160,7 +160,7 @@
         result = behavior->character;
     }
 #if DEBUG_MAPPING
-    LOGD("getCharacter: keyCode=%d, metaState=0x%08x ~ Result %d.", keyCode, metaState, result);
+    ALOGD("getCharacter: keyCode=%d, metaState=0x%08x ~ Result %d.", keyCode, metaState, result);
 #endif
     return result;
 }
@@ -181,7 +181,7 @@
         }
     }
 #if DEBUG_MAPPING
-    LOGD("getFallbackKeyCode: keyCode=%d, metaState=0x%08x ~ Result %s, "
+    ALOGD("getFallbackKeyCode: keyCode=%d, metaState=0x%08x ~ Result %s, "
             "fallback keyCode=%d, fallback metaState=0x%08x.",
             keyCode, metaState, result ? "true" : "false",
             outFallbackAction->keyCode, outFallbackAction->metaState);
@@ -213,7 +213,7 @@
     ExactMatch: ;
     }
 #if DEBUG_MAPPING
-    LOGD("getMatch: keyCode=%d, chars=[%s], metaState=0x%08x ~ Result %d.",
+    ALOGD("getMatch: keyCode=%d, chars=[%s], metaState=0x%08x ~ Result %d.",
             keyCode, toString(chars, numChars).string(), metaState, result);
 #endif
     return result;
@@ -228,7 +228,7 @@
         char16_t ch = chars[i];
         if (!findKey(ch, &keyCode, &metaState)) {
 #if DEBUG_MAPPING
-            LOGD("getEvents: deviceId=%d, chars=[%s] ~ Failed to find mapping for character %d.",
+            ALOGD("getEvents: deviceId=%d, chars=[%s] ~ Failed to find mapping for character %d.",
                     deviceId, toString(chars, numChars).string(), ch);
 #endif
             return false;
@@ -241,10 +241,10 @@
         addMetaKeys(outEvents, deviceId, metaState, false, now, &currentMetaState);
     }
 #if DEBUG_MAPPING
-    LOGD("getEvents: deviceId=%d, chars=[%s] ~ Generated %d events.",
+    ALOGD("getEvents: deviceId=%d, chars=[%s] ~ Generated %d events.",
             deviceId, toString(chars, numChars).string(), int32_t(outEvents.size()));
     for (size_t i = 0; i < outEvents.size(); i++) {
-        LOGD("  Key: keyCode=%d, metaState=0x%08x, %s.",
+        ALOGD("  Key: keyCode=%d, metaState=0x%08x, %s.",
                 outEvents[i].getKeyCode(), outEvents[i].getMetaState(),
                 outEvents[i].getAction() == AKEY_EVENT_ACTION_DOWN ? "down" : "up");
     }
@@ -455,7 +455,7 @@
 status_t KeyCharacterMap::Parser::parse() {
     while (!mTokenizer->isEof()) {
 #if DEBUG_PARSER
-        LOGD("Parsing %s: '%s'.", mTokenizer->getLocation().string(),
+        ALOGD("Parsing %s: '%s'.", mTokenizer->getLocation().string(),
                 mTokenizer->peekRemainderOfLine().string());
 #endif
 
@@ -541,7 +541,7 @@
     }
 
 #if DEBUG_PARSER
-    LOGD("Parsed type: type=%d.", type);
+    ALOGD("Parsed type: type=%d.", type);
 #endif
     mMap->mType = type;
     return NO_ERROR;
@@ -570,7 +570,7 @@
     }
 
 #if DEBUG_PARSER
-    LOGD("Parsed beginning of key: keyCode=%d.", keyCode);
+    ALOGD("Parsed beginning of key: keyCode=%d.", keyCode);
 #endif
     mKeyCode = keyCode;
     mMap->mKeys.add(keyCode, new Key());
@@ -694,7 +694,7 @@
             }
             key->label = behavior.character;
 #if DEBUG_PARSER
-            LOGD("Parsed key label: keyCode=%d, label=%d.", mKeyCode, key->label);
+            ALOGD("Parsed key label: keyCode=%d, label=%d.", mKeyCode, key->label);
 #endif
             break;
         case PROPERTY_NUMBER:
@@ -705,7 +705,7 @@
             }
             key->number = behavior.character;
 #if DEBUG_PARSER
-            LOGD("Parsed key number: keyCode=%d, number=%d.", mKeyCode, key->number);
+            ALOGD("Parsed key number: keyCode=%d, number=%d.", mKeyCode, key->number);
 #endif
             break;
         case PROPERTY_META: {
@@ -721,7 +721,7 @@
             newBehavior->next = key->firstBehavior;
             key->firstBehavior = newBehavior;
 #if DEBUG_PARSER
-            LOGD("Parsed key meta: keyCode=%d, meta=0x%x, char=%d, fallback=%d.", mKeyCode,
+            ALOGD("Parsed key meta: keyCode=%d, meta=0x%x, char=%d, fallback=%d.", mKeyCode,
                     newBehavior->metaState, newBehavior->character, newBehavior->fallbackKeyCode);
 #endif
             break;
diff --git a/libs/ui/KeyLayoutMap.cpp b/libs/ui/KeyLayoutMap.cpp
index 8626a03..7ba654a57 100644
--- a/libs/ui/KeyLayoutMap.cpp
+++ b/libs/ui/KeyLayoutMap.cpp
@@ -67,7 +67,7 @@
             status = parser.parse();
 #if DEBUG_PARSER_PERFORMANCE
             nsecs_t elapsedTime = systemTime(SYSTEM_TIME_MONOTONIC) - startTime;
-            LOGD("Parsed key layout map file '%s' %d lines in %0.3fms.",
+            ALOGD("Parsed key layout map file '%s' %d lines in %0.3fms.",
                     tokenizer->getFilename().string(), tokenizer->getLineNumber(),
                     elapsedTime / 1000000.0);
 #endif
@@ -86,7 +86,7 @@
     ssize_t index = mKeys.indexOfKey(scanCode);
     if (index < 0) {
 #if DEBUG_MAPPING
-        LOGD("mapKey: scanCode=%d ~ Failed.", scanCode);
+        ALOGD("mapKey: scanCode=%d ~ Failed.", scanCode);
 #endif
         *keyCode = AKEYCODE_UNKNOWN;
         *flags = 0;
@@ -98,7 +98,7 @@
     *flags = k.flags;
 
 #if DEBUG_MAPPING
-    LOGD("mapKey: scanCode=%d ~ Result keyCode=%d, flags=0x%08x.", scanCode, *keyCode, *flags);
+    ALOGD("mapKey: scanCode=%d ~ Result keyCode=%d, flags=0x%08x.", scanCode, *keyCode, *flags);
 #endif
     return NO_ERROR;
 }
@@ -117,7 +117,7 @@
     ssize_t index = mAxes.indexOfKey(scanCode);
     if (index < 0) {
 #if DEBUG_MAPPING
-        LOGD("mapAxis: scanCode=%d ~ Failed.", scanCode);
+        ALOGD("mapAxis: scanCode=%d ~ Failed.", scanCode);
 #endif
         return NAME_NOT_FOUND;
     }
@@ -125,7 +125,7 @@
     *outAxisInfo = mAxes.valueAt(index);
 
 #if DEBUG_MAPPING
-    LOGD("mapAxis: scanCode=%d ~ Result mode=%d, axis=%d, highAxis=%d, "
+    ALOGD("mapAxis: scanCode=%d ~ Result mode=%d, axis=%d, highAxis=%d, "
             "splitValue=%d, flatOverride=%d.",
             scanCode,
             outAxisInfo->mode, outAxisInfo->axis, outAxisInfo->highAxis,
@@ -147,7 +147,7 @@
 status_t KeyLayoutMap::Parser::parse() {
     while (!mTokenizer->isEof()) {
 #if DEBUG_PARSER
-        LOGD("Parsing %s: '%s'.", mTokenizer->getLocation().string(),
+        ALOGD("Parsing %s: '%s'.", mTokenizer->getLocation().string(),
                 mTokenizer->peekRemainderOfLine().string());
 #endif
 
@@ -228,7 +228,7 @@
     }
 
 #if DEBUG_PARSER
-    LOGD("Parsed key: scanCode=%d, keyCode=%d, flags=0x%08x.", scanCode, keyCode, flags);
+    ALOGD("Parsed key: scanCode=%d, keyCode=%d, flags=0x%08x.", scanCode, keyCode, flags);
 #endif
     Key key;
     key.keyCode = keyCode;
@@ -328,7 +328,7 @@
     }
 
 #if DEBUG_PARSER
-    LOGD("Parsed axis: scanCode=%d, mode=%d, axis=%d, highAxis=%d, "
+    ALOGD("Parsed axis: scanCode=%d, mode=%d, axis=%d, highAxis=%d, "
             "splitValue=%d, flatOverride=%d.",
             scanCode,
             axisInfo.mode, axisInfo.axis, axisInfo.highAxis,
diff --git a/libs/ui/Region.cpp b/libs/ui/Region.cpp
index 5656088..d9ad863 100644
--- a/libs/ui/Region.cpp
+++ b/libs/ui/Region.cpp
@@ -272,7 +272,7 @@
     }
     
     virtual void operator()(const Rect& rect) {
-        //LOGD(">>> %3d, %3d, %3d, %3d", 
+        //ALOGD(">>> %3d, %3d, %3d, %3d",
         //        rect.left, rect.top, rect.right, rect.bottom);
         if (span.size()) {
             if (cur->top != rect.top) {
@@ -457,14 +457,14 @@
     }
     
     if(!same) {
-        LOGD("---\nregion boolean %s failed", name);
+        ALOGD("---\nregion boolean %s failed", name);
         lhs.dump("lhs");
         rhs.dump("rhs");
         dst.dump("dst");
-        LOGD("should be");
+        ALOGD("should be");
         SkRegion::Iterator it(sk_dst);
         while (!it.done()) {
-            LOGD("    [%3d, %3d, %3d, %3d]",
+            ALOGD("    [%3d, %3d, %3d, %3d]",
                 it.rect().fLeft,
                 it.rect().fTop,
                 it.rect().fRight,
@@ -647,9 +647,9 @@
     (void)flags;
     const_iterator head = begin();
     const_iterator const tail = end();
-    LOGD("  Region %s (this=%p, count=%d)\n", what, this, tail-head);
+    ALOGD("  Region %s (this=%p, count=%d)\n", what, this, tail-head);
     while (head != tail) {
-        LOGD("    [%3d, %3d, %3d, %3d]\n",
+        ALOGD("    [%3d, %3d, %3d, %3d]\n",
                 head->left, head->top, head->right, head->bottom);
         head++;
     }
diff --git a/libs/ui/VirtualKeyMap.cpp b/libs/ui/VirtualKeyMap.cpp
index e756cdd..90c092d 100644
--- a/libs/ui/VirtualKeyMap.cpp
+++ b/libs/ui/VirtualKeyMap.cpp
@@ -65,7 +65,7 @@
             status = parser.parse();
 #if DEBUG_PARSER_PERFORMANCE
             nsecs_t elapsedTime = systemTime(SYSTEM_TIME_MONOTONIC) - startTime;
-            LOGD("Parsed key character map file '%s' %d lines in %0.3fms.",
+            ALOGD("Parsed key character map file '%s' %d lines in %0.3fms.",
                     tokenizer->getFilename().string(), tokenizer->getLineNumber(),
                     elapsedTime / 1000000.0);
 #endif
@@ -93,7 +93,7 @@
 status_t VirtualKeyMap::Parser::parse() {
     while (!mTokenizer->isEof()) {
 #if DEBUG_PARSER
-        LOGD("Parsing %s: '%s'.", mTokenizer->getLocation().string(),
+        ALOGD("Parsing %s: '%s'.", mTokenizer->getLocation().string(),
                 mTokenizer->peekRemainderOfLine().string());
 #endif
 
@@ -122,7 +122,7 @@
                 }
 
 #if DEBUG_PARSER
-                LOGD("Parsed virtual key: scanCode=%d, centerX=%d, centerY=%d, "
+                ALOGD("Parsed virtual key: scanCode=%d, centerX=%d, centerY=%d, "
                         "width=%d, height=%d",
                         defn.scanCode, defn.centerX, defn.centerY, defn.width, defn.height);
 #endif
diff --git a/libs/ui/tests/region/region.cpp b/libs/ui/tests/region/region.cpp
index ef15de9..6347294 100644
--- a/libs/ui/tests/region/region.cpp
+++ b/libs/ui/tests/region/region.cpp
@@ -58,7 +58,7 @@
     //reg2.dump("reg2");
     //reg3.dump("reg3");
 
-    LOGD("---");
+    ALOGD("---");
     reg2 = reg0 | reg0.translate(100, 0);
     reg0.dump("reg0");
     reg1.dump("reg1");
diff --git a/libs/utils/Asset.cpp b/libs/utils/Asset.cpp
index 7fd2c87..7c34c6a 100644
--- a/libs/utils/Asset.cpp
+++ b/libs/utils/Asset.cpp
@@ -210,7 +210,7 @@
     offset = ftell(fp);
     fclose(fp);
     if (!scanResult) {
-        LOGD("File '%s' is not in gzip format\n", fileName);
+        ALOGD("File '%s' is not in gzip format\n", fileName);
         ::close(fd);
         return NULL;
     }
@@ -384,12 +384,12 @@
     fileLength = lseek64(fd, 0, SEEK_END);
     if (fileLength == (off64_t) -1) {
         // probably a bad file descriptor
-        LOGD("failed lseek (errno=%d)\n", errno);
+        ALOGD("failed lseek (errno=%d)\n", errno);
         return UNKNOWN_ERROR;
     }
 
     if ((off64_t) (offset + length) > fileLength) {
-        LOGD("start (%ld) + len (%ld) > end (%ld)\n",
+        ALOGD("start (%ld) + len (%ld) > end (%ld)\n",
             (long) offset, (long) length, (long) fileLength);
         return BAD_INDEX;
     }
diff --git a/libs/utils/AssetManager.cpp b/libs/utils/AssetManager.cpp
index 203e6fa..e7c4d47 100644
--- a/libs/utils/AssetManager.cpp
+++ b/libs/utils/AssetManager.cpp
@@ -283,7 +283,7 @@
 bool AssetManager::createIdmapFileLocked(const String8& originalPath, const String8& overlayPath,
                                          const String8& idmapPath)
 {
-    LOGD("%s: originalPath=%s overlayPath=%s idmapPath=%s\n",
+    ALOGD("%s: originalPath=%s overlayPath=%s idmapPath=%s\n",
          __FUNCTION__, originalPath.string(), overlayPath.string(), idmapPath.string());
     ResTable tables[2];
     const String8* paths[2] = { &originalPath, &overlayPath };
@@ -923,7 +923,7 @@
              */
             if (found) {
                 if (pAsset == NULL)
-                    LOGD("Expected file not found: '%s'\n", path.string());
+                    ALOGD("Expected file not found: '%s'\n", path.string());
                 return pAsset;
             }
         }
@@ -1333,7 +1333,7 @@
                 //printf("+++ no match on '%s'\n", (const char*) match);
             }
 
-            LOGD("HEY: size=%d removing %d\n", (int)pContents->size(), i);
+            ALOGD("HEY: size=%d removing %d\n", (int)pContents->size(), i);
             pContents->removeAt(i);
             i--;        // adjust "for" loop
             count--;    //  and loop limit
@@ -1652,7 +1652,7 @@
 
 #ifdef DO_TIMINGS
     timer.stop();
-    LOGD("Cache scan took %.3fms\n",
+    ALOGD("Cache scan took %.3fms\n",
         timer.durationUsecs() / 1000.0);
 #endif
 
@@ -1784,7 +1784,7 @@
     mZipFile = new ZipFileRO;
     ALOGV("+++ opening zip '%s'\n", mPath.string());
     if (mZipFile->open(mPath.string()) != NO_ERROR) {
-        LOGD("failed to open Zip archive '%s'\n", mPath.string());
+        ALOGD("failed to open Zip archive '%s'\n", mPath.string());
         delete mZipFile;
         mZipFile = NULL;
     }
diff --git a/libs/utils/BackupData.cpp b/libs/utils/BackupData.cpp
index 87912639..5afe2dc0 100644
--- a/libs/utils/BackupData.cpp
+++ b/libs/utils/BackupData.cpp
@@ -112,8 +112,8 @@
         k = key;
     }
     if (DEBUG) {
-        LOGD("Writing header: prefix='%s' key='%s' dataSize=%d", m_keyPrefix.string(), key.string(),
-                dataSize);
+        ALOGD("Writing header: prefix='%s' key='%s' dataSize=%d", m_keyPrefix.string(),
+                key.string(), dataSize);
     }
 
     entity_header_v1 header;
@@ -151,11 +151,11 @@
 status_t
 BackupDataWriter::WriteEntityData(const void* data, size_t size)
 {
-    if (DEBUG) LOGD("Writing data: size=%lu", (unsigned long) size);
+    if (DEBUG) ALOGD("Writing data: size=%lu", (unsigned long) size);
 
     if (m_status != NO_ERROR) {
         if (DEBUG) {
-            LOGD("Not writing data - stream in error state %d (%s)", m_status, strerror(m_status));
+            ALOGD("Not writing data - stream in error state %d (%s)", m_status, strerror(m_status));
         }
         return m_status;
     }
@@ -166,7 +166,7 @@
     ssize_t amt = write(m_fd, data, size);
     if (amt != (ssize_t)size) {
         m_status = errno;
-        if (DEBUG) LOGD("write returned error %d (%s)", m_status, strerror(m_status));
+        if (DEBUG) ALOGD("write returned error %d (%s)", m_status, strerror(m_status));
         return m_status;
     }
     m_pos += amt;
@@ -208,7 +208,7 @@
                 m_done = true; \
             } else { \
                 m_status = errno; \
-                LOGD("CHECK_SIZE(a=%ld e=%ld) failed at line %d m_status='%s'", \
+                ALOGD("CHECK_SIZE(a=%ld e=%ld) failed at line %d m_status='%s'", \
                     long(actual), long(expected), __LINE__, strerror(m_status)); \
             } \
             return m_status; \
@@ -218,7 +218,7 @@
     do { \
         status_t err = skip_padding(); \
         if (err != NO_ERROR) { \
-            LOGD("SKIP_PADDING FAILED at line %d", __LINE__); \
+            ALOGD("SKIP_PADDING FAILED at line %d", __LINE__); \
             m_status = err; \
             return err; \
         } \
@@ -261,7 +261,7 @@
         {
             m_header.entity.keyLen = fromlel(m_header.entity.keyLen);
             if (m_header.entity.keyLen <= 0) {
-                LOGD("Entity header at %d has keyLen<=0: 0x%08x\n", (int)m_pos,
+                ALOGD("Entity header at %d has keyLen<=0: 0x%08x\n", (int)m_pos,
                         (int)m_header.entity.keyLen);
                 m_status = EINVAL;
             }
@@ -285,7 +285,7 @@
             break;
         }
         default:
-            LOGD("Chunk header at %d has invalid type: 0x%08x",
+            ALOGD("Chunk header at %d has invalid type: 0x%08x",
                     (int)(m_pos - sizeof(m_header)), (int)m_header.type);
             m_status = EINVAL;
     }
@@ -339,7 +339,7 @@
         return -1;
     }
     int remaining = m_dataEndPos - m_pos;
-    //LOGD("ReadEntityData size=%d m_pos=0x%x m_dataEndPos=0x%x remaining=%d\n",
+    //ALOGD("ReadEntityData size=%d m_pos=0x%x m_dataEndPos=0x%x remaining=%d\n",
     //        size, m_pos, m_dataEndPos, remaining);
     if (remaining <= 0) {
         return 0;
@@ -347,7 +347,7 @@
     if (((int)size) > remaining) {
         size = remaining;
     }
-    //LOGD("   reading %d bytes", size);
+    //ALOGD("   reading %d bytes", size);
     int amt = read(m_fd, data, size);
     if (amt < 0) {
         m_status = errno;
diff --git a/libs/utils/BackupHelpers.cpp b/libs/utils/BackupHelpers.cpp
index 7ef30f9..aee7ff0 100644
--- a/libs/utils/BackupHelpers.cpp
+++ b/libs/utils/BackupHelpers.cpp
@@ -74,7 +74,7 @@
 #if TEST_BACKUP_HELPERS
 #define LOGP(f, x...) printf(f "\n", x)
 #else
-#define LOGP(x...) LOGD(x)
+#define LOGP(x...) ALOGD(x)
 #endif
 #endif
 
diff --git a/libs/utils/CallStack.cpp b/libs/utils/CallStack.cpp
index c2a5e55..18fd84f 100644
--- a/libs/utils/CallStack.cpp
+++ b/libs/utils/CallStack.cpp
@@ -104,7 +104,7 @@
         char line[MAX_BACKTRACE_LINE_LENGTH];
         format_backtrace_line(i, &mStack[i], &symbols[i],
                 line, MAX_BACKTRACE_LINE_LENGTH);
-        LOGD("%s%s", prefix, line);
+        ALOGD("%s%s", prefix, line);
     }
     free_backtrace_symbols(symbols, mCount);
 }
diff --git a/libs/utils/FileMap.cpp b/libs/utils/FileMap.cpp
index 294f7b6..b2a61f1 100644
--- a/libs/utils/FileMap.cpp
+++ b/libs/utils/FileMap.cpp
@@ -64,12 +64,12 @@
     }
 #ifdef HAVE_POSIX_FILEMAP    
     if (mBasePtr && munmap(mBasePtr, mBaseLength) != 0) {
-        LOGD("munmap(%p, %d) failed\n", mBasePtr, (int) mBaseLength);
+        ALOGD("munmap(%p, %d) failed\n", mBasePtr, (int) mBaseLength);
     }
 #endif
 #ifdef HAVE_WIN32_FILEMAP
     if (mBasePtr && UnmapViewOfFile(mBasePtr) == 0) {
-        LOGD("UnmapViewOfFile(%p) failed, error = %ld\n", mBasePtr, 
+        ALOGD("UnmapViewOfFile(%p) failed, error = %ld\n", mBasePtr,
               GetLastError() );
     }
     if (mFileMapping != INVALID_HANDLE_VALUE) {
diff --git a/libs/utils/Looper.cpp b/libs/utils/Looper.cpp
index b54fb9d..1bc92cf 100644
--- a/libs/utils/Looper.cpp
+++ b/libs/utils/Looper.cpp
@@ -185,7 +185,7 @@
                 int events = response.events;
                 void* data = response.request.data;
 #if DEBUG_POLL_AND_WAKE
-                LOGD("%p ~ pollOnce - returning signalled identifier %d: "
+                ALOGD("%p ~ pollOnce - returning signalled identifier %d: "
                         "fd=%d, events=0x%x, data=%p",
                         this, ident, fd, events, data);
 #endif
@@ -198,7 +198,7 @@
 
         if (result != 0) {
 #if DEBUG_POLL_AND_WAKE
-            LOGD("%p ~ pollOnce - returning result %d", this, result);
+            ALOGD("%p ~ pollOnce - returning result %d", this, result);
 #endif
             if (outFd != NULL) *outFd = 0;
             if (outEvents != NULL) *outEvents = NULL;
@@ -212,7 +212,7 @@
 
 int Looper::pollInner(int timeoutMillis) {
 #if DEBUG_POLL_AND_WAKE
-    LOGD("%p ~ pollOnce - waiting: timeoutMillis=%d", this, timeoutMillis);
+    ALOGD("%p ~ pollOnce - waiting: timeoutMillis=%d", this, timeoutMillis);
 #endif
 
     // Adjust the timeout based on when the next message is due.
@@ -224,7 +224,7 @@
             timeoutMillis = messageTimeoutMillis;
         }
 #if DEBUG_POLL_AND_WAKE
-        LOGD("%p ~ pollOnce - next message in %lldns, adjusted timeout: timeoutMillis=%d",
+        ALOGD("%p ~ pollOnce - next message in %lldns, adjusted timeout: timeoutMillis=%d",
                 this, mNextMessageUptime - now, timeoutMillis);
 #endif
     }
@@ -270,7 +270,7 @@
     // Check for poll timeout.
     if (eventCount == 0) {
 #if DEBUG_POLL_AND_WAKE
-        LOGD("%p ~ pollOnce - timeout", this);
+        ALOGD("%p ~ pollOnce - timeout", this);
 #endif
         result = ALOOPER_POLL_TIMEOUT;
         goto Done;
@@ -278,7 +278,7 @@
 
     // Handle all events.
 #if DEBUG_POLL_AND_WAKE
-    LOGD("%p ~ pollOnce - handling events from %d fds", this, eventCount);
+    ALOGD("%p ~ pollOnce - handling events from %d fds", this, eventCount);
 #endif
 
 #ifdef LOOPER_USES_EPOLL
@@ -353,7 +353,7 @@
                 - milliseconds_to_nanoseconds(timeoutMillis);
     }
     if (mSampledPolls == SAMPLED_POLLS_TO_AGGREGATE) {
-        LOGD("%p ~ poll latency statistics: %0.3fms zero timeout, %0.3fms non-zero timeout", this,
+        ALOGD("%p ~ poll latency statistics: %0.3fms zero timeout, %0.3fms non-zero timeout", this,
                 0.000001f * float(mSampledZeroPollLatencySum) / mSampledZeroPollCount,
                 0.000001f * float(mSampledTimeoutPollLatencySum) / mSampledTimeoutPollCount);
         mSampledPolls = 0;
@@ -382,7 +382,7 @@
                 mLock.unlock();
 
 #if DEBUG_POLL_AND_WAKE || DEBUG_CALLBACKS
-                LOGD("%p ~ pollOnce - sending message: handler=%p, what=%d",
+                ALOGD("%p ~ pollOnce - sending message: handler=%p, what=%d",
                         this, handler.get(), message.what);
 #endif
                 handler->handleMessage(message);
@@ -410,7 +410,7 @@
             int events = response.events;
             void* data = response.request.data;
 #if DEBUG_POLL_AND_WAKE || DEBUG_CALLBACKS
-            LOGD("%p ~ pollOnce - invoking fd event callback %p: fd=%d, events=0x%x, data=%p",
+            ALOGD("%p ~ pollOnce - invoking fd event callback %p: fd=%d, events=0x%x, data=%p",
                     this, callback, fd, events, data);
 #endif
             int callbackResult = callback(fd, events, data);
@@ -451,7 +451,7 @@
 
 void Looper::wake() {
 #if DEBUG_POLL_AND_WAKE
-    LOGD("%p ~ wake", this);
+    ALOGD("%p ~ wake", this);
 #endif
 
 #ifdef LOOPER_STATISTICS
@@ -475,12 +475,12 @@
 
 void Looper::awoken() {
 #if DEBUG_POLL_AND_WAKE
-    LOGD("%p ~ awoken", this);
+    ALOGD("%p ~ awoken", this);
 #endif
 
 #ifdef LOOPER_STATISTICS
     if (mPendingWakeCount == 0) {
-        LOGD("%p ~ awoken: spurious!", this);
+        ALOGD("%p ~ awoken: spurious!", this);
     } else {
         mSampledWakeCycles += 1;
         mSampledWakeCountSum += mPendingWakeCount;
@@ -488,7 +488,7 @@
         mPendingWakeCount = 0;
         mPendingWakeTime = -1;
         if (mSampledWakeCycles == SAMPLED_WAKE_CYCLES_TO_AGGREGATE) {
-            LOGD("%p ~ wake statistics: %0.3fms wake latency, %0.3f wakes per cycle", this,
+            ALOGD("%p ~ wake statistics: %0.3fms wake latency, %0.3f wakes per cycle", this,
                     0.000001f * float(mSampledWakeLatencySum) / mSampledWakeCycles,
                     float(mSampledWakeCountSum) / mSampledWakeCycles);
             mSampledWakeCycles = 0;
@@ -514,7 +514,7 @@
 
 int Looper::addFd(int fd, int ident, int events, ALooper_callbackFunc callback, void* data) {
 #if DEBUG_CALLBACKS
-    LOGD("%p ~ addFd - fd=%d, ident=%d, events=0x%x, callback=%p, data=%p", this, fd, ident,
+    ALOGD("%p ~ addFd - fd=%d, ident=%d, events=0x%x, callback=%p, data=%p", this, fd, ident,
             events, callback, data);
 #endif
 
@@ -598,7 +598,7 @@
 
 int Looper::removeFd(int fd) {
 #if DEBUG_CALLBACKS
-    LOGD("%p ~ removeFd - fd=%d", this, fd);
+    ALOGD("%p ~ removeFd - fd=%d", this, fd);
 #endif
 
 #ifdef LOOPER_USES_EPOLL
@@ -675,7 +675,7 @@
 void Looper::sendMessageAtTime(nsecs_t uptime, const sp<MessageHandler>& handler,
         const Message& message) {
 #if DEBUG_CALLBACKS
-    LOGD("%p ~ sendMessageAtTime - uptime=%lld, handler=%p, what=%d",
+    ALOGD("%p ~ sendMessageAtTime - uptime=%lld, handler=%p, what=%d",
             this, uptime, handler.get(), message.what);
 #endif
 
@@ -708,7 +708,7 @@
 
 void Looper::removeMessages(const sp<MessageHandler>& handler) {
 #if DEBUG_CALLBACKS
-    LOGD("%p ~ removeMessages - handler=%p", this, handler.get());
+    ALOGD("%p ~ removeMessages - handler=%p", this, handler.get());
 #endif
 
     { // acquire lock
@@ -725,7 +725,7 @@
 
 void Looper::removeMessages(const sp<MessageHandler>& handler, int what) {
 #if DEBUG_CALLBACKS
-    LOGD("%p ~ removeMessages - handler=%p, what=%d", this, handler.get(), what);
+    ALOGD("%p ~ removeMessages - handler=%p, what=%d", this, handler.get(), what);
 #endif
 
     { // acquire lock
diff --git a/libs/utils/PropertyMap.cpp b/libs/utils/PropertyMap.cpp
index d472d45..99603ab 100644
--- a/libs/utils/PropertyMap.cpp
+++ b/libs/utils/PropertyMap.cpp
@@ -135,7 +135,7 @@
             status = parser.parse();
 #if DEBUG_PARSER_PERFORMANCE
             nsecs_t elapsedTime = systemTime(SYSTEM_TIME_MONOTONIC) - startTime;
-            LOGD("Parsed property file '%s' %d lines in %0.3fms.",
+            ALOGD("Parsed property file '%s' %d lines in %0.3fms.",
                     tokenizer->getFilename().string(), tokenizer->getLineNumber(),
                     elapsedTime / 1000000.0);
 #endif
@@ -163,7 +163,7 @@
 status_t PropertyMap::Parser::parse() {
     while (!mTokenizer->isEof()) {
 #if DEBUG_PARSER
-        LOGD("Parsing %s: '%s'.", mTokenizer->getLocation().string(),
+        ALOGD("Parsing %s: '%s'.", mTokenizer->getLocation().string(),
                 mTokenizer->peekRemainderOfLine().string());
 #endif
 
diff --git a/libs/utils/RefBase.cpp b/libs/utils/RefBase.cpp
index 959b382..0b7dd92 100644
--- a/libs/utils/RefBase.cpp
+++ b/libs/utils/RefBase.cpp
@@ -103,7 +103,7 @@
             ref_entry* refs = mStrongRefs;
             while (refs) {
                 char inc = refs->ref >= 0 ? '+' : '-';
-                LOGD("\t%c ID %p (ref %d):", inc, refs->id, refs->ref);
+                ALOGD("\t%c ID %p (ref %d):", inc, refs->id, refs->ref);
 #if DEBUG_REFS_CALLSTACK_ENABLED
                 refs->stack.dump();
 #endif
@@ -121,7 +121,7 @@
             ref_entry* refs = mWeakRefs;
             while (refs) {
                 char inc = refs->ref >= 0 ? '+' : '-';
-                LOGD("\t%c ID %p (ref %d):", inc, refs->id, refs->ref);
+                ALOGD("\t%c ID %p (ref %d):", inc, refs->id, refs->ref);
 #if DEBUG_REFS_CALLSTACK_ENABLED
                 refs->stack.dump();
 #endif
@@ -137,13 +137,13 @@
     }
 
     void addStrongRef(const void* id) {
-        //LOGD_IF(mTrackEnabled,
+        //ALOGD_IF(mTrackEnabled,
         //        "addStrongRef: RefBase=%p, id=%p", mBase, id);
         addRef(&mStrongRefs, id, mStrong);
     }
 
     void removeStrongRef(const void* id) {
-        //LOGD_IF(mTrackEnabled,
+        //ALOGD_IF(mTrackEnabled,
         //        "removeStrongRef: RefBase=%p, id=%p", mBase, id);
         if (!mRetain) {
             removeRef(&mStrongRefs, id);
@@ -153,7 +153,7 @@
     }
 
     void renameStrongRefId(const void* old_id, const void* new_id) {
-        //LOGD_IF(mTrackEnabled,
+        //ALOGD_IF(mTrackEnabled,
         //        "renameStrongRefId: RefBase=%p, oid=%p, nid=%p",
         //        mBase, old_id, new_id);
         renameRefsId(mStrongRefs, old_id, new_id);
@@ -203,7 +203,7 @@
             if (rc >= 0) {
                 write(rc, text.string(), text.length());
                 close(rc);
-                LOGD("STACK TRACE for %p saved in %s", this, name);
+                ALOGD("STACK TRACE for %p saved in %s", this, name);
             }
             else LOGE("FAILED TO PRINT STACK TRACE for %p in %s: %s", this,
                       name, strerror(errno));
@@ -270,7 +270,7 @@
             ref = head;
             while (ref) {
                 char inc = ref->ref >= 0 ? '+' : '-';
-                LOGD("\t%c ID %p (ref %d):", inc, ref->id, ref->ref);
+                ALOGD("\t%c ID %p (ref %d):", inc, ref->id, ref->ref);
                 ref = ref->next;
             }
 
@@ -334,7 +334,7 @@
     const int32_t c = android_atomic_inc(&refs->mStrong);
     LOG_ASSERT(c > 0, "incStrong() called on %p after last strong ref", refs);
 #if PRINT_REFS
-    LOGD("incStrong of %p from %p: cnt=%d\n", this, id, c);
+    ALOGD("incStrong of %p from %p: cnt=%d\n", this, id, c);
 #endif
     if (c != INITIAL_STRONG_VALUE)  {
         return;
@@ -350,7 +350,7 @@
     refs->removeStrongRef(id);
     const int32_t c = android_atomic_dec(&refs->mStrong);
 #if PRINT_REFS
-    LOGD("decStrong of %p from %p: cnt=%d\n", this, id, c);
+    ALOGD("decStrong of %p from %p: cnt=%d\n", this, id, c);
 #endif
     LOG_ASSERT(c >= 1, "decStrong() called on %p too many times", refs);
     if (c == 1) {
@@ -372,7 +372,7 @@
     LOG_ASSERT(c >= 0, "forceIncStrong called on %p after ref count underflow",
                refs);
 #if PRINT_REFS
-    LOGD("forceIncStrong of %p from %p: cnt=%d\n", this, id, c);
+    ALOGD("forceIncStrong of %p from %p: cnt=%d\n", this, id, c);
 #endif
 
     switch (c) {
@@ -487,7 +487,7 @@
     impl->addStrongRef(id);
 
 #if PRINT_REFS
-    LOGD("attemptIncStrong of %p from %p: cnt=%d\n", this, id, curCount);
+    ALOGD("attemptIncStrong of %p from %p: cnt=%d\n", this, id, curCount);
 #endif
 
     if (curCount == INITIAL_STRONG_VALUE) {
diff --git a/libs/utils/ResourceTypes.cpp b/libs/utils/ResourceTypes.cpp
index 6a9e91d2..559afd8 100644
--- a/libs/utils/ResourceTypes.cpp
+++ b/libs/utils/ResourceTypes.cpp
@@ -4368,7 +4368,7 @@
             }
 #if 0
             if (overlayResID != 0) {
-                LOGD("%s/%s 0x%08x -> 0x%08x\n",
+                ALOGD("%s/%s 0x%08x -> 0x%08x\n",
                      String8(String16(resName.type)).string(),
                      String8(String16(resName.name)).string(),
                      resID, overlayResID);
diff --git a/libs/utils/StopWatch.cpp b/libs/utils/StopWatch.cpp
index b5dda2f..595aec3 100644
--- a/libs/utils/StopWatch.cpp
+++ b/libs/utils/StopWatch.cpp
@@ -39,11 +39,11 @@
 {
     nsecs_t elapsed = elapsedTime();
     const int n = mNumLaps;
-    LOGD("StopWatch %s (us): %lld ", mName, ns2us(elapsed));
+    ALOGD("StopWatch %s (us): %lld ", mName, ns2us(elapsed));
     for (int i=0 ; i<n ; i++) {
         const nsecs_t soFar = mLaps[i].soFar;
         const nsecs_t thisLap = mLaps[i].thisLap;
-        LOGD(" [%d: %lld, %lld]", i, ns2us(soFar), ns2us(thisLap));
+        ALOGD(" [%d: %lld, %lld]", i, ns2us(soFar), ns2us(thisLap));
     }
 }
 
diff --git a/libs/utils/SystemClock.cpp b/libs/utils/SystemClock.cpp
index 062e6d7..89a052f 100644
--- a/libs/utils/SystemClock.cpp
+++ b/libs/utils/SystemClock.cpp
@@ -64,7 +64,7 @@
     tv.tv_sec = (time_t) (millis / 1000LL);
     tv.tv_usec = (suseconds_t) ((millis % 1000LL) * 1000LL);
 
-    LOGD("Setting time of day to sec=%d\n", (int) tv.tv_sec);
+    ALOGD("Setting time of day to sec=%d\n", (int) tv.tv_sec);
 
 #ifdef HAVE_ANDROID_OS
     fd = open("/dev/alarm", O_RDWR);
diff --git a/libs/utils/Tokenizer.cpp b/libs/utils/Tokenizer.cpp
index b3445b7..68752b4 100644
--- a/libs/utils/Tokenizer.cpp
+++ b/libs/utils/Tokenizer.cpp
@@ -118,7 +118,7 @@
 
 String8 Tokenizer::nextToken(const char* delimiters) {
 #if DEBUG_TOKENIZER
-    LOGD("nextToken");
+    ALOGD("nextToken");
 #endif
     const char* end = getEnd();
     const char* tokenStart = mCurrent;
@@ -134,7 +134,7 @@
 
 void Tokenizer::nextLine() {
 #if DEBUG_TOKENIZER
-    LOGD("nextLine");
+    ALOGD("nextLine");
 #endif
     const char* end = getEnd();
     while (mCurrent != end) {
@@ -148,7 +148,7 @@
 
 void Tokenizer::skipDelimiters(const char* delimiters) {
 #if DEBUG_TOKENIZER
-    LOGD("skipDelimiters");
+    ALOGD("skipDelimiters");
 #endif
     const char* end = getEnd();
     while (mCurrent != end) {
diff --git a/libs/utils/ZipFileRO.cpp b/libs/utils/ZipFileRO.cpp
index d880f55..3069352 100644
--- a/libs/utils/ZipFileRO.cpp
+++ b/libs/utils/ZipFileRO.cpp
@@ -269,7 +269,7 @@
         }
     }
     if (i < 0) {
-        LOGD("Zip: EOCD not found, %s is not zip\n", mFileName);
+        ALOGD("Zip: EOCD not found, %s is not zip\n", mFileName);
         free(scanBuf);
         return false;
     }
diff --git a/libs/utils/ZipUtils.cpp b/libs/utils/ZipUtils.cpp
index 76725b4..cc5c68a 100644
--- a/libs/utils/ZipUtils.cpp
+++ b/libs/utils/ZipUtils.cpp
@@ -100,7 +100,7 @@
 
             int cc = read(fd, readBuf, getSize);
             if (cc != (int) getSize) {
-                LOGD("inflate read failed (%d vs %ld)\n",
+                ALOGD("inflate read failed (%d vs %ld)\n",
                     cc, getSize);
                 goto z_bail;
             }
@@ -114,7 +114,7 @@
         /* uncompress the data */
         zerr = inflate(&zstream, Z_NO_FLUSH);
         if (zerr != Z_OK && zerr != Z_STREAM_END) {
-            LOGD("zlib inflate call failed (zerr=%d)\n", zerr);
+            ALOGD("zlib inflate call failed (zerr=%d)\n", zerr);
             goto z_bail;
         }
 
@@ -212,7 +212,7 @@
 
             int cc = fread(readBuf, 1, getSize, fp);
             if (cc != (int) getSize) {
-                LOGD("inflate read failed (%d vs %ld)\n",
+                ALOGD("inflate read failed (%d vs %ld)\n",
                     cc, getSize);
                 goto z_bail;
             }
@@ -226,7 +226,7 @@
         /* uncompress the data */
         zerr = inflate(&zstream, Z_NO_FLUSH);
         if (zerr != Z_OK && zerr != Z_STREAM_END) {
-            LOGD("zlib inflate call failed (zerr=%d)\n", zerr);
+            ALOGD("zlib inflate call failed (zerr=%d)\n", zerr);
             goto z_bail;
         }
 
diff --git a/libs/utils/tests/BasicHashtable_test.cpp b/libs/utils/tests/BasicHashtable_test.cpp
index 764082d..7dcf750 100644
--- a/libs/utils/tests/BasicHashtable_test.cpp
+++ b/libs/utils/tests/BasicHashtable_test.cpp
@@ -156,7 +156,7 @@
 
 template <typename TKey, typename TValue>
 static void dump(BasicHashtable<TKey, key_value_pair_t<TKey, TValue> >& h) {
-    LOGD("hashtable %p, size=%u, capacity=%u, bucketCount=%u",
+    ALOGD("hashtable %p, size=%u, capacity=%u, bucketCount=%u",
             &h, h.size(), h.capacity(), h.bucketCount());
     for (size_t i = 0; i < h.bucketCount(); i++) {
         bool collision, present;
@@ -165,11 +165,11 @@
         if (present) {
             int key, value;
             getKeyValue(h.entryAt(i), &key, &value);
-            LOGD("  [%3u] = collision=%d, present=%d, hash=0x%08x, key=%3d, value=%3d, "
+            ALOGD("  [%3u] = collision=%d, present=%d, hash=0x%08x, key=%3d, value=%3d, "
                     "hash_type(key)=0x%08x",
                     i, collision, present, hash, key, value, hash_type(key));
         } else {
-            LOGD("  [%3u] = collision=%d, present=%d",
+            ALOGD("  [%3u] = collision=%d, present=%d",
                     i, collision, present);
         }
     }