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/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index 154dbb8..f250367 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -83,7 +83,7 @@
 void BootAnimation::binderDied(const wp<IBinder>& who)
 {
     // woah, surfaceflinger died!
-    LOGD("SurfaceFlinger died, exiting...");
+    ALOGD("SurfaceFlinger died, exiting...");
 
     // calling requestExit() is not enough here because the Surface code
     // might be blocked on a condition variable that will never be updated.
@@ -394,13 +394,13 @@
         int fps, width, height, count, pause;
         char path[256];
         if (sscanf(l, "%d %d %d", &width, &height, &fps) == 3) {
-            //LOGD("> w=%d, h=%d, fps=%d", fps, width, height);
+            //ALOGD("> w=%d, h=%d, fps=%d", fps, width, height);
             animation.width = width;
             animation.height = height;
             animation.fps = fps;
         }
         if (sscanf(l, "p %d %d %s", &count, &pause, path) == 3) {
-            //LOGD("> count=%d, pause=%d, path=%s", count, pause, path);
+            //ALOGD("> count=%d, pause=%d, path=%s", count, pause, path);
             Animation::Part part;
             part.count = count;
             part.pause = pause;
diff --git a/core/jni/ActivityManager.cpp b/core/jni/ActivityManager.cpp
index 0bd14fa..0f9d0bb 100644
--- a/core/jni/ActivityManager.cpp
+++ b/core/jni/ActivityManager.cpp
@@ -48,7 +48,7 @@
                 }
             } else {
                 // An exception was thrown back; fall through to return failure
-                LOGD("openContentUri(%s) caught exception %d\n",
+                ALOGD("openContentUri(%s) caught exception %d\n",
                         String8(uri).string(), exceptionCode);
             }
         }
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index af37454..e4d3aa8 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -285,7 +285,7 @@
     JNIEnv* env;
     jmethodID methodId;
 
-    LOGD("Calling main entry %s", className);
+    ALOGD("Calling main entry %s", className);
 
     env = getJNIEnv();
     if (clazz == NULL || env == NULL) {
@@ -415,7 +415,7 @@
     }
     strncat(language, propLang, 2);
     strncat(region, propRegn, 2);
-    //LOGD("language=%s region=%s\n", language, region);
+    //ALOGD("language=%s region=%s\n", language, region);
 }
 
 /*
@@ -628,7 +628,7 @@
         "-agentlib:jdwp=transport=dt_android_adb,suspend=n,server=y";
     mOptions.add(opt);
 
-    LOGD("CheckJNI is %s\n", checkJni ? "ON" : "OFF");
+    ALOGD("CheckJNI is %s\n", checkJni ? "ON" : "OFF");
     if (checkJni) {
         /* extended JNI checking */
         opt.optionString = "-Xcheck:jni";
@@ -797,7 +797,7 @@
  */
 void AndroidRuntime::start(const char* className, const char* options)
 {
-    LOGD("\n>>>>>> AndroidRuntime START %s <<<<<<\n",
+    ALOGD("\n>>>>>> AndroidRuntime START %s <<<<<<\n",
             className != NULL ? className : "(unknown)");
 
     blockSigpipe();
@@ -824,7 +824,7 @@
     }
 
     //const char* kernelHack = getenv("LD_ASSUME_KERNEL");
-    //LOGD("Found LD_ASSUME_KERNEL='%s'\n", kernelHack);
+    //ALOGD("Found LD_ASSUME_KERNEL='%s'\n", kernelHack);
 
     /* start the virtual machine */
     JNIEnv* env;
@@ -887,7 +887,7 @@
     }
     free(slashClassName);
 
-    LOGD("Shutting down VM\n");
+    ALOGD("Shutting down VM\n");
     if (mJavaVM->DetachCurrentThread() != JNI_OK)
         LOGW("Warning: unable to detach main thread\n");
     if (mJavaVM->DestroyJavaVM() != 0)
@@ -1063,7 +1063,7 @@
     for (size_t i = 0; i < count; i++) {
         if (array[i].mProc(env) < 0) {
 #ifndef NDEBUG
-            LOGD("----------!!! %s failed to load\n", array[i].mName);
+            ALOGD("----------!!! %s failed to load\n", array[i].mName);
 #endif
             return -1;
         }
diff --git a/core/jni/android/graphics/Canvas.cpp b/core/jni/android/graphics/Canvas.cpp
index feba1e6..f118dc1 100644
--- a/core/jni/android/graphics/Canvas.cpp
+++ b/core/jni/android/graphics/Canvas.cpp
@@ -442,7 +442,7 @@
 #endif
         canvas->drawPicture(*picture);
 #ifdef TIME_DRAW
-        LOGD("---- picture playback %d ms\n", get_thread_msec() - now);
+        ALOGD("---- picture playback %d ms\n", get_thread_msec() - now);
 #endif
     }
 
diff --git a/core/jni/android/graphics/HarfbuzzSkia.cpp b/core/jni/android/graphics/HarfbuzzSkia.cpp
index d78081e..7e08379 100644
--- a/core/jni/android/graphics/HarfbuzzSkia.cpp
+++ b/core/jni/android/graphics/HarfbuzzSkia.cpp
@@ -86,7 +86,7 @@
     for (unsigned i = 0; i < numGlyphs; ++i) {
         advances[i] = SkScalarToHBFixed(scalarAdvances[i]);
 #if DEBUG_ADVANCES
-        LOGD("glyphsToAdvances -- advances[%d]=%d", i, advances[i]);
+        ALOGD("glyphsToAdvances -- advances[%d]=%d", i, advances[i]);
 #endif
     }
     delete glyphs16;
@@ -193,7 +193,7 @@
     SkTypeface* typeface = static_cast<SkTypeface*>(font);
 
     if (!typeface) {
-        LOGD("Typeface cannot be null");
+        ALOGD("Typeface cannot be null");
         return HB_Err_Invalid_Argument;
     }
     const size_t tableSize = SkFontHost::GetTableSize(typeface->uniqueID(), tag);
diff --git a/core/jni/android/graphics/TextLayout.cpp b/core/jni/android/graphics/TextLayout.cpp
index bc30ace..f88dcd6 100644
--- a/core/jni/android/graphics/TextLayout.cpp
+++ b/core/jni/android/graphics/TextLayout.cpp
@@ -190,7 +190,7 @@
     jfloat totalAdvance = 0;
     if (widths < count) {
 #if DEBUG_ADVANCES
-    LOGD("ICU -- count=%d", widths);
+    ALOGD("ICU -- count=%d", widths);
 #endif
         // Skia operates on code points, not code units, so surrogate pairs return only
         // one value. Expand the result so we have one value per UTF-16 code unit.
@@ -207,17 +207,17 @@
                 outAdvances[p++] = 0;
             }
 #if DEBUG_ADVANCES
-            LOGD("icu-adv = %f - total = %f", outAdvances[i], totalAdvance);
+            ALOGD("icu-adv = %f - total = %f", outAdvances[i], totalAdvance);
 #endif
         }
     } else {
 #if DEBUG_ADVANCES
-    LOGD("ICU -- count=%d", count);
+    ALOGD("ICU -- count=%d", count);
 #endif
         for (size_t i = 0; i < count; i++) {
             totalAdvance += outAdvances[i] = SkScalarToFloat(scalarArray[i]);
 #if DEBUG_ADVANCES
-            LOGD("icu-adv = %f - total = %f", outAdvances[i], totalAdvance);
+            ALOGD("icu-adv = %f - total = %f", outAdvances[i], totalAdvance);
 #endif
         }
     }
diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp
index ed6aaa1..44ba68e 100644
--- a/core/jni/android/graphics/TextLayoutCache.cpp
+++ b/core/jni/android/graphics/TextLayoutCache.cpp
@@ -61,12 +61,12 @@
 
     mDebugLevel = readRtlDebugLevel();
     mDebugEnabled = mDebugLevel & kRtlDebugCaches;
-    LOGD("Using debug level = %d - Debug Enabled = %d", mDebugLevel, mDebugEnabled);
+    ALOGD("Using debug level = %d - Debug Enabled = %d", mDebugLevel, mDebugEnabled);
 
     mCacheStartTime = systemTime(SYSTEM_TIME_MONOTONIC);
 
     if (mDebugEnabled) {
-        LOGD("Initialization is done - Start time = %lld", mCacheStartTime);
+        ALOGD("Initialization is done - Start time = %lld", mCacheStartTime);
     }
 
     mInitialized = true;
@@ -79,7 +79,7 @@
     size_t totalSizeToDelete = text.getSize() + desc->getSize();
     mSize -= totalSizeToDelete;
     if (mDebugEnabled) {
-        LOGD("Cache value %p deleted, size = %d", desc.get(), totalSizeToDelete);
+        ALOGD("Cache value %p deleted, size = %d", desc.get(), totalSizeToDelete);
     }
 }
 
@@ -130,7 +130,7 @@
             // Cleanup to make some room if needed
             if (mSize + size > mMaxSize) {
                 if (mDebugEnabled) {
-                    LOGD("Need to clean some entries for making some room for a new entry");
+                    ALOGD("Need to clean some entries for making some room for a new entry");
                 }
                 while (mSize + size > mMaxSize) {
                     // This will call the callback
@@ -157,7 +157,7 @@
 
             if (mDebugEnabled) {
                 nsecs_t totalTime = systemTime(SYSTEM_TIME_MONOTONIC) - startTime;
-                LOGD("CACHE MISS: Added entry %p "
+                ALOGD("CACHE MISS: Added entry %p "
                         "with start = %d, count = %d, contextCount = %d, "
                         "entry size %d bytes, remaining space %d bytes"
                         " - Compute time %0.6f ms - Put time %0.6f ms - Text = '%s'",
@@ -168,7 +168,7 @@
             }
         } else {
             if (mDebugEnabled) {
-                LOGD("CACHE MISS: Calculated but not storing entry because it is too big "
+                ALOGD("CACHE MISS: Calculated but not storing entry because it is too big "
                         "with start = %d, count = %d, contextCount = %d, "
                         "entry size %d bytes, remaining space %d bytes"
                         " - Compute time %0.6f ms - Text = '%s'",
@@ -188,7 +188,7 @@
             if (value->getElapsedTime() > 0) {
                 float deltaPercent = 100 * ((value->getElapsedTime() - elapsedTimeThruCacheGet)
                         / ((float)value->getElapsedTime()));
-                LOGD("CACHE HIT #%d with start = %d, count = %d, contextCount = %d"
+                ALOGD("CACHE HIT #%d with start = %d, count = %d, contextCount = %d"
                         "- Compute time %0.6f ms - "
                         "Cache get time %0.6f ms - Gain in percent: %2.2f - Text = '%s'",
                         mCacheHitCount, start, count, contextCount,
@@ -215,18 +215,18 @@
         bytes += mCache.getKeyAt(i).getSize() + mCache.getValueAt(i)->getSize();
     }
 
-    LOGD("------------------------------------------------");
-    LOGD("Cache stats");
-    LOGD("------------------------------------------------");
-    LOGD("pid       : %d", getpid());
-    LOGD("running   : %.0f seconds", timeRunningInSec);
-    LOGD("entries   : %d", cacheSize);
-    LOGD("max size  : %d bytes", mMaxSize);
-    LOGD("used      : %d bytes according to mSize, %d bytes actual", mSize, bytes);
-    LOGD("remaining : %d bytes or %2.2f percent", mMaxSize - mSize, remainingPercent);
-    LOGD("hits      : %d", mCacheHitCount);
-    LOGD("saved     : %0.6f ms", mNanosecondsSaved * 0.000001f);
-    LOGD("------------------------------------------------");
+    ALOGD("------------------------------------------------");
+    ALOGD("Cache stats");
+    ALOGD("------------------------------------------------");
+    ALOGD("pid       : %d", getpid());
+    ALOGD("running   : %.0f seconds", timeRunningInSec);
+    ALOGD("entries   : %d", cacheSize);
+    ALOGD("max size  : %d bytes", mMaxSize);
+    ALOGD("used      : %d bytes according to mSize, %d bytes actual", mSize, bytes);
+    ALOGD("remaining : %d bytes or %2.2f percent", mMaxSize - mSize, remainingPercent);
+    ALOGD("hits      : %d", mCacheHitCount);
+    ALOGD("saved     : %0.6f ms", mNanosecondsSaved * 0.000001f);
+    ALOGD("------------------------------------------------");
 }
 
 /**
@@ -367,7 +367,7 @@
     computeValues(paint, chars, start, count, contextCount, dirFlags,
             &value->mAdvances, &value->mTotalAdvance, &value->mGlyphs);
 #if DEBUG_ADVANCES
-    LOGD("Advances - start = %d, count = %d, contextCount = %d, totalAdvance = %f", start, count,
+    ALOGD("Advances - start = %d, count = %d, contextCount = %d, totalAdvance = %f", start, count,
             contextCount, value->mTotalAdvance);
 #endif
 }
@@ -403,21 +403,21 @@
             if (bidi) {
                 UErrorCode status = U_ZERO_ERROR;
 #if DEBUG_GLYPHS
-                LOGD("******** ComputeValues -- start");
-                LOGD("      -- string = '%s'", String8(chars + start, count).string());
-                LOGD("      -- start = %d", start);
-                LOGD("      -- count = %d", count);
-                LOGD("      -- contextCount = %d", contextCount);
-                LOGD("      -- bidiReq = %d", bidiReq);
+                ALOGD("******** ComputeValues -- start");
+                ALOGD("      -- string = '%s'", String8(chars + start, count).string());
+                ALOGD("      -- start = %d", start);
+                ALOGD("      -- count = %d", count);
+                ALOGD("      -- contextCount = %d", contextCount);
+                ALOGD("      -- bidiReq = %d", bidiReq);
 #endif
                 ubidi_setPara(bidi, chars, contextCount, bidiReq, NULL, &status);
                 if (U_SUCCESS(status)) {
                     int paraDir = ubidi_getParaLevel(bidi) & kDirection_Mask; // 0 if ltr, 1 if rtl
                     ssize_t rc = ubidi_countRuns(bidi, &status);
 #if DEBUG_GLYPHS
-                    LOGD("      -- dirFlags = %d", dirFlags);
-                    LOGD("      -- paraDir = %d", paraDir);
-                    LOGD("      -- run-count = %d", int(rc));
+                    ALOGD("      -- dirFlags = %d", dirFlags);
+                    ALOGD("      -- paraDir = %d", paraDir);
+                    ALOGD("      -- run-count = %d", int(rc));
 #endif
                     if (U_SUCCESS(status) && rc == 1) {
                         // Normal case: one run, status is ok
@@ -466,7 +466,7 @@
                             isRTL = (runDir == UBIDI_RTL);
                             jfloat runTotalAdvance = 0;
 #if DEBUG_GLYPHS
-                            LOGD("Processing Bidi Run = %d -- run-start = %d, run-len = %d, isRTL = %d",
+                            ALOGD("Processing Bidi Run = %d -- run-start = %d, run-len = %d, isRTL = %d",
                                     i, startRun, lengthRun, isRTL);
 #endif
                             computeRunValues(paint, chars + startRun, lengthRun, isRTL,
@@ -491,7 +491,7 @@
         // Default single run case
         if (useSingleRun){
 #if DEBUG_GLYPHS
-            LOGD("Using a SINGLE BiDi Run "
+            ALOGD("Using a SINGLE BiDi Run "
                     "-- run-start = %d, run-len = %d, isRTL = %d", start, count, isRTL);
 #endif
             computeRunValues(paint, chars + start, count, isRTL,
@@ -499,15 +499,15 @@
         }
 
 #if DEBUG_GLYPHS
-        LOGD("      -- Total returned glyphs-count = %d", outGlyphs->size());
-        LOGD("******** ComputeValues -- end");
+        ALOGD("      -- Total returned glyphs-count = %d", outGlyphs->size());
+        ALOGD("******** ComputeValues -- end");
 #endif
 }
 
 static void logGlyphs(HB_ShaperItem shaperItem) {
-    LOGD("         -- glyphs count=%d", shaperItem.num_glyphs);
+    ALOGD("         -- glyphs count=%d", shaperItem.num_glyphs);
     for (size_t i = 0; i < shaperItem.num_glyphs; i++) {
-        LOGD("         -- glyph[%d] = %d, offset.x = %0.2f, offset.y = %0.2f", i,
+        ALOGD("         -- glyph[%d] = %d, offset.x = %0.2f, offset.y = %0.2f", i,
                 shaperItem.glyphs[i],
                 HBFixedToFloat(shaperItem.offsets[i].x),
                 HBFixedToFloat(shaperItem.offsets[i].y));
@@ -532,7 +532,7 @@
             // So we have found a diacritic, let's get now the main code point which is paired
             // with it. As we can have several diacritics in a row, we need to iterate back again
 #if DEBUG_GLYPHS
-            LOGD("The BiDi run '%s' is containing a Diacritic at position %d",
+            ALOGD("The BiDi run '%s' is containing a Diacritic at position %d",
                     String8(chars, count).string(), int(i));
 #endif
             ssize_t j = i - 1;
@@ -549,7 +549,7 @@
             }
 
 #if DEBUG_GLYPHS
-            LOGD("Found main code point at index %d", int(j));
+            ALOGD("Found main code point at index %d", int(j));
 #endif
             // We found the main code point, so we can normalize the "chunck" and fill
             // the remaining with ZWSP so that the Paint.getTextWidth() APIs will still be able
@@ -578,12 +578,12 @@
 
 #if DEBUG_GLYPHS
     if (useNormalizedString) {
-        LOGD("Will use normalized string '%s', length = %d",
+        ALOGD("Will use normalized string '%s', length = %d",
                     String8(mNormalizedString.getTerminatedBuffer(),
                             mNormalizedString.length()).string(),
                     mNormalizedString.length());
     } else {
-        LOGD("Normalization is not needed or cannot be done, using initial string");
+        ALOGD("Normalization is not needed or cannot be done, using initial string");
     }
 #endif
 
@@ -616,15 +616,15 @@
         ssize_t endScriptRun = startScriptRun + countScriptRun;
 
 #if DEBUG_GLYPHS
-        LOGD("-------- Start of Script Run --------");
-        LOGD("Shaping Script Run with");
-        LOGD("         -- isRTL = %d", isRTL);
-        LOGD("         -- HB script = %d", mShaperItem.item.script);
-        LOGD("         -- startFontRun = %d", int(startScriptRun));
-        LOGD("         -- endFontRun = %d", int(endScriptRun));
-        LOGD("         -- countFontRun = %d", countScriptRun);
-        LOGD("         -- run = '%s'", String8(chars + startScriptRun, countScriptRun).string());
-        LOGD("         -- string = '%s'", String8(chars, count).string());
+        ALOGD("-------- Start of Script Run --------");
+        ALOGD("Shaping Script Run with");
+        ALOGD("         -- isRTL = %d", isRTL);
+        ALOGD("         -- HB script = %d", mShaperItem.item.script);
+        ALOGD("         -- startFontRun = %d", int(startScriptRun));
+        ALOGD("         -- endFontRun = %d", int(endScriptRun));
+        ALOGD("         -- countFontRun = %d", countScriptRun);
+        ALOGD("         -- run = '%s'", String8(chars + startScriptRun, countScriptRun).string());
+        ALOGD("         -- string = '%s'", String8(chars, count).string());
 #endif
 
         // Initialize Harfbuzz Shaper and get the base glyph count for offsetting the glyphIDs
@@ -632,29 +632,29 @@
         size_t glyphBaseCount = shapeFontRun(paint, isRTL);
 
 #if DEBUG_GLYPHS
-        LOGD("Got from Harfbuzz");
-        LOGD("         -- glyphBaseCount = %d", glyphBaseCount);
-        LOGD("         -- num_glypth = %d", mShaperItem.num_glyphs);
-        LOGD("         -- kerning_applied = %d", mShaperItem.kerning_applied);
-        LOGD("         -- isDevKernText = %d", paint->isDevKernText());
+        ALOGD("Got from Harfbuzz");
+        ALOGD("         -- glyphBaseCount = %d", glyphBaseCount);
+        ALOGD("         -- num_glypth = %d", mShaperItem.num_glyphs);
+        ALOGD("         -- kerning_applied = %d", mShaperItem.kerning_applied);
+        ALOGD("         -- isDevKernText = %d", paint->isDevKernText());
 
         logGlyphs(mShaperItem);
 #endif
         if (isRTL) {
             endScriptRun = startScriptRun;
 #if DEBUG_GLYPHS
-            LOGD("Updated endScriptRun = %d", int(endScriptRun));
+            ALOGD("Updated endScriptRun = %d", int(endScriptRun));
 #endif
         } else {
             startScriptRun = endScriptRun;
 #if DEBUG_GLYPHS
-            LOGD("Updated startScriptRun = %d", int(startScriptRun));
+            ALOGD("Updated startScriptRun = %d", int(startScriptRun));
 #endif
         }
 
         if (mShaperItem.advances == NULL || mShaperItem.num_glyphs == 0) {
 #if DEBUG_GLYPHS
-            LOGD("Advances array is empty or num_glypth = 0");
+            ALOGD("Advances array is empty or num_glypth = 0");
 #endif
             outAdvances->insertAt(0, outAdvances->size(), countScriptRun);
             continue;
@@ -679,9 +679,9 @@
         totalAdvance += totalFontRunAdvance;
 
 #if DEBUG_ADVANCES
-        LOGD("Returned advances");
+        ALOGD("Returned advances");
         for (size_t i = 0; i < countScriptRun; i++) {
-            LOGD("         -- hb-adv[%d] = %0.2f, log_clusters = %d, total = %0.2f", i,
+            ALOGD("         -- hb-adv[%d] = %0.2f, log_clusters = %d, total = %0.2f", i,
                     (*outAdvances)[i], mShaperItem.log_clusters[i], totalFontRunAdvance);
         }
 #endif
@@ -690,13 +690,13 @@
         if (outGlyphs) {
             size_t countGlyphs = mShaperItem.num_glyphs;
 #if DEBUG_GLYPHS
-            LOGD("Returned script run glyphs -- count = %d", countGlyphs);
+            ALOGD("Returned script run glyphs -- count = %d", countGlyphs);
 #endif
             for (size_t i = 0; i < countGlyphs; i++) {
                 jchar glyph = glyphBaseCount +
                         (jchar) mShaperItem.glyphs[(!isRTL) ? i : countGlyphs - 1 - i];
 #if DEBUG_GLYPHS
-                LOGD("         -- glyph[%d] = %d", i, glyph);
+                ALOGD("         -- glyph[%d] = %d", i, glyph);
 #endif
                 outGlyphs->add(glyph);
             }
@@ -706,7 +706,7 @@
     *outTotalAdvance = totalAdvance;
 
 #if DEBUG_GLYPHS
-    LOGD("-------- End of Script Run --------");
+    ALOGD("-------- End of Script Run --------");
 #endif
 }
 
@@ -725,7 +725,7 @@
     case HB_Script_Arabic:
         typeface = getCachedTypeface(&mArabicTypeface, TYPEFACE_ARABIC);
 #if DEBUG_GLYPHS
-        LOGD("Using Arabic Typeface");
+        ALOGD("Using Arabic Typeface");
 #endif
         break;
 
@@ -736,7 +736,7 @@
             case SkTypeface::kBoldItalic:
                 typeface = getCachedTypeface(&mHebrewBoldTypeface, TYPE_FACE_HEBREW_BOLD);
 #if DEBUG_GLYPHS
-                LOGD("Using Hebrew Bold/BoldItalic Typeface");
+                ALOGD("Using Hebrew Bold/BoldItalic Typeface");
 #endif
                 break;
 
@@ -745,14 +745,14 @@
             default:
                 typeface = getCachedTypeface(&mHebrewRegularTypeface, TYPE_FACE_HEBREW_REGULAR);
 #if DEBUG_GLYPHS
-                LOGD("Using Hebrew Regular/Italic Typeface");
+                ALOGD("Using Hebrew Regular/Italic Typeface");
 #endif
                 break;
             }
         } else {
             typeface = getCachedTypeface(&mHebrewRegularTypeface, TYPE_FACE_HEBREW_REGULAR);
 #if DEBUG_GLYPHS
-            LOGD("Using Hebrew Regular Typeface");
+            ALOGD("Using Hebrew Regular Typeface");
 #endif
         }
         break;
@@ -760,14 +760,14 @@
     case HB_Script_Bengali:
         typeface = getCachedTypeface(&mBengaliTypeface, TYPEFACE_BENGALI);
 #if DEBUG_GLYPHS
-        LOGD("Using Bengali Typeface");
+        ALOGD("Using Bengali Typeface");
 #endif
         break;
 
     case HB_Script_Thai:
         typeface = getCachedTypeface(&mThaiTypeface, TYPEFACE_THAI);
 #if DEBUG_GLYPHS
-        LOGD("Using Thai Typeface");
+        ALOGD("Using Thai Typeface");
 #endif
         break;
 
@@ -775,11 +775,11 @@
         if (!typeface) {
             typeface = mDefaultTypeface;
 #if DEBUG_GLYPHS
-            LOGD("Using Default Typeface");
+            ALOGD("Using Default Typeface");
 #endif
         } else {
 #if DEBUG_GLYPHS
-            LOGD("Using Paint Typeface");
+            ALOGD("Using Paint Typeface");
 #endif
         }
         break;
@@ -789,7 +789,7 @@
     mShaperItem.face = getCachedHBFace(typeface);
 
 #if DEBUG_GLYPHS
-    LOGD("Run typeface = %p, uniqueID = %d, hb_face = %p",
+    ALOGD("Run typeface = %p, uniqueID = %d, hb_face = %p",
             typeface, typeface->uniqueID(), mShaperItem.face);
 #endif
 
@@ -834,7 +834,7 @@
 
 void TextLayoutEngine::createShaperItemGlyphArrays(size_t size) {
 #if DEBUG_GLYPHS
-    LOGD("Creating Glyph Arrays with size = %d", size);
+    ALOGD("Creating Glyph Arrays with size = %d", size);
 #endif
     mShaperItemGlyphArraySize = size;
 
@@ -864,13 +864,13 @@
         // CreateFromFile(path) can return NULL if the path is non existing
         if (!*typeface) {
 #if DEBUG_GLYPHS
-        LOGD("Font path '%s' is not valid, will use default font", path);
+        ALOGD("Font path '%s' is not valid, will use default font", path);
 #endif
             return mDefaultTypeface;
         }
         (*typeface)->ref();
 #if DEBUG_GLYPHS
-        LOGD("Created SkTypeface from file '%s' with uniqueID = %d", path, (*typeface)->uniqueID());
+        ALOGD("Created SkTypeface from file '%s' with uniqueID = %d", path, (*typeface)->uniqueID());
 #endif
     }
     return *typeface;
@@ -885,7 +885,7 @@
     HB_Face face = HB_NewFace(typeface, harfbuzzSkiaGetTable);
     if (face) {
 #if DEBUG_GLYPHS
-        LOGD("Created HB_NewFace %p from paint typeface = %p", face, typeface);
+        ALOGD("Created HB_NewFace %p from paint typeface = %p", face, typeface);
 #endif
         mCachedHBFaces.add(fontId, face);
     }
diff --git a/core/jni/android_app_NativeActivity.cpp b/core/jni/android_app_NativeActivity.cpp
index c43e7e7..15bb543 100644
--- a/core/jni/android_app_NativeActivity.cpp
+++ b/core/jni/android_app_NativeActivity.cpp
@@ -1060,7 +1060,7 @@
         
 int register_android_app_NativeActivity(JNIEnv* env)
 {
-    //LOGD("register_android_app_NativeActivity");
+    //ALOGD("register_android_app_NativeActivity");
     jclass clazz;
     FIND_CLASS(clazz, kNativeActivityPathName);
 
diff --git a/core/jni/android_backup_BackupDataInput.cpp b/core/jni/android_backup_BackupDataInput.cpp
index c174a41..2fb0076 100644
--- a/core/jni/android_backup_BackupDataInput.cpp
+++ b/core/jni/android_backup_BackupDataInput.cpp
@@ -80,7 +80,7 @@
         return 0;
     }
     default:
-        LOGD("Unknown header type: 0x%08x\n", type);
+        ALOGD("Unknown header type: 0x%08x\n", type);
         return -1;
     }
 
@@ -133,7 +133,7 @@
 
 int register_android_backup_BackupDataInput(JNIEnv* env)
 {
-    //LOGD("register_android_backup_BackupDataInput");
+    //ALOGD("register_android_backup_BackupDataInput");
 
     jclass clazz = env->FindClass("android/app/backup/BackupDataInput$EntityHeader");
     LOG_FATAL_IF(clazz == NULL, "Unable to find class android.app.backup.BackupDataInput.EntityHeader");
diff --git a/core/jni/android_backup_BackupDataOutput.cpp b/core/jni/android_backup_BackupDataOutput.cpp
index 144a10c..f4b5dca 100644
--- a/core/jni/android_backup_BackupDataOutput.cpp
+++ b/core/jni/android_backup_BackupDataOutput.cpp
@@ -107,7 +107,7 @@
 
 int register_android_backup_BackupDataOutput(JNIEnv* env)
 {
-    //LOGD("register_android_backup_BackupDataOutput");
+    //ALOGD("register_android_backup_BackupDataOutput");
     return AndroidRuntime::registerNativeMethods(env, "android/app/backup/BackupDataOutput",
             g_methods, NELEM(g_methods));
 }
diff --git a/core/jni/android_backup_BackupHelperDispatcher.cpp b/core/jni/android_backup_BackupHelperDispatcher.cpp
index 49f1cd4..1f188ff 100644
--- a/core/jni/android_backup_BackupHelperDispatcher.cpp
+++ b/core/jni/android_backup_BackupHelperDispatcher.cpp
@@ -85,11 +85,11 @@
     }
 
 #if 0
-    LOGD("chunk header:");
-    LOGD("  headerSize=%d", flattenedHeader.headerSize);
-    LOGD("  version=0x%08x", flattenedHeader.version);
-    LOGD("  dataSize=%d", flattenedHeader.dataSize);
-    LOGD("  nameLength=%d", flattenedHeader.nameLength);
+    ALOGD("chunk header:");
+    ALOGD("  headerSize=%d", flattenedHeader.headerSize);
+    ALOGD("  version=0x%08x", flattenedHeader.version);
+    ALOGD("  dataSize=%d", flattenedHeader.dataSize);
+    ALOGD("  nameLength=%d", flattenedHeader.nameLength);
 #endif
 
     if (flattenedHeader.dataSize < 0 || flattenedHeader.nameLength < 0 ||
diff --git a/core/jni/android_bluetooth_BluetoothSocket.cpp b/core/jni/android_bluetooth_BluetoothSocket.cpp
index 32ceb2c..d9ff36a 100644
--- a/core/jni/android_bluetooth_BluetoothSocket.cpp
+++ b/core/jni/android_bluetooth_BluetoothSocket.cpp
@@ -240,7 +240,7 @@
          * retry the connect. Unfortunately we have to create a new fd.
          * It's not ideal to switch the fd underneath the object, but
          * is currently safe */
-        LOGD("Hit bug 5082381 (EALREADY on ACL collision), trying workaround");
+        ALOGD("Hit bug 5082381 (EALREADY on ACL collision), trying workaround");
         usleep(100000);
         retry++;
         abortNative(env, obj);
@@ -252,7 +252,7 @@
         goto connect;
     }
     if (!ret && retry > 0)
-        LOGD("...workaround ok");
+        ALOGD("...workaround ok");
 
     if (ret)
         jniThrowIOException(env, errno);
diff --git a/core/jni/android_bluetooth_common.cpp b/core/jni/android_bluetooth_common.cpp
index a3e99cb..c8dc9c2 100644
--- a/core/jni/android_bluetooth_common.cpp
+++ b/core/jni/android_bluetooth_common.cpp
@@ -855,7 +855,7 @@
     property_get("debug.bt.no_encrypt", value, "");
     if (!strncmp("true", value, PROPERTY_VALUE_MAX) ||
         !strncmp("1", value, PROPERTY_VALUE_MAX)) {
-        LOGD("mandatory bluetooth encryption disabled");
+        ALOGD("mandatory bluetooth encryption disabled");
         return true;
     } else {
         return false;
diff --git a/core/jni/android_database_SQLiteDatabase.cpp b/core/jni/android_database_SQLiteDatabase.cpp
index 605a11c..2966a71 100644
--- a/core/jni/android_database_SQLiteDatabase.cpp
+++ b/core/jni/android_database_SQLiteDatabase.cpp
@@ -439,7 +439,7 @@
     sqlite3 * handle = (sqlite3 *)env->GetIntField(object, offset_db_handle);
     char const *nameStr = env->GetStringUTFChars(name, NULL);
     jobject ref = env->NewGlobalRef(function);
-    LOGD_IF(DEBUG_JNI, "native_addCustomFunction %s ref: %p", nameStr, ref);
+    ALOGD_IF(DEBUG_JNI, "native_addCustomFunction %s ref: %p", nameStr, ref);
     int err = sqlite3_create_function(handle, nameStr, numArgs, SQLITE_UTF8,
             (void *)ref, custom_function_callback, NULL, NULL);
     env->ReleaseStringUTFChars(name, nameStr);
@@ -456,7 +456,7 @@
 
 static void native_releaseCustomFunction(JNIEnv* env, jobject object, jint ref)
 {
-    LOGD_IF(DEBUG_JNI, "native_releaseCustomFunction %d", ref);
+    ALOGD_IF(DEBUG_JNI, "native_releaseCustomFunction %d", ref);
     env->DeleteGlobalRef((jobject)ref);
 }
 
diff --git a/core/jni/android_ddm_DdmHandleNativeHeap.cpp b/core/jni/android_ddm_DdmHandleNativeHeap.cpp
index c3b4e3c..42d408d 100644
--- a/core/jni/android_ddm_DdmHandleNativeHeap.cpp
+++ b/core/jni/android_ddm_DdmHandleNativeHeap.cpp
@@ -87,7 +87,7 @@
                 header.mapSize += amount;
             } while (header.mapSize < MAPS_FILE_SIZE);
             
-            LOGD("**** read %d bytes from '%s'", (int) header.mapSize, path);
+            ALOGD("**** read %d bytes from '%s'", (int) header.mapSize, path);
         }
     }
 
@@ -105,7 +105,7 @@
     bytes = env->GetByteArrayElements(array, NULL);
     ptr = bytes;
 
-//    LOGD("*** mapSize: %d allocSize: %d allocInfoSize: %d totalMemory: %d", 
+//    ALOGD("*** mapSize: %d allocSize: %d allocInfoSize: %d totalMemory: %d", 
 //            header.mapSize, header.allocSize, header.allocInfoSize, header.totalMemory);
 
     memcpy(ptr, &header, sizeof(header));
diff --git a/core/jni/android_hardware_UsbDeviceConnection.cpp b/core/jni/android_hardware_UsbDeviceConnection.cpp
index 68be9e1..f53e2f7 100644
--- a/core/jni/android_hardware_UsbDeviceConnection.cpp
+++ b/core/jni/android_hardware_UsbDeviceConnection.cpp
@@ -64,7 +64,7 @@
 static void
 android_hardware_UsbDeviceConnection_close(JNIEnv *env, jobject thiz)
 {
-    LOGD("close\n");
+    ALOGD("close\n");
     struct usb_device* device = get_device_from_object(env, thiz);
     if (device) {
         usb_device_close(device);
diff --git a/core/jni/android_hardware_UsbRequest.cpp b/core/jni/android_hardware_UsbRequest.cpp
index 6bd67d1..6e1d443 100644
--- a/core/jni/android_hardware_UsbRequest.cpp
+++ b/core/jni/android_hardware_UsbRequest.cpp
@@ -42,7 +42,7 @@
 android_hardware_UsbRequest_init(JNIEnv *env, jobject thiz, jobject java_device,
         jint ep_address, jint ep_attributes, jint ep_max_packet_size, jint ep_interval)
 {
-    LOGD("init\n");
+    ALOGD("init\n");
 
     struct usb_device* device = get_device_from_object(env, java_device);
     if (!device) {
@@ -68,7 +68,7 @@
 static void
 android_hardware_UsbRequest_close(JNIEnv *env, jobject thiz)
 {
-    LOGD("close\n");
+    ALOGD("close\n");
     struct usb_request* request = get_request_from_object(env, thiz);
     if (request) {
         usb_request_free(request);
diff --git a/core/jni/android_net_NetUtils.cpp b/core/jni/android_net_NetUtils.cpp
index d9bd50e..724d9fb 100644
--- a/core/jni/android_net_NetUtils.cpp
+++ b/core/jni/android_net_NetUtils.cpp
@@ -97,7 +97,7 @@
 
     const char *nameStr = env->GetStringUTFChars(ifname, NULL);
 
-    LOGD("android_net_utils_resetConnections in env=%p clazz=%p iface=%s mask=0x%x\n",
+    ALOGD("android_net_utils_resetConnections in env=%p clazz=%p iface=%s mask=0x%x\n",
           env, clazz, nameStr, mask);
 
     result = ::ifc_reset_connections(nameStr, mask);
diff --git a/core/jni/android_net_wifi_Wifi.cpp b/core/jni/android_net_wifi_Wifi.cpp
index 25115a0..2ac3ca8 100644
--- a/core/jni/android_net_wifi_Wifi.cpp
+++ b/core/jni/android_net_wifi_Wifi.cpp
@@ -164,7 +164,7 @@
     if (command.c_str() == NULL) {
         return JNI_FALSE;
     }
-    if (DBG) LOGD("doBoolean: %s", command.c_str());
+    if (DBG) ALOGD("doBoolean: %s", command.c_str());
     return doBooleanCommand(ifname.c_str(), "OK", "%s", command.c_str());
 }
 
@@ -177,7 +177,7 @@
     if (command.c_str() == NULL) {
         return -1;
     }
-    if (DBG) LOGD("doInt: %s", command.c_str());
+    if (DBG) ALOGD("doInt: %s", command.c_str());
     return doIntCommand(ifname.c_str(), "%s", command.c_str());
 }
 
@@ -190,7 +190,7 @@
     if (command.c_str() == NULL) {
         return NULL;
     }
-    if (DBG) LOGD("doString: %s", command.c_str());
+    if (DBG) ALOGD("doString: %s", command.c_str());
     return doStringCommand(env, ifname.c_str(), "%s", command.c_str());
 }
 
diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp
index 85fac5f..f8dc618 100644
--- a/core/jni/android_os_Debug.cpp
+++ b/core/jni/android_os_Debug.cpp
@@ -530,9 +530,9 @@
         return;
     }
 
-    LOGD("Native heap dump starting...\n");
+    ALOGD("Native heap dump starting...\n");
     dumpNativeHeap(fp);
-    LOGD("Native heap dump complete.\n");
+    ALOGD("Native heap dump complete.\n");
 
     fclose(fp);
 }
diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp
index bd62268..9e3d04a 100644
--- a/core/jni/android_util_Binder.cpp
+++ b/core/jni/android_util_Binder.cpp
@@ -50,7 +50,7 @@
 
 #define DEBUG_DEATH 0
 #if DEBUG_DEATH
-#define LOGDEATH LOGD
+#define LOGDEATH ALOGD
 #else
 #define LOGDEATH ALOGV
 #endif
diff --git a/core/jni/android_util_Process.cpp b/core/jni/android_util_Process.cpp
index e7626bc..bc7e47c 100644
--- a/core/jni/android_util_Process.cpp
+++ b/core/jni/android_util_Process.cpp
@@ -205,9 +205,9 @@
     }
 
     if (grp == ANDROID_TGROUP_BG_NONINTERACT) {
-        LOGD("setProcessGroup: vvv pid %d (%s)", pid, cmdline);
+        ALOGD("setProcessGroup: vvv pid %d (%s)", pid, cmdline);
     } else {
-        LOGD("setProcessGroup: ^^^ pid %d (%s)", pid, cmdline);
+        ALOGD("setProcessGroup: ^^^ pid %d (%s)", pid, cmdline);
     }
 #endif
     sprintf(proc_path, "/proc/%d/task", pid);
diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp
index 5860658..383d5ae 100644
--- a/core/jni/android_view_GLES20Canvas.cpp
+++ b/core/jni/android_view_GLES20Canvas.cpp
@@ -66,7 +66,7 @@
 
 // Debug
 #if DEBUG_RENDERER
-    #define RENDERER_LOGD(...) LOGD(__VA_ARGS__)
+    #define RENDERER_LOGD(...) ALOGD(__VA_ARGS__)
 #else
     #define RENDERER_LOGD(...)
 #endif
diff --git a/core/jni/android_view_InputEventReceiver.cpp b/core/jni/android_view_InputEventReceiver.cpp
index 523baf1..c8f1f51 100644
--- a/core/jni/android_view_InputEventReceiver.cpp
+++ b/core/jni/android_view_InputEventReceiver.cpp
@@ -74,13 +74,13 @@
         mReceiverObjGlobal(env->NewGlobalRef(receiverObj)),
         mInputConsumer(inputChannel), mLooper(looper), mEventInProgress(false) {
 #if DEBUG_DISPATCH_CYCLE
-    LOGD("channel '%s' ~ Initializing input event receiver.", getInputChannelName());
+    ALOGD("channel '%s' ~ Initializing input event receiver.", getInputChannelName());
 #endif
 }
 
 NativeInputEventReceiver::~NativeInputEventReceiver() {
 #if DEBUG_DISPATCH_CYCLE
-    LOGD("channel '%s' ~ Disposing input event receiver.", getInputChannelName());
+    ALOGD("channel '%s' ~ Disposing input event receiver.", getInputChannelName());
 #endif
 
     mLooper->removeFd(mInputConsumer.getChannel()->getReceivePipeFd());
@@ -108,7 +108,7 @@
 status_t NativeInputEventReceiver::finishInputEvent(bool handled) {
     if (mEventInProgress) {
 #if DEBUG_DISPATCH_CYCLE
-        LOGD("channel '%s' ~ Finished input event.", getInputChannelName());
+        ALOGD("channel '%s' ~ Finished input event.", getInputChannelName());
 #endif
         mEventInProgress = false;
 
@@ -166,7 +166,7 @@
     switch (inputEvent->getType()) {
     case AINPUT_EVENT_TYPE_KEY:
 #if DEBUG_DISPATCH_CYCLE
-        LOGD("channel '%s' ~ Received key event.",
+        ALOGD("channel '%s' ~ Received key event.",
                 r->getInputChannelName());
 #endif
         inputEventObj = android_view_KeyEvent_fromNative(env,
@@ -175,7 +175,7 @@
 
     case AINPUT_EVENT_TYPE_MOTION:
 #if DEBUG_DISPATCH_CYCLE
-        LOGD("channel '%s' ~ Received motion event.",
+        ALOGD("channel '%s' ~ Received motion event.",
                 r->getInputChannelName());
 #endif
         inputEventObj = android_view_MotionEvent_obtainAsCopy(env,
@@ -197,12 +197,12 @@
     r->mEventInProgress = true;
 
 #if DEBUG_DISPATCH_CYCLE
-    LOGD("channel '%s' ~ Invoking input handler.", r->getInputChannelName());
+    ALOGD("channel '%s' ~ Invoking input handler.", r->getInputChannelName());
 #endif
     env->CallVoidMethod(r->mReceiverObjGlobal,
             gInputEventReceiverClassInfo.dispatchInputEvent, inputEventObj);
 #if DEBUG_DISPATCH_CYCLE
-    LOGD("channel '%s' ~ Returned from input handler.", r->getInputChannelName());
+    ALOGD("channel '%s' ~ Returned from input handler.", r->getInputChannelName());
 #endif
 
     if (env->ExceptionCheck()) {
diff --git a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
index 9d2ab28..62ea277 100644
--- a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
+++ b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
@@ -174,7 +174,7 @@
     time_t modTime;
 
     if (!zipFile->getEntryInfo(zipEntry, NULL, &uncompLen, NULL, NULL, &when, &crc)) {
-        LOGD("Couldn't read zip entry info\n");
+        ALOGD("Couldn't read zip entry info\n");
         return INSTALL_FAILED_INVALID_APK;
     } else {
         struct tm t;
@@ -187,7 +187,7 @@
     char localFileName[nativeLibPath.size() + fileNameLen + 2];
 
     if (strlcpy(localFileName, nativeLibPath.c_str(), sizeof(localFileName)) != nativeLibPath.size()) {
-        LOGD("Couldn't allocate local file name for library");
+        ALOGD("Couldn't allocate local file name for library");
         return INSTALL_FAILED_INTERNAL_ERROR;
     }
 
@@ -195,7 +195,7 @@
 
     if (strlcpy(localFileName + nativeLibPath.size() + 1, fileName, sizeof(localFileName)
                     - nativeLibPath.size() - 1) != fileNameLen) {
-        LOGD("Couldn't allocate local file name for library");
+        ALOGD("Couldn't allocate local file name for library");
         return INSTALL_FAILED_INTERNAL_ERROR;
     }
 
@@ -208,7 +208,7 @@
     char localTmpFileName[nativeLibPath.size() + TMP_FILE_PATTERN_LEN + 2];
     if (strlcpy(localTmpFileName, nativeLibPath.c_str(), sizeof(localTmpFileName))
             != nativeLibPath.size()) {
-        LOGD("Couldn't allocate local file name for library");
+        ALOGD("Couldn't allocate local file name for library");
         return INSTALL_FAILED_INTERNAL_ERROR;
     }
 
diff --git a/drm/libdrmframework/plugins/common/util/src/MimeTypeUtil.cpp b/drm/libdrmframework/plugins/common/util/src/MimeTypeUtil.cpp
index 57ef799..576ed15 100644
--- a/drm/libdrmframework/plugins/common/util/src/MimeTypeUtil.cpp
+++ b/drm/libdrmframework/plugins/common/util/src/MimeTypeUtil.cpp
@@ -24,7 +24,7 @@
 
 #ifdef DRM_OMA_FL_ENGINE_DEBUG
 #define LOG_NDEBUG 0
-#define LOG_DEBUG(...) LOGD(__VA_ARGS__)
+#define LOG_DEBUG(...) ALOGD(__VA_ARGS__)
 #else
 #define LOG_DEBUG(...)
 #endif
diff --git a/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp b/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp
index 976978f..0ffc0a7 100644
--- a/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp
+++ b/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp
@@ -58,7 +58,7 @@
 
 DrmConstraints* DrmPassthruPlugIn::onGetConstraints(
         int uniqueId, const String8* path, int action) {
-    LOGD("DrmPassthruPlugIn::onGetConstraints From Path: %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onGetConstraints From Path: %d", uniqueId);
     DrmConstraints* drmConstraints = new DrmConstraints();
 
     String8 value("dummy_available_time");
@@ -73,7 +73,7 @@
 }
 
 DrmInfoStatus* DrmPassthruPlugIn::onProcessDrmInfo(int uniqueId, const DrmInfo* drmInfo) {
-    LOGD("DrmPassthruPlugIn::onProcessDrmInfo - Enter : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onProcessDrmInfo - Enter : %d", uniqueId);
     DrmInfoStatus* drmInfoStatus = NULL;
     if (NULL != drmInfo) {
         switch (drmInfo->getInfoType()) {
@@ -102,28 +102,28 @@
         }
         }
     }
-    LOGD("DrmPassthruPlugIn::onProcessDrmInfo - Exit");
+    ALOGD("DrmPassthruPlugIn::onProcessDrmInfo - Exit");
     return drmInfoStatus;
 }
 
 status_t DrmPassthruPlugIn::onSetOnInfoListener(
             int uniqueId, const IDrmEngine::OnInfoListener* infoListener) {
-    LOGD("DrmPassthruPlugIn::onSetOnInfoListener : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onSetOnInfoListener : %d", uniqueId);
     return DRM_NO_ERROR;
 }
 
 status_t DrmPassthruPlugIn::onInitialize(int uniqueId) {
-    LOGD("DrmPassthruPlugIn::onInitialize : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onInitialize : %d", uniqueId);
     return DRM_NO_ERROR;
 }
 
 status_t DrmPassthruPlugIn::onTerminate(int uniqueId) {
-    LOGD("DrmPassthruPlugIn::onTerminate : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onTerminate : %d", uniqueId);
     return DRM_NO_ERROR;
 }
 
 DrmSupportInfo* DrmPassthruPlugIn::onGetSupportInfo(int uniqueId) {
-    LOGD("DrmPassthruPlugIn::onGetSupportInfo : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onGetSupportInfo : %d", uniqueId);
     DrmSupportInfo* drmSupportInfo = new DrmSupportInfo();
     // Add mimetype's
     drmSupportInfo->addMimeType(String8("application/vnd.passthru.drm"));
@@ -136,12 +136,12 @@
 
 status_t DrmPassthruPlugIn::onSaveRights(int uniqueId, const DrmRights& drmRights,
             const String8& rightsPath, const String8& contentPath) {
-    LOGD("DrmPassthruPlugIn::onSaveRights : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onSaveRights : %d", uniqueId);
     return DRM_NO_ERROR;
 }
 
 DrmInfo* DrmPassthruPlugIn::onAcquireDrmInfo(int uniqueId, const DrmInfoRequest* drmInfoRequest) {
-    LOGD("DrmPassthruPlugIn::onAcquireDrmInfo : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onAcquireDrmInfo : %d", uniqueId);
     DrmInfo* drmInfo = NULL;
 
     if (NULL != drmInfoRequest) {
@@ -157,65 +157,65 @@
 }
 
 bool DrmPassthruPlugIn::onCanHandle(int uniqueId, const String8& path) {
-    LOGD("DrmPassthruPlugIn::canHandle: %s ", path.string());
+    ALOGD("DrmPassthruPlugIn::canHandle: %s ", path.string());
     String8 extension = path.getPathExtension();
     extension.toLower();
     return (String8(".passthru") == extension);
 }
 
 String8 DrmPassthruPlugIn::onGetOriginalMimeType(int uniqueId, const String8& path) {
-    LOGD("DrmPassthruPlugIn::onGetOriginalMimeType() : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onGetOriginalMimeType() : %d", uniqueId);
     return String8("video/passthru");
 }
 
 int DrmPassthruPlugIn::onGetDrmObjectType(
             int uniqueId, const String8& path, const String8& mimeType) {
-    LOGD("DrmPassthruPlugIn::onGetDrmObjectType() : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onGetDrmObjectType() : %d", uniqueId);
     return DrmObjectType::UNKNOWN;
 }
 
 int DrmPassthruPlugIn::onCheckRightsStatus(int uniqueId, const String8& path, int action) {
-    LOGD("DrmPassthruPlugIn::onCheckRightsStatus() : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onCheckRightsStatus() : %d", uniqueId);
     int rightsStatus = RightsStatus::RIGHTS_VALID;
     return rightsStatus;
 }
 
 status_t DrmPassthruPlugIn::onConsumeRights(int uniqueId, DecryptHandle* decryptHandle,
             int action, bool reserve) {
-    LOGD("DrmPassthruPlugIn::onConsumeRights() : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onConsumeRights() : %d", uniqueId);
     return DRM_NO_ERROR;
 }
 
 status_t DrmPassthruPlugIn::onSetPlaybackStatus(int uniqueId, DecryptHandle* decryptHandle,
             int playbackStatus, int64_t position) {
-    LOGD("DrmPassthruPlugIn::onSetPlaybackStatus() : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onSetPlaybackStatus() : %d", uniqueId);
     return DRM_NO_ERROR;
 }
 
 bool DrmPassthruPlugIn::onValidateAction(int uniqueId, const String8& path,
             int action, const ActionDescription& description) {
-    LOGD("DrmPassthruPlugIn::onValidateAction() : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onValidateAction() : %d", uniqueId);
     return true;
 }
 
 status_t DrmPassthruPlugIn::onRemoveRights(int uniqueId, const String8& path) {
-    LOGD("DrmPassthruPlugIn::onRemoveRights() : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onRemoveRights() : %d", uniqueId);
     return DRM_NO_ERROR;
 }
 
 status_t DrmPassthruPlugIn::onRemoveAllRights(int uniqueId) {
-    LOGD("DrmPassthruPlugIn::onRemoveAllRights() : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onRemoveAllRights() : %d", uniqueId);
     return DRM_NO_ERROR;
 }
 
 status_t DrmPassthruPlugIn::onOpenConvertSession(int uniqueId, int convertId) {
-    LOGD("DrmPassthruPlugIn::onOpenConvertSession() : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onOpenConvertSession() : %d", uniqueId);
     return DRM_NO_ERROR;
 }
 
 DrmConvertedStatus* DrmPassthruPlugIn::onConvertData(
             int uniqueId, int convertId, const DrmBuffer* inputData) {
-    LOGD("DrmPassthruPlugIn::onConvertData() : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onConvertData() : %d", uniqueId);
     DrmBuffer* convertedData = NULL;
 
     if (NULL != inputData && 0 < inputData->length) {
@@ -229,13 +229,13 @@
 }
 
 DrmConvertedStatus* DrmPassthruPlugIn::onCloseConvertSession(int uniqueId, int convertId) {
-    LOGD("DrmPassthruPlugIn::onCloseConvertSession() : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onCloseConvertSession() : %d", uniqueId);
     return new DrmConvertedStatus(DrmConvertedStatus::STATUS_OK, NULL, 0 /*offset*/);
 }
 
 status_t DrmPassthruPlugIn::onOpenDecryptSession(
             int uniqueId, DecryptHandle* decryptHandle, int fd, off64_t offset, off64_t length) {
-    LOGD("DrmPassthruPlugIn::onOpenDecryptSession() : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onOpenDecryptSession() : %d", uniqueId);
 
 #ifdef ENABLE_PASSTHRU_DECRYPTION
     decryptHandle->mimeType = String8("video/passthru");
@@ -254,7 +254,7 @@
 }
 
 status_t DrmPassthruPlugIn::onCloseDecryptSession(int uniqueId, DecryptHandle* decryptHandle) {
-    LOGD("DrmPassthruPlugIn::onCloseDecryptSession() : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onCloseDecryptSession() : %d", uniqueId);
     if (NULL != decryptHandle) {
         if (NULL != decryptHandle->decryptInfo) {
             delete decryptHandle->decryptInfo; decryptHandle->decryptInfo = NULL;
@@ -266,13 +266,13 @@
 
 status_t DrmPassthruPlugIn::onInitializeDecryptUnit(int uniqueId, DecryptHandle* decryptHandle,
             int decryptUnitId, const DrmBuffer* headerInfo) {
-    LOGD("DrmPassthruPlugIn::onInitializeDecryptUnit() : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onInitializeDecryptUnit() : %d", uniqueId);
     return DRM_NO_ERROR;
 }
 
 status_t DrmPassthruPlugIn::onDecrypt(int uniqueId, DecryptHandle* decryptHandle,
             int decryptUnitId, const DrmBuffer* encBuffer, DrmBuffer** decBuffer, DrmBuffer* IV) {
-    LOGD("DrmPassthruPlugIn::onDecrypt() : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onDecrypt() : %d", uniqueId);
     /**
      * As a workaround implementation passthru would copy the given
      * encrypted buffer as it is to decrypted buffer. Note, decBuffer
@@ -287,13 +287,13 @@
 
 status_t DrmPassthruPlugIn::onFinalizeDecryptUnit(
             int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId) {
-    LOGD("DrmPassthruPlugIn::onFinalizeDecryptUnit() : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onFinalizeDecryptUnit() : %d", uniqueId);
     return DRM_NO_ERROR;
 }
 
 ssize_t DrmPassthruPlugIn::onPread(int uniqueId, DecryptHandle* decryptHandle,
             void* buffer, ssize_t numBytes, off64_t offset) {
-    LOGD("DrmPassthruPlugIn::onPread() : %d", uniqueId);
+    ALOGD("DrmPassthruPlugIn::onPread() : %d", uniqueId);
     return 0;
 }
 
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);
         }
     }
diff --git a/media/jni/android_mtp_MtpDevice.cpp b/media/jni/android_mtp_MtpDevice.cpp
index 6b73f6c..c71410b 100644
--- a/media/jni/android_mtp_MtpDevice.cpp
+++ b/media/jni/android_mtp_MtpDevice.cpp
@@ -132,12 +132,12 @@
 {
     MtpDevice* device = get_device_from_object(env, thiz);
     if (!device) {
-        LOGD("android_mtp_MtpDevice_get_device_info device is null");
+        ALOGD("android_mtp_MtpDevice_get_device_info device is null");
         return NULL;
     }
     MtpDeviceInfo* deviceInfo = device->getDeviceInfo();
     if (!deviceInfo) {
-        LOGD("android_mtp_MtpDevice_get_device_info deviceInfo is null");
+        ALOGD("android_mtp_MtpDevice_get_device_info deviceInfo is null");
         return NULL;
     }
     jobject info = env->NewObject(clazz_deviceInfo, constructor_deviceInfo);
@@ -429,7 +429,7 @@
 {
     jclass clazz;
 
-    LOGD("register_android_mtp_MtpDevice\n");
+    ALOGD("register_android_mtp_MtpDevice\n");
 
     clazz = env->FindClass("android/mtp/MtpDeviceInfo");
     if (clazz == NULL) {
diff --git a/media/libdrm/mobile1/src/parser/parser_dm.c b/media/libdrm/mobile1/src/parser/parser_dm.c
index 567e650..f5b7aaf 100644
--- a/media/libdrm/mobile1/src/parser/parser_dm.c
+++ b/media/libdrm/mobile1/src/parser/parser_dm.c
@@ -138,7 +138,7 @@
 
                     /* error: more than one content id */
                     if(drm_strnstr(pStart, (uint8_t*)HEADERS_CONTENT_ID, pBufferEnd - pStart)){
-                        LOGD("drm_dmParser: error: more than one content id\r\n");
+                        ALOGD("drm_dmParser: error: more than one content id\r\n");
                         return FALSE;
                     }
 
diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp
index b9a5bc5..61d0dad 100644
--- a/media/libmedia/AudioSystem.cpp
+++ b/media/libmedia/AudioSystem.cpp
@@ -190,7 +190,7 @@
 float AudioSystem::linearToLog(int volume)
 {
     // float v = volume ? exp(float(100 - volume) * dBConvert) : 0;
-    // LOGD("linearToLog(%d)=%f", volume, v);
+    // ALOGD("linearToLog(%d)=%f", volume, v);
     // return v;
     return volume ? exp(float(100 - volume) * dBConvert) : 0;
 }
@@ -198,7 +198,7 @@
 int AudioSystem::logToLinear(float volume)
 {
     // int v = volume ? 100 - int(dBConvertInverse * log(volume) + 0.5) : 0;
-    // LOGD("logTolinear(%d)=%f", v, volume);
+    // ALOGD("logTolinear(%d)=%f", v, volume);
     // return v;
     return volume ? 100 - int(dBConvertInverse * log(volume) + 0.5) : 0;
 }
diff --git a/media/libmedia/MediaScanner.cpp b/media/libmedia/MediaScanner.cpp
index b304f8c..cda185f 100644
--- a/media/libmedia/MediaScanner.cpp
+++ b/media/libmedia/MediaScanner.cpp
@@ -135,7 +135,7 @@
     struct dirent* entry;
 
     if (shouldSkipDirectory(path)) {
-      LOGD("Skipping: %s", path);
+      ALOGD("Skipping: %s", path);
       return MEDIA_SCAN_RESULT_OK;
     }
 
@@ -199,7 +199,7 @@
                 type = DT_DIR;
             }
         } else {
-            LOGD("stat() failed for %s: %s", path, strerror(errno) );
+            ALOGD("stat() failed for %s: %s", path, strerror(errno) );
         }
     }
     if (type == DT_DIR) {
diff --git a/media/libmedia/mediaplayer.cpp b/media/libmedia/mediaplayer.cpp
index 5853144..695c4a8 100644
--- a/media/libmedia/mediaplayer.cpp
+++ b/media/libmedia/mediaplayer.cpp
@@ -201,7 +201,7 @@
 
 status_t MediaPlayer::setMetadataFilter(const Parcel& filter)
 {
-    LOGD("setMetadataFilter");
+    ALOGD("setMetadataFilter");
     Mutex::Autolock lock(mLock);
     if (mPlayer == NULL) {
         return NO_INIT;
@@ -211,7 +211,7 @@
 
 status_t MediaPlayer::getMetadata(bool update_only, bool apply_filter, Parcel *metadata)
 {
-    LOGD("getMetadata");
+    ALOGD("getMetadata");
     Mutex::Autolock lock(mLock);
     if (mPlayer == NULL) {
         return NO_INIT;
diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp
index 27d8c03..487c433 100644
--- a/media/libmediaplayerservice/MediaPlayerService.cpp
+++ b/media/libmediaplayerservice/MediaPlayerService.cpp
@@ -489,7 +489,7 @@
     mUID = uid;
 
 #if CALLBACK_ANTAGONIZER
-    LOGD("create Antagonizer");
+    ALOGD("create Antagonizer");
     mAntagonizer = new Antagonizer(notify, this);
 #endif
 }
@@ -523,7 +523,7 @@
     if (p != 0) {
         p->setNotifyCallback(0, 0);
 #if CALLBACK_ANTAGONIZER
-        LOGD("kill Antagonizer");
+        ALOGD("kill Antagonizer");
         mAntagonizer->kill();
 #endif
         p->reset();
@@ -925,7 +925,7 @@
     if (p == 0) return UNKNOWN_ERROR;
     status_t ret = p->prepareAsync();
 #if CALLBACK_ANTAGONIZER
-    LOGD("start Antagonizer");
+    ALOGD("start Antagonizer");
     if (ret == NO_ERROR) mAntagonizer->start();
 #endif
     return ret;
@@ -1131,7 +1131,7 @@
 
 int Antagonizer::callbackThread(void* user)
 {
-    LOGD("Antagonizer started");
+    ALOGD("Antagonizer started");
     Antagonizer* p = reinterpret_cast<Antagonizer*>(user);
     while (!p->mExit) {
         if (p->mActive) {
@@ -1142,7 +1142,7 @@
     }
     Mutex::Autolock _l(p->mLock);
     p->mCondition.signal();
-    LOGD("Antagonizer stopped");
+    ALOGD("Antagonizer stopped");
     return 0;
 }
 #endif
@@ -1160,7 +1160,7 @@
     // If the application wants to decode those, it should open a
     // filedescriptor for them and use that.
     if (url != NULL && strncmp(url, "http://", 7) != 0) {
-        LOGD("Can't decode %s by path, use filedescriptor instead", url);
+        ALOGD("Can't decode %s by path, use filedescriptor instead", url);
         return mem;
     }
 
@@ -1347,7 +1347,7 @@
 
     // Check argument "bufferCount" against the mininum buffer count
     if (bufferCount < mMinBufferCount) {
-        LOGD("bufferCount (%d) is too small and increased to %d", bufferCount, mMinBufferCount);
+        ALOGD("bufferCount (%d) is too small and increased to %d", bufferCount, mMinBufferCount);
         bufferCount = mMinBufferCount;
 
     }
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index 964cb1f..6fb16f5 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -2256,7 +2256,7 @@
 status_t AwesomePlayer::setCacheStatCollectFreq(const Parcel &request) {
     if (mCachedSource != NULL) {
         int32_t freqMs = request.readInt32();
-        LOGD("Request to keep cache stats in the past %d ms",
+        ALOGD("Request to keep cache stats in the past %d ms",
             freqMs);
         return mCachedSource->setCacheStatCollectFreq(freqMs);
     }
diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/CameraSource.cpp
index 927e122..080faa6 100755
--- a/media/libstagefright/CameraSource.cpp
+++ b/media/libstagefright/CameraSource.cpp
@@ -254,7 +254,7 @@
     *isSetVideoSizeSupported = true;
     params.getSupportedVideoSizes(sizes);
     if (sizes.size() == 0) {
-        LOGD("Camera does not support setVideoSize()");
+        ALOGD("Camera does not support setVideoSize()");
         params.getSupportedPreviewSizes(sizes);
         *isSetVideoSizeSupported = false;
     }
@@ -633,7 +633,7 @@
 }
 
 status_t CameraSource::stop() {
-    LOGD("stop: E");
+    ALOGD("stop: E");
     Mutex::Autolock autoLock(mLock);
     mStarted = false;
     mFrameAvailableCondition.signal();
@@ -670,7 +670,7 @@
     }
 
     CHECK_EQ(mNumFramesReceived, mNumFramesEncoded + mNumFramesDropped);
-    LOGD("stop: X");
+    ALOGD("stop: X");
     return OK;
 }
 
diff --git a/media/libstagefright/CameraSourceTimeLapse.cpp b/media/libstagefright/CameraSourceTimeLapse.cpp
index 4f6c8d1..22c3182 100644
--- a/media/libstagefright/CameraSourceTimeLapse.cpp
+++ b/media/libstagefright/CameraSourceTimeLapse.cpp
@@ -69,7 +69,7 @@
       mSkipCurrentFrame(false) {
 
     mTimeBetweenFrameCaptureUs = timeBetweenFrameCaptureUs;
-    LOGD("starting time lapse mode: %lld us",
+    ALOGD("starting time lapse mode: %lld us",
         mTimeBetweenFrameCaptureUs);
 
     mVideoWidth = videoSize.width;
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp
index dfee281..a368e0a 100755
--- a/media/libstagefright/MPEG4Writer.cpp
+++ b/media/libstagefright/MPEG4Writer.cpp
@@ -539,7 +539,7 @@
 }
 
 void MPEG4Writer::stopWriterThread() {
-    LOGD("Stopping writer thread");
+    ALOGD("Stopping writer thread");
     if (!mWriterThreadStarted) {
         return;
     }
@@ -554,7 +554,7 @@
     void *dummy;
     pthread_join(mThread, &dummy);
     mWriterThreadStarted = false;
-    LOGD("Writer thread stopped");
+    ALOGD("Writer thread stopped");
 }
 
 /*
@@ -650,7 +650,7 @@
     }
 
     if (mTracks.size() > 1) {
-        LOGD("Duration from tracks range is [%lld, %lld] us",
+        ALOGD("Duration from tracks range is [%lld, %lld] us",
             minDurationUs, maxDurationUs);
     }
 
@@ -1338,7 +1338,7 @@
     sendSessionSummary();
 
     mChunkInfos.clear();
-    LOGD("%d chunks are written in the last batch", outstandingChunks);
+    ALOGD("%d chunks are written in the last batch", outstandingChunks);
 }
 
 bool MPEG4Writer::findChunkToWrite(Chunk *chunk) {
@@ -1523,7 +1523,7 @@
 }
 
 status_t MPEG4Writer::Track::stop() {
-    LOGD("Stopping %s track", mIsAudio? "Audio": "Video");
+    ALOGD("Stopping %s track", mIsAudio? "Audio": "Video");
     if (!mStarted) {
         LOGE("Stop() called but track is not started");
         return ERROR_END_OF_STREAM;
@@ -1539,7 +1539,7 @@
 
     status_t err = (status_t) dummy;
 
-    LOGD("Stopping %s track source", mIsAudio? "Audio": "Video");
+    ALOGD("Stopping %s track source", mIsAudio? "Audio": "Video");
     {
         status_t status = mSource->stop();
         if (err == OK && status != OK && status != ERROR_END_OF_STREAM) {
@@ -1547,7 +1547,7 @@
         }
     }
 
-    LOGD("%s track stopped", mIsAudio? "Audio": "Video");
+    ALOGD("%s track stopped", mIsAudio? "Audio": "Video");
     return err;
 }
 
diff --git a/media/mtp/MtpDevice.cpp b/media/mtp/MtpDevice.cpp
index 8a8d493..b370225 100644
--- a/media/mtp/MtpDevice.cpp
+++ b/media/mtp/MtpDevice.cpp
@@ -72,7 +72,7 @@
             {
                 char* manufacturerName = usb_device_get_manufacturer_name(device);
                 char* productName = usb_device_get_product_name(device);
-                LOGD("Found camera: \"%s\" \"%s\"\n", manufacturerName, productName);
+                ALOGD("Found camera: \"%s\" \"%s\"\n", manufacturerName, productName);
                 free(manufacturerName);
                 free(productName);
             } else if (interface->bInterfaceClass == 0xFF &&
@@ -90,7 +90,7 @@
                 // Looks like an android style MTP device
                 char* manufacturerName = usb_device_get_manufacturer_name(device);
                 char* productName = usb_device_get_product_name(device);
-                LOGD("Found MTP device: \"%s\" \"%s\"\n", manufacturerName, productName);
+                ALOGD("Found MTP device: \"%s\" \"%s\"\n", manufacturerName, productName);
                 free(manufacturerName);
                 free(productName);
             }
@@ -666,7 +666,7 @@
 
 // reads the object's data and writes it to the specified file path
 bool MtpDevice::readObject(MtpObjectHandle handle, const char* destPath, int group, int perm) {
-    LOGD("readObject: %s", destPath);
+    ALOGD("readObject: %s", destPath);
     int fd = ::open(destPath, O_RDWR | O_CREAT | O_TRUNC);
     if (fd < 0) {
         LOGE("open failed for %s", destPath);
@@ -790,7 +790,7 @@
     ALOGV("readData returned %d\n", ret);
     if (ret >= MTP_CONTAINER_HEADER_SIZE) {
         if (mData.getContainerType() == MTP_CONTAINER_TYPE_RESPONSE) {
-            LOGD("got response packet instead of data packet");
+            ALOGD("got response packet instead of data packet");
             // we got a response packet rather than data
             // copy it to mResponse
             mResponse.copyFrom(mData);
@@ -827,7 +827,7 @@
         mResponse.dump();
         return mResponse.getResponseCode();
     } else {
-        LOGD("readResponse failed\n");
+        ALOGD("readResponse failed\n");
         return -1;
     }
 }
diff --git a/media/mtp/MtpObjectInfo.cpp b/media/mtp/MtpObjectInfo.cpp
index ea68c3b..cd15343 100644
--- a/media/mtp/MtpObjectInfo.cpp
+++ b/media/mtp/MtpObjectInfo.cpp
@@ -91,17 +91,17 @@
 }
 
 void MtpObjectInfo::print() {
-    LOGD("MtpObject Info %08X: %s\n", mHandle, mName);
-    LOGD("  mStorageID: %08X mFormat: %04X mProtectionStatus: %d\n",
+    ALOGD("MtpObject Info %08X: %s\n", mHandle, mName);
+    ALOGD("  mStorageID: %08X mFormat: %04X mProtectionStatus: %d\n",
             mStorageID, mFormat, mProtectionStatus);
-    LOGD("  mCompressedSize: %d mThumbFormat: %04X mThumbCompressedSize: %d\n",
+    ALOGD("  mCompressedSize: %d mThumbFormat: %04X mThumbCompressedSize: %d\n",
             mCompressedSize, mFormat, mThumbCompressedSize);
-    LOGD("  mThumbPixWidth: %d mThumbPixHeight: %d\n", mThumbPixWidth, mThumbPixHeight);
-    LOGD("  mImagePixWidth: %d mImagePixHeight: %d mImagePixDepth: %d\n",
+    ALOGD("  mThumbPixWidth: %d mThumbPixHeight: %d\n", mThumbPixWidth, mThumbPixHeight);
+    ALOGD("  mImagePixWidth: %d mImagePixHeight: %d mImagePixDepth: %d\n",
             mImagePixWidth, mImagePixHeight, mImagePixDepth);
-    LOGD("  mParent: %08X mAssociationType: %04X mAssociationDesc: %04X\n",
+    ALOGD("  mParent: %08X mAssociationType: %04X mAssociationDesc: %04X\n",
             mParent, mAssociationType, mAssociationDesc);
-    LOGD("  mSequenceNumber: %d mDateCreated: %ld mDateModified: %ld mKeywords: %s\n",
+    ALOGD("  mSequenceNumber: %d mDateCreated: %ld mDateModified: %ld mKeywords: %s\n",
             mSequenceNumber, mDateCreated, mDateModified, mKeywords);
 }
 
diff --git a/media/mtp/MtpServer.cpp b/media/mtp/MtpServer.cpp
index 1334e6c..838c13e 100644
--- a/media/mtp/MtpServer.cpp
+++ b/media/mtp/MtpServer.cpp
@@ -878,7 +878,7 @@
             return MTP_RESPONSE_OBJECT_TOO_LARGE;
     }
 
-LOGD("path: %s parent: %d storageID: %08X", (const char*)path, parent, storageID);
+    ALOGD("path: %s parent: %d storageID: %08X", (const char*)path, parent, storageID);
     MtpObjectHandle handle = mDatabase->beginSendObject((const char*)path,
             format, parent, storageID, mSendObjectFileSize, modifiedTime);
     if (handle == kInvalidObjectHandle) {
@@ -1104,7 +1104,7 @@
 
     // can't start writing past the end of the file
     if (offset > edit->mSize) {
-        LOGD("writing past end of object, offset: %lld, edit->mSize: %lld", offset, edit->mSize);
+        ALOGD("writing past end of object, offset: %lld, edit->mSize: %lld", offset, edit->mSize);
         return MTP_RESPONSE_GENERAL_ERROR;
     }
 
diff --git a/media/mtp/MtpStorageInfo.cpp b/media/mtp/MtpStorageInfo.cpp
index ca64ac0..dcd37cd 100644
--- a/media/mtp/MtpStorageInfo.cpp
+++ b/media/mtp/MtpStorageInfo.cpp
@@ -61,11 +61,11 @@
 }
 
 void MtpStorageInfo::print() {
-    LOGD("Storage Info %08X:\n\tmStorageType: %d\n\tmFileSystemType: %d\n\tmAccessCapability: %d\n",
+    ALOGD("Storage Info %08X:\n\tmStorageType: %d\n\tmFileSystemType: %d\n\tmAccessCapability: %d\n",
             mStorageID, mStorageType, mFileSystemType, mAccessCapability);
-    LOGD("\tmMaxCapacity: %lld\n\tmFreeSpaceBytes: %lld\n\tmFreeSpaceObjects: %d\n",
+    ALOGD("\tmMaxCapacity: %lld\n\tmFreeSpaceBytes: %lld\n\tmFreeSpaceObjects: %d\n",
             mMaxCapacity, mFreeSpaceBytes, mFreeSpaceObjects);
-    LOGD("\tmStorageDescription: %s\n\tmVolumeIdentifier: %s\n",
+    ALOGD("\tmStorageDescription: %s\n\tmVolumeIdentifier: %s\n",
             mStorageDescription, mVolumeIdentifier);
 }
 
diff --git a/media/tests/players/invoke_mock_media_player.cpp b/media/tests/players/invoke_mock_media_player.cpp
index db1b011..1289dfa 100644
--- a/media/tests/players/invoke_mock_media_player.cpp
+++ b/media/tests/players/invoke_mock_media_player.cpp
@@ -118,13 +118,13 @@
 
 extern "C" android::MediaPlayerBase* newPlayer()
 {
-    LOGD("New invoke test player");
+    ALOGD("New invoke test player");
     return new Player();
 }
 
 extern "C" android::status_t deletePlayer(android::MediaPlayerBase *player)
 {
-    LOGD("Delete invoke test player");
+    ALOGD("Delete invoke test player");
     delete player;
     return OK;
 }
diff --git a/opengl/libagl/Tokenizer.cpp b/opengl/libagl/Tokenizer.cpp
index 9b3ea1a..eac8d6d 100644
--- a/opengl/libagl/Tokenizer.cpp
+++ b/opengl/libagl/Tokenizer.cpp
@@ -163,9 +163,9 @@
 {
     const run_t* ranges = mRanges.array();
     const size_t c = mRanges.size();
-    LOGD("Tokenizer (%p, size = %u)\n", this, c);
+    ALOGD("Tokenizer (%p, size = %u)\n", this, c);
     for (size_t i=0 ; i<c ; i++) {
-        LOGD("%u: (%u, %u)\n", i, ranges[i].first, ranges[i].length);
+        ALOGD("%u: (%u, %u)\n", i, ranges[i].first, ranges[i].length);
     }
 }
 
diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp
index 6d4098c..9ceb5e9 100644
--- a/opengl/libagl/egl.cpp
+++ b/opengl/libagl/egl.cpp
@@ -263,7 +263,7 @@
             return (left>=right || top>=bottom);
         }
         void dump(char const* what) {
-            LOGD("%s { %5d, %5d, w=%5d, h=%5d }", 
+            ALOGD("%s { %5d, %5d, w=%5d, h=%5d }",
                     what, left, top, right-left, bottom-top);
         }
         
diff --git a/opengl/libagl/matrix.cpp b/opengl/libagl/matrix.cpp
index 9520f04..cdeccb3 100644
--- a/opengl/libagl/matrix.cpp
+++ b/opengl/libagl/matrix.cpp
@@ -217,9 +217,9 @@
 void transform_t::dump(const char* what)
 {
     GLfixed const * const m = matrix.m;
-    LOGD("%s:", what);
+    ALOGD("%s:", what);
     for (int i=0 ; i<4 ; i++)
-        LOGD("[%08x %08x %08x %08x] [%f %f %f %f]\n",
+        ALOGD("[%08x %08x %08x %08x] [%f %f %f %f]\n",
             m[I(0,i)], m[I(1,i)], m[I(2,i)], m[I(3,i)],
             fixedToFloat(m[I(0,i)]),
             fixedToFloat(m[I(1,i)]), 
@@ -273,11 +273,11 @@
 }
 
 void matrixf_t::dump(const char* what) {
-    LOGD("%s", what);
-    LOGD("[ %9f %9f %9f %9f ]", m[I(0,0)], m[I(1,0)], m[I(2,0)], m[I(3,0)]);
-    LOGD("[ %9f %9f %9f %9f ]", m[I(0,1)], m[I(1,1)], m[I(2,1)], m[I(3,1)]);
-    LOGD("[ %9f %9f %9f %9f ]", m[I(0,2)], m[I(1,2)], m[I(2,2)], m[I(3,2)]);
-    LOGD("[ %9f %9f %9f %9f ]", m[I(0,3)], m[I(1,3)], m[I(2,3)], m[I(3,3)]);
+    ALOGD("%s", what);
+    ALOGD("[ %9f %9f %9f %9f ]", m[I(0,0)], m[I(1,0)], m[I(2,0)], m[I(3,0)]);
+    ALOGD("[ %9f %9f %9f %9f ]", m[I(0,1)], m[I(1,1)], m[I(2,1)], m[I(3,1)]);
+    ALOGD("[ %9f %9f %9f %9f ]", m[I(0,2)], m[I(1,2)], m[I(2,2)], m[I(3,2)]);
+    ALOGD("[ %9f %9f %9f %9f ]", m[I(0,3)], m[I(1,3)], m[I(2,3)], m[I(3,3)]);
 }
 
 void matrixf_t::loadIdentity() {
diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp
index 8a8898b..561862b 100644
--- a/opengl/libs/EGL/Loader.cpp
+++ b/opengl/libs/EGL/Loader.cpp
@@ -131,7 +131,7 @@
 
     /* Special case for GLES emulation */
     if (checkGlesEmulationStatus() == 0) {
-        LOGD("Emulator without GPU support detected. Fallback to software renderer.");
+        ALOGD("Emulator without GPU support detected. Fallback to software renderer.");
         gConfig.add( entry_t(0, 0, "android") );
         return;
     }
@@ -140,14 +140,14 @@
     FILE* cfg = fopen("/system/lib/egl/egl.cfg", "r");
     if (cfg == NULL) {
         // default config
-        LOGD("egl.cfg not found, using default config");
+        ALOGD("egl.cfg not found, using default config");
         gConfig.add( entry_t(0, 0, "android") );
     } else {
         while (fgets(line, 256, cfg)) {
             int dpy;
             int impl;
             if (sscanf(line, "%u %u %s", &dpy, &impl, tag) == 3) {
-                //LOGD(">>> %u %u %s", dpy, impl, tag);
+                //ALOGD(">>> %u %u %s", dpy, impl, tag);
                 gConfig.add( entry_t(dpy, impl, tag) );
             }
         }
@@ -238,7 +238,7 @@
                 strncpy(scrap, name, index);
                 scrap[index] = 0;
                 f = (__eglMustCastToProperFunctionPointerType)dlsym(dso, scrap);
-                //LOGD_IF(f, "found <%s> instead", scrap);
+                //ALOGD_IF(f, "found <%s> instead", scrap);
             }
         }
         if (f == NULL) {
@@ -247,11 +247,11 @@
             if (index>0 && strcmp(name+index, "OES")) {
                 snprintf(scrap, SIZE, "%sOES", name);
                 f = (__eglMustCastToProperFunctionPointerType)dlsym(dso, scrap);
-                //LOGD_IF(f, "found <%s> instead", scrap);
+                //ALOGD_IF(f, "found <%s> instead", scrap);
             }
         }
         if (f == NULL) {
-            //LOGD("%s", name);
+            //ALOGD("%s", name);
             f = (__eglMustCastToProperFunctionPointerType)gl_unimplemented;
         }
         *curr++ = f;
@@ -282,7 +282,7 @@
         return 0;
     }
 
-    LOGD("loaded %s", driver_absolute_path);
+    ALOGD("loaded %s", driver_absolute_path);
 
     if (mask & EGL) {
         getProcAddress = (getProcAddressType)dlsym(dso, "eglGetProcAddress");
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp
index 14745b3..0102caf 100644
--- a/opengl/libs/EGL/egl.cpp
+++ b/opengl/libs/EGL/egl.cpp
@@ -259,7 +259,7 @@
             cnx->hooks[GLESv2_INDEX] = &gHooks[GLESv2_INDEX][IMPL_HARDWARE];
             cnx->dso = loader.open(EGL_DEFAULT_DISPLAY, 1, cnx);
         } else {
-            LOGD("3D hardware acceleration is disabled");
+            ALOGD("3D hardware acceleration is disabled");
         }
     }
 
diff --git a/opengl/libs/EGL/egl_display.cpp b/opengl/libs/EGL/egl_display.cpp
index 31119f9..ad5bdfc 100644
--- a/opengl/libs/EGL/egl_display.cpp
+++ b/opengl/libs/EGL/egl_display.cpp
@@ -184,7 +184,7 @@
 
         EGLDisplay idpy = disp[i].dpy;
         if (cnx->egl.eglInitialize(idpy, &cnx->major, &cnx->minor)) {
-            //LOGD("initialized %d dpy=%p, ver=%d.%d, cnx=%p",
+            //ALOGD("initialized %d dpy=%p, ver=%d.%d, cnx=%p",
             //        i, idpy, cnx->major, cnx->minor, cnx);
 
             // display is now initialized
diff --git a/opengl/libs/EGL/trace.cpp b/opengl/libs/EGL/trace.cpp
index bd6c348..52907c1 100644
--- a/opengl/libs/EGL/trace.cpp
+++ b/opengl/libs/EGL/trace.cpp
@@ -97,30 +97,30 @@
 
 static void TraceGLShaderSource(GLuint shader, GLsizei count,
     const GLchar** string, const GLint* length) {
-    LOGD("const char* shaderSrc[] = {");
+    ALOGD("const char* shaderSrc[] = {");
     for (GLsizei i = 0; i < count; i++) {
         const char* comma = i < count-1 ? "," : "";
         const GLchar* s = string[i];
         if (length) {
             GLint len = length[i];
-            LOGD("    \"%*s\"%s", len, s, comma);
+            ALOGD("    \"%*s\"%s", len, s, comma);
         } else {
-            LOGD("    \"%s\"%s", s, comma);
+            ALOGD("    \"%s\"%s", s, comma);
         }
     }
-    LOGD("};");
+    ALOGD("};");
     if (length) {
-        LOGD("const GLint* shaderLength[] = {");
+        ALOGD("const GLint* shaderLength[] = {");
         for (GLsizei i = 0; i < count; i++) {
             const char* comma = i < count-1 ? "," : "";
             GLint len = length[i];
-            LOGD("    \"%d\"%s", len, comma);
+            ALOGD("    \"%d\"%s", len, comma);
         }
-        LOGD("};");
-        LOGD("glShaderSource(%u, %u, shaderSrc, shaderLength);",
+        ALOGD("};");
+        ALOGD("glShaderSource(%u, %u, shaderSrc, shaderLength);",
             shader, count);
     } else {
-        LOGD("glShaderSource(%u, %u, shaderSrc, (const GLint*) 0);",
+        ALOGD("glShaderSource(%u, %u, shaderSrc, (const GLint*) 0);",
             shader, count);
     }
 }
@@ -131,7 +131,7 @@
     GLsizei count = chunkCount * chunkSize;
     bool isFloat = type == 'f';
     const char* typeString = isFloat ? "GLfloat" : "GLint";
-    LOGD("const %s value[] = {", typeString);
+    ALOGD("const %s value[] = {", typeString);
     for (GLsizei i = 0; i < count; i++) {
         StringBuilder builder;
         builder.append("    ");
@@ -152,25 +152,25 @@
                 value = (void*) (((GLint*) value) + 1);
             }
         }
-        LOGD("%s", builder.getString());
+        ALOGD("%s", builder.getString());
         if (chunkSize > 1 && i < count-1
                 && (i % chunkSize) == (chunkSize-1)) {
-            LOGD("%s", ""); // Print a blank line.
+            ALOGD("%s", ""); // Print a blank line.
         }
     }
-    LOGD("};");
+    ALOGD("};");
 }
 
 static void TraceUniformv(int elementCount, char type,
         GLuint location, GLsizei count, const void* value) {
     TraceValue(elementCount, type, count, 1, value);
-    LOGD("glUniform%d%c(%u, %u, value);", elementCount, type, location, count);
+    ALOGD("glUniform%d%c(%u, %u, value);", elementCount, type, location, count);
 }
 
 static void TraceUniformMatrix(int matrixSideLength,
         GLuint location, GLsizei count, GLboolean transpose, const void* value) {
     TraceValue(matrixSideLength, 'f', count, matrixSideLength, value);
-    LOGD("glUniformMatrix%dfv(%u, %u, %s, value);", matrixSideLength, location, count,
+    ALOGD("glUniformMatrix%dfv(%u, %u, %s, value);", matrixSideLength, location, count,
             GLbooleanToString(transpose));
 }
 
@@ -310,7 +310,7 @@
         }
     }
     builder.append(");");
-    LOGD("%s", builder.getString());
+    ALOGD("%s", builder.getString());
     va_end(argp);
 }
 
diff --git a/opengl/libs/GLES2/gl2.cpp b/opengl/libs/GLES2/gl2.cpp
index fee4609..df22b96 100644
--- a/opengl/libs/GLES2/gl2.cpp
+++ b/opengl/libs/GLES2/gl2.cpp
@@ -83,7 +83,7 @@
         _c->_api(__VA_ARGS__); \
         GLenum status = GL_NO_ERROR; \
         while ((status = glGetError()) != GL_NO_ERROR) { \
-            LOGD("[" #_api "] 0x%x", status); \
+            ALOGD("[" #_api "] 0x%x", status); \
         }
 
 #else
diff --git a/opengl/libs/GLES2_dbg/src/caller.cpp b/opengl/libs/GLES2_dbg/src/caller.cpp
index 6b72751..70d23d6 100644
--- a/opengl/libs/GLES2_dbg/src/caller.cpp
+++ b/opengl/libs/GLES2_dbg/src/caller.cpp
@@ -103,7 +103,7 @@
 const int * GenerateCall(DbgContext * const dbg, const glesv2debugger::Message & cmd,
                   glesv2debugger::Message & msg, const int * const prevRet)
 {
-    LOGD("GenerateCall function=%u", cmd.function());
+    ALOGD("GenerateCall function=%u", cmd.function());
     const int * ret = prevRet; // only some functions have return value
     nsecs_t c0 = systemTime(timeMode);
     switch (cmd.function()) {    case glesv2debugger::Message_Function_glActiveTexture:
diff --git a/opengl/libs/GLES2_dbg/src/dbgcontext.cpp b/opengl/libs/GLES2_dbg/src/dbgcontext.cpp
index 41061e1..e525d02 100644
--- a/opengl/libs/GLES2_dbg/src/dbgcontext.cpp
+++ b/opengl/libs/GLES2_dbg/src/dbgcontext.cpp
@@ -242,7 +242,7 @@
 void DbgContext::glUseProgram(GLuint program)
 {
     while (GLenum error = hooks->gl.glGetError())
-        LOGD("DbgContext::glUseProgram(%u): before glGetError() = 0x%.4X",
+        ALOGD("DbgContext::glUseProgram(%u): before glGetError() = 0x%.4X",
              program, error);
     this->program = program;
     maxAttrib = 0;
@@ -286,7 +286,7 @@
     }
     delete name;
     while (GLenum error = hooks->gl.glGetError())
-        LOGD("DbgContext::glUseProgram(%u): after glGetError() = 0x%.4X",
+        ALOGD("DbgContext::glUseProgram(%u): after glGetError() = 0x%.4X",
              program, error);
 }
 
diff --git a/opengl/libs/GLES2_dbg/src/header.h b/opengl/libs/GLES2_dbg/src/header.h
index 49f3847..0ab4890 100644
--- a/opengl/libs/GLES2_dbg/src/header.h
+++ b/opengl/libs/GLES2_dbg/src/header.h
@@ -48,9 +48,9 @@
 #endif
 
 #undef assert
-#define assert(expr) if (!(expr)) { LOGD("\n*\n*\n* assert: %s at %s \n*\n*", #expr, __location__); int * x = 0; *x = 5; }
-//#undef LOGD
-//#define LOGD(...)
+#define assert(expr) if (!(expr)) { ALOGD("\n*\n*\n* assert: %s at %s \n*\n*", #expr, __location__); int * x = 0; *x = 5; }
+//#undef ALOGD
+//#define ALOGD(...)
 
 namespace android
 {
diff --git a/opengl/libs/GLES2_dbg/src/server.cpp b/opengl/libs/GLES2_dbg/src/server.cpp
index 0c711bf..3e93697 100644
--- a/opengl/libs/GLES2_dbg/src/server.cpp
+++ b/opengl/libs/GLES2_dbg/src/server.cpp
@@ -34,7 +34,7 @@
 
 static void Die(const char * msg)
 {
-    LOGD("\n*\n*\n* GLESv2_dbg: Die: %s \n*\n*", msg);
+    ALOGD("\n*\n*\n* GLESv2_dbg: Die: %s \n*\n*", msg);
     StopDebugServer();
     exit(1);
 }
@@ -44,11 +44,11 @@
 {
     MAX_FILE_SIZE = maxFileSize;
 
-    LOGD("GLESv2_dbg: StartDebugServer");
+    ALOGD("GLESv2_dbg: StartDebugServer");
     if (serverSock >= 0 || file)
         return;
 
-    LOGD("GLESv2_dbg: StartDebugServer create socket");
+    ALOGD("GLESv2_dbg: StartDebugServer create socket");
     struct sockaddr_in server = {}, client = {};
 
     /* Create the TCP socket */
@@ -75,7 +75,7 @@
         Die("Failed to listen on server socket");
     }
 
-    LOGD("server started on %d \n", server.sin_port);
+    ALOGD("server started on %d \n", server.sin_port);
 
 
     /* Wait for client connection */
@@ -85,13 +85,13 @@
         Die("Failed to accept client connection");
     }
 
-    LOGD("Client connected: %s\n", inet_ntoa(client.sin_addr));
+    ALOGD("Client connected: %s\n", inet_ntoa(client.sin_addr));
 //    fcntl(clientSock, F_SETFL, O_NONBLOCK);
 }
 
 void StopDebugServer()
 {
-    LOGD("GLESv2_dbg: StopDebugServer");
+    ALOGD("GLESv2_dbg: StopDebugServer");
     if (clientSock > 0) {
         close(clientSock);
         clientSock = -1;
@@ -115,7 +115,7 @@
     if (received < 0)
         Die("Failed to receive response length");
     else if (4 != received) {
-        LOGD("received %dB: %.8X", received, len);
+        ALOGD("received %dB: %.8X", received, len);
         Die("Received length mismatch, expected 4");
     }
     static void * buffer = NULL;
@@ -150,7 +150,7 @@
 
     bool received = false;
     if (FD_ISSET(clientSock, &readSet)) {
-        LOGD("TryReceive: avaiable for read");
+        ALOGD("TryReceive: avaiable for read");
         Receive(cmd);
         return true;
     }
@@ -190,14 +190,14 @@
     int sent = -1;
     sent = send(clientSock, &len, sizeof(len), 0);
     if (sent != sizeof(len)) {
-        LOGD("actual sent=%d expected=%d clientSock=%d", sent, sizeof(len), clientSock);
+        ALOGD("actual sent=%d expected=%d clientSock=%d", sent, sizeof(len), clientSock);
         Die("Failed to send message length");
     }
     nsecs_t c0 = systemTime(timeMode);
     sent = send(clientSock, str.data(), str.length(), 0);
     float t = (float)ns2ms(systemTime(timeMode) - c0);
     if (sent != str.length()) {
-        LOGD("actual sent=%d expected=%d clientSock=%d", sent, str.length(), clientSock);
+        ALOGD("actual sent=%d expected=%d clientSock=%d", sent, str.length(), clientSock);
         Die("Failed to send message");
     }
     // TODO: factor Receive & TryReceive out and into MessageLoop, or add control argument.
@@ -210,9 +210,9 @@
     if (!msg.expect_response()) {
         if (TryReceive(cmd)) {
             if (glesv2debugger::Message_Function_SETPROP == cmd.function())
-                LOGD("Send: TryReceived SETPROP");
+                ALOGD("Send: TryReceived SETPROP");
             else
-                LOGD("Send: TryReceived %u", cmd.function());
+                ALOGD("Send: TryReceived %u", cmd.function());
         }
     } else
         Receive(cmd);
@@ -223,19 +223,19 @@
 {
     switch (cmd.prop()) {
     case glesv2debugger::Message_Prop_CaptureDraw:
-        LOGD("SetProp Message_Prop_CaptureDraw %d", cmd.arg0());
+        ALOGD("SetProp Message_Prop_CaptureDraw %d", cmd.arg0());
         dbg->captureDraw = cmd.arg0();
         break;
     case glesv2debugger::Message_Prop_TimeMode:
-        LOGD("SetProp Message_Prop_TimeMode %d", cmd.arg0());
+        ALOGD("SetProp Message_Prop_TimeMode %d", cmd.arg0());
         timeMode = cmd.arg0();
         break;
     case glesv2debugger::Message_Prop_ExpectResponse:
-        LOGD("SetProp Message_Prop_ExpectResponse %d=%d", cmd.arg0(), cmd.arg1());
+        ALOGD("SetProp Message_Prop_ExpectResponse %d=%d", cmd.arg0(), cmd.arg1());
         dbg->expectResponse.Bit((glesv2debugger::Message_Function)cmd.arg0(), cmd.arg1());
         break;
     case glesv2debugger::Message_Prop_CaptureSwap:
-        LOGD("SetProp CaptureSwap %d", cmd.arg0());
+        ALOGD("SetProp CaptureSwap %d", cmd.arg0());
         dbg->captureSwap = cmd.arg0();
         break;
     default:
@@ -269,7 +269,7 @@
         case glesv2debugger::Message_Function_CONTINUE:
             ret = functionCall(&dbg->hooks->gl, msg);
             while (GLenum error = dbg->hooks->gl.glGetError())
-                LOGD("Function=%u glGetError() = 0x%.4X", function, error);
+                ALOGD("Function=%u glGetError() = 0x%.4X", function, error);
             if (!msg.has_time()) // some has output data copy, so time inside call
                 msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
             msg.set_context_id(reinterpret_cast<int>(dbg));
diff --git a/opengl/libs/GLES2_dbg/src/vertex.cpp b/opengl/libs/GLES2_dbg/src/vertex.cpp
index 28a24206..70c3433 100644
--- a/opengl/libs/GLES2_dbg/src/vertex.cpp
+++ b/opengl/libs/GLES2_dbg/src/vertex.cpp
@@ -72,7 +72,7 @@
             if (dbg->captureDraw > 0) {
                 dbg->captureDraw--;
                 dbg->hooks->gl.glGetIntegerv(GL_VIEWPORT, viewport);
-//                LOGD("glDrawArrays CAPTURE: x=%d y=%d width=%d height=%d format=0x%.4X type=0x%.4X",
+//                ALOGD("glDrawArrays CAPTURE: x=%d y=%d width=%d height=%d format=0x%.4X type=0x%.4X",
 //                     viewport[0], viewport[1], viewport[2], viewport[3], readFormat, readType);
                 pixels = dbg->GetReadPixelsBuffer(viewport[2] * viewport[3] *
                                                   dbg->readBytesPerPixel);
diff --git a/opengl/libs/GLES_trace/src/gltrace_transport.cpp b/opengl/libs/GLES_trace/src/gltrace_transport.cpp
index c52ca5f..0900a11 100644
--- a/opengl/libs/GLES_trace/src/gltrace_transport.cpp
+++ b/opengl/libs/GLES_trace/src/gltrace_transport.cpp
@@ -32,7 +32,7 @@
 
 void startServer(int port) {
     if (gServerSocket > 0) {
-        LOGD("startServer: server socket already open!");
+        ALOGD("startServer: server socket already open!");
         return;
     }
 
@@ -62,7 +62,7 @@
         exit(-1);
     }
 
-    LOGD("startServer: server started on %d", port);
+    ALOGD("startServer: server started on %d", port);
 
     /* Wait for client connection */
     if ((gClientSocket = accept(gServerSocket, (struct sockaddr *)&client, &sockaddr_len)) < 0) {
@@ -71,7 +71,7 @@
         exit(-1);
     }
 
-    LOGD("startServer: client connected: %s", inet_ntoa(client.sin_addr));
+    ALOGD("startServer: client connected: %s", inet_ntoa(client.sin_addr));
 }
 
 void stopServer() {
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 2090f1b..275de77 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -1956,7 +1956,7 @@
                         char value[PROPERTY_VALUE_MAX];
                         property_get("ro.audio.silent", value, "0");
                         if (atoi(value)) {
-                            LOGD("Silence is golden");
+                            ALOGD("Silence is golden");
                             setMasterMute(true);
                         }
                     }
@@ -2617,7 +2617,7 @@
                         char value[PROPERTY_VALUE_MAX];
                         property_get("ro.audio.silent", value, "0");
                         if (atoi(value)) {
-                            LOGD("Silence is golden");
+                            ALOGD("Silence is golden");
                             setMasterMute(true);
                         }
                     }
@@ -3011,7 +3011,7 @@
                         char value[PROPERTY_VALUE_MAX];
                         property_get("ro.audio.silent", value, "0");
                         if (atoi(value)) {
-                            LOGD("Silence is golden");
+                            ALOGD("Silence is golden");
                             setMasterMute(true);
                         }
                     }
@@ -3192,7 +3192,7 @@
 {
     ALOGV_IF(sharedBuffer != 0, "sharedBuffer: %p, size: %d", sharedBuffer->pointer(), sharedBuffer->size());
 
-    // LOGD("Creating track with %d buffers @ %d bytes", bufferCount, bufferSize);
+    // ALOGD("Creating track with %d buffers @ %d bytes", bufferCount, bufferSize);
    size_t size = sizeof(audio_track_cblk_t);
    uint8_t channelCount = popcount(channelMask);
    size_t bufferSize = frameCount*channelCount*sizeof(int16_t);
diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp
index 89f7b65..dc1d1a7 100644
--- a/services/audioflinger/AudioMixer.cpp
+++ b/services/audioflinger/AudioMixer.cpp
@@ -521,7 +521,7 @@
     const int32_t vlInc = t->volumeInc[0];
     const int32_t vrInc = t->volumeInc[1];
 
-    //LOGD("[0] %p: inc=%f, v0=%f, v1=%d, final=%f, count=%d",
+    //ALOGD("[0] %p: inc=%f, v0=%f, v1=%d, final=%f, count=%d",
     //        t, vlInc/65536.0f, vl/65536.0f, t->volume[0],
     //       (vl + vlInc*frameCount)/65536.0f, frameCount);
 
@@ -599,7 +599,7 @@
             const int32_t vlInc = t->volumeInc[0];
             const int32_t vrInc = t->volumeInc[1];
             const int32_t vaInc = t->auxInc;
-            // LOGD("[1] %p: inc=%f, v0=%f, v1=%d, final=%f, count=%d",
+            // ALOGD("[1] %p: inc=%f, v0=%f, v1=%d, final=%f, count=%d",
             //        t, vlInc/65536.0f, vl/65536.0f, t->volume[0],
             //        (vl + vlInc*frameCount)/65536.0f, frameCount);
 
@@ -643,7 +643,7 @@
             const int32_t vlInc = t->volumeInc[0];
             const int32_t vrInc = t->volumeInc[1];
 
-            // LOGD("[1] %p: inc=%f, v0=%f, v1=%d, final=%f, count=%d",
+            // ALOGD("[1] %p: inc=%f, v0=%f, v1=%d, final=%f, count=%d",
             //        t, vlInc/65536.0f, vl/65536.0f, t->volume[0],
             //        (vl + vlInc*frameCount)/65536.0f, frameCount);
 
@@ -688,7 +688,7 @@
             const int32_t vrInc = t->volumeInc[1];
             const int32_t vaInc = t->auxInc;
 
-            // LOGD("[2] %p: inc=%f, v0=%f, v1=%d, final=%f, count=%d",
+            // ALOGD("[2] %p: inc=%f, v0=%f, v1=%d, final=%f, count=%d",
             //         t, vlInc/65536.0f, vl/65536.0f, t->volume[0],
             //         (vl + vlInc*frameCount)/65536.0f, frameCount);
 
@@ -729,7 +729,7 @@
             const int32_t vlInc = t->volumeInc[0];
             const int32_t vrInc = t->volumeInc[1];
 
-            // LOGD("[2] %p: inc=%f, v0=%f, v1=%d, final=%f, count=%d",
+            // ALOGD("[2] %p: inc=%f, v0=%f, v1=%d, final=%f, count=%d",
             //         t, vlInc/65536.0f, vl/65536.0f, t->volume[0],
             //         (vl + vlInc*frameCount)/65536.0f, frameCount);
 
diff --git a/services/audioflinger/AudioResampler.cpp b/services/audioflinger/AudioResampler.cpp
index e945ce0..7205045 100644
--- a/services/audioflinger/AudioResampler.cpp
+++ b/services/audioflinger/AudioResampler.cpp
@@ -87,7 +87,7 @@
     char value[PROPERTY_VALUE_MAX];
     if (property_get("af.resampler.quality", value, 0)) {
         quality = atoi(value);
-        LOGD("forcing AudioResampler quality to %d", quality);
+        ALOGD("forcing AudioResampler quality to %d", quality);
     }
 
     if (quality == DEFAULT)
diff --git a/services/camera/libcameraservice/CameraHardwareStub.cpp b/services/camera/libcameraservice/CameraHardwareStub.cpp
index 8558fdd..f922630 100644
--- a/services/camera/libcameraservice/CameraHardwareStub.cpp
+++ b/services/camera/libcameraservice/CameraHardwareStub.cpp
@@ -70,7 +70,7 @@
 
     int preview_width, preview_height;
     mParameters.getPreviewSize(&preview_width, &preview_height);
-    LOGD("initHeapLocked: preview size=%dx%d", preview_width, preview_height);
+    ALOGD("initHeapLocked: preview size=%dx%d", preview_width, preview_height);
 
     // Note that we enforce yuv420sp in setParameters().
     int how_big = preview_width * preview_height * 3 / 2;
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 4760f07..d0cafb2 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -47,8 +47,8 @@
 // Use "adb shell dumpsys media.camera -v 1" to change it.
 static volatile int32_t gLogLevel = 0;
 
-#define LOG1(...) LOGD_IF(gLogLevel >= 1, __VA_ARGS__);
-#define LOG2(...) LOGD_IF(gLogLevel >= 2, __VA_ARGS__);
+#define LOG1(...) ALOGD_IF(gLogLevel >= 1, __VA_ARGS__);
+#define LOG2(...) ALOGD_IF(gLogLevel >= 2, __VA_ARGS__);
 
 static void setLogLevel(int level) {
     android_atomic_write(level, &gLogLevel);
diff --git a/services/camera/tests/CameraServiceTest/CameraServiceTest.cpp b/services/camera/tests/CameraServiceTest/CameraServiceTest.cpp
index e390ae20..69f60ca 100644
--- a/services/camera/tests/CameraServiceTest/CameraServiceTest.cpp
+++ b/services/camera/tests/CameraServiceTest/CameraServiceTest.cpp
@@ -46,7 +46,7 @@
     do { \
         printf(__VA_ARGS__); \
         printf("\n"); \
-        LOGD(__VA_ARGS__); \
+        ALOGD(__VA_ARGS__); \
     } while(0)
 
 void assert_fail(const char *file, int line, const char *func, const char *expr) {
@@ -797,7 +797,7 @@
         int w, h;
         const char *s = param.get(CameraParameters::KEY_SUPPORTED_PICTURE_SIZES);
         while (getNextSize(&s, &w, &h)) {
-            LOGD("checking picture size %dx%d", w, h);
+            ALOGD("checking picture size %dx%d", w, h);
             checkOnePicture(w, h);
         }
     }
@@ -811,7 +811,7 @@
 
         // Try all flag combinations.
         for (int v = 0; v < 8; v++) {
-            LOGD("TestPreviewCallbackFlag: flag=%d", v);
+            ALOGD("TestPreviewCallbackFlag: flag=%d", v);
             usleep(100000); // sleep a while to clear the in-flight callbacks.
             cc->clearStat();
             c->setPreviewCallbackFlag(v);
@@ -875,7 +875,7 @@
         int w, h;
         const char *s = param.get(CameraParameters::KEY_SUPPORTED_PREVIEW_SIZES);
         while (getNextSize(&s, &w, &h)) {
-            LOGD("checking preview size %dx%d", w, h);
+            ALOGD("checking preview size %dx%d", w, h);
             checkOnePicture(w, h);
         }
     }
diff --git a/services/input/EventHub.cpp b/services/input/EventHub.cpp
index 838a03f..f179208 100644
--- a/services/input/EventHub.cpp
+++ b/services/input/EventHub.cpp
@@ -1097,7 +1097,7 @@
     device->configurationFile = getInputDeviceConfigurationFilePathByDeviceIdentifier(
             device->identifier, INPUT_DEVICE_CONFIGURATION_FILE_TYPE_CONFIGURATION);
     if (device->configurationFile.isEmpty()) {
-        LOGD("No input device configuration file found for device '%s'.",
+        ALOGD("No input device configuration file found for device '%s'.",
                 device->identifier.name.string());
     } else {
         status_t status = PropertyMap::load(device->configurationFile,
diff --git a/services/input/InputDispatcher.cpp b/services/input/InputDispatcher.cpp
index 5f31f05..4ade595 100644
--- a/services/input/InputDispatcher.cpp
+++ b/services/input/InputDispatcher.cpp
@@ -216,7 +216,7 @@
 
 #if DEBUG_THROTTLING
     mThrottleState.originalSampleCount = 0;
-    LOGD("Throttling - Max events per second = %d", mConfig.maxEventsPerSecond);
+    ALOGD("Throttling - Max events per second = %d", mConfig.maxEventsPerSecond);
 #endif
 }
 
@@ -264,7 +264,7 @@
     // If dispatching is frozen, do not process timeouts or try to deliver any new events.
     if (mDispatchFrozen) {
 #if DEBUG_FOCUS
-        LOGD("Dispatch frozen.  Waiting some more.");
+        ALOGD("Dispatch frozen.  Waiting some more.");
 #endif
         return;
     }
@@ -334,7 +334,7 @@
                     if (currentTime < nextTime) {
                         // Throttle it!
 #if DEBUG_THROTTLING
-                        LOGD("Throttling - Delaying motion event for "
+                        ALOGD("Throttling - Delaying motion event for "
                                 "device %d, source 0x%08x by up to %0.3fms.",
                                 deviceId, source, (nextTime - currentTime) * 0.000001);
 #endif
@@ -352,7 +352,7 @@
 #if DEBUG_THROTTLING
                 if (mThrottleState.originalSampleCount != 0) {
                     uint32_t count = motionEntry->countSamples();
-                    LOGD("Throttling - Motion event sample count grew by %d from %d to %d.",
+                    ALOGD("Throttling - Motion event sample count grew by %d from %d to %d.",
                             count - mThrottleState.originalSampleCount,
                             mThrottleState.originalSampleCount, count);
                     mThrottleState.originalSampleCount = 0;
@@ -461,7 +461,7 @@
 
 void InputDispatcher::dispatchIdleLocked() {
 #if DEBUG_FOCUS
-    LOGD("Dispatcher idle.  There are no pending events or active connections.");
+    ALOGD("Dispatcher idle.  There are no pending events or active connections.");
 #endif
 
     // Reset targets when idle, to release input channels and other resources
@@ -485,7 +485,7 @@
             } else if (keyEntry->action == AKEY_EVENT_ACTION_UP) {
                 if (mAppSwitchSawKeyDown) {
 #if DEBUG_APP_SWITCH
-                    LOGD("App switch is pending!");
+                    ALOGD("App switch is pending!");
 #endif
                     mAppSwitchDueTime = keyEntry->eventTime + APP_SWITCH_TIMEOUT;
                     mAppSwitchSawKeyDown = false;
@@ -559,7 +559,7 @@
     switch (dropReason) {
     case DROP_REASON_POLICY:
 #if DEBUG_INBOUND_EVENT_DETAILS
-        LOGD("Dropped event because policy consumed it.");
+        ALOGD("Dropped event because policy consumed it.");
 #endif
         reason = "inbound event was dropped because the policy consumed it";
         break;
@@ -626,9 +626,9 @@
 
 #if DEBUG_APP_SWITCH
     if (handled) {
-        LOGD("App switch has arrived.");
+        ALOGD("App switch has arrived.");
     } else {
-        LOGD("App switch was abandoned.");
+        ALOGD("App switch was abandoned.");
     }
 #endif
 }
@@ -678,7 +678,7 @@
     InjectionState* injectionState = entry->injectionState;
     if (injectionState && injectionState->injectionResult == INPUT_EVENT_INJECTION_PENDING) {
 #if DEBUG_DISPATCH_CYCLE
-        LOGD("Injected inbound event was dropped.");
+        ALOGD("Injected inbound event was dropped.");
 #endif
         setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_FAILED);
     }
@@ -730,7 +730,7 @@
 bool InputDispatcher::dispatchConfigurationChangedLocked(
         nsecs_t currentTime, ConfigurationChangedEntry* entry) {
 #if DEBUG_OUTBOUND_EVENT_DETAILS
-    LOGD("dispatchConfigurationChanged - eventTime=%lld", entry->eventTime);
+    ALOGD("dispatchConfigurationChanged - eventTime=%lld", entry->eventTime);
 #endif
 
     // Reset key repeating in case a keyboard device was added or removed or something.
@@ -746,7 +746,7 @@
 bool InputDispatcher::dispatchDeviceResetLocked(
         nsecs_t currentTime, DeviceResetEntry* entry) {
 #if DEBUG_OUTBOUND_EVENT_DETAILS
-    LOGD("dispatchDeviceReset - eventTime=%lld, deviceId=%d", entry->eventTime, entry->deviceId);
+    ALOGD("dispatchDeviceReset - eventTime=%lld, deviceId=%d", entry->eventTime, entry->deviceId);
 #endif
 
     CancelationOptions options(CancelationOptions::CANCEL_ALL_EVENTS,
@@ -860,7 +860,7 @@
 
 void InputDispatcher::logOutboundKeyDetailsLocked(const char* prefix, const KeyEntry* entry) {
 #if DEBUG_OUTBOUND_EVENT_DETAILS
-    LOGD("%seventTime=%lld, deviceId=%d, source=0x%x, policyFlags=0x%x, "
+    ALOGD("%seventTime=%lld, deviceId=%d, source=0x%x, policyFlags=0x%x, "
             "action=0x%x, flags=0x%x, keyCode=0x%x, scanCode=0x%x, metaState=0x%x, "
             "repeatCount=%d, downTime=%lld",
             prefix,
@@ -944,7 +944,7 @@
             }
 
 #if DEBUG_BATCHING
-            LOGD("Split batch of %d samples into two parts, first part has %d samples, "
+            ALOGD("Split batch of %d samples into two parts, first part has %d samples, "
                     "second part has %d samples.", originalSampleCount,
                     entry->countSamples(), nextEntry->countSamples());
 #endif
@@ -966,7 +966,7 @@
 
 void InputDispatcher::logOutboundMotionDetailsLocked(const char* prefix, const MotionEntry* entry) {
 #if DEBUG_OUTBOUND_EVENT_DETAILS
-    LOGD("%seventTime=%lld, deviceId=%d, source=0x%x, policyFlags=0x%x, "
+    ALOGD("%seventTime=%lld, deviceId=%d, source=0x%x, policyFlags=0x%x, "
             "action=0x%x, flags=0x%x, "
             "metaState=0x%x, buttonState=0x%x, "
             "edgeFlags=0x%x, xPrecision=%f, yPrecision=%f, downTime=%lld",
@@ -984,7 +984,7 @@
         sampleCount += 1;
     }
     for (uint32_t i = 0; i < entry->pointerCount; i++) {
-        LOGD("  Pointer %d: id=%d, toolType=%d, "
+        ALOGD("  Pointer %d: id=%d, toolType=%d, "
                 "x=%f, y=%f, pressure=%f, size=%f, "
                 "touchMajor=%f, touchMinor=%f, toolMajor=%f, toolMinor=%f, "
                 "orientation=%f",
@@ -1004,7 +1004,7 @@
     // Keep in mind that due to batching, it is possible for the number of samples actually
     // dispatched to change before the application finally consumed them.
     if (entry->action == AMOTION_EVENT_ACTION_MOVE) {
-        LOGD("  ... Total movement samples currently batched %d ...", sampleCount);
+        ALOGD("  ... Total movement samples currently batched %d ...", sampleCount);
     }
 #endif
 }
@@ -1012,7 +1012,7 @@
 void InputDispatcher::dispatchEventToCurrentInputTargetsLocked(nsecs_t currentTime,
         EventEntry* eventEntry, bool resumeWithAppendedMotionSample) {
 #if DEBUG_DISPATCH_CYCLE
-    LOGD("dispatchEventToCurrentInputTargets - "
+    ALOGD("dispatchEventToCurrentInputTargets - "
             "resumeWithAppendedMotionSample=%s",
             toString(resumeWithAppendedMotionSample));
 #endif
@@ -1031,7 +1031,7 @@
                     resumeWithAppendedMotionSample);
         } else {
 #if DEBUG_FOCUS
-            LOGD("Dropping event delivery to target with channel '%s' because it "
+            ALOGD("Dropping event delivery to target with channel '%s' because it "
                     "is no longer registered with the input dispatcher.",
                     inputTarget.inputChannel->getName().string());
 #endif
@@ -1057,7 +1057,7 @@
     if (applicationHandle == NULL && windowHandle == NULL) {
         if (mInputTargetWaitCause != INPUT_TARGET_WAIT_CAUSE_SYSTEM_NOT_READY) {
 #if DEBUG_FOCUS
-            LOGD("Waiting for system to become ready for input.");
+            ALOGD("Waiting for system to become ready for input.");
 #endif
             mInputTargetWaitCause = INPUT_TARGET_WAIT_CAUSE_SYSTEM_NOT_READY;
             mInputTargetWaitStartTime = currentTime;
@@ -1068,7 +1068,7 @@
     } else {
         if (mInputTargetWaitCause != INPUT_TARGET_WAIT_CAUSE_APPLICATION_NOT_READY) {
 #if DEBUG_FOCUS
-            LOGD("Waiting for application to become ready for input: %s",
+            ALOGD("Waiting for application to become ready for input: %s",
                     getApplicationWindowLabelLocked(applicationHandle, windowHandle).string());
 #endif
             nsecs_t timeout;
@@ -1154,7 +1154,7 @@
 
 void InputDispatcher::resetANRTimeoutsLocked() {
 #if DEBUG_FOCUS
-        LOGD("Resetting ANR timeouts.");
+        ALOGD("Resetting ANR timeouts.");
 #endif
 
     // Reset input target wait timeout.
@@ -1173,7 +1173,7 @@
     if (mFocusedWindowHandle == NULL) {
         if (mFocusedApplicationHandle != NULL) {
 #if DEBUG_FOCUS
-            LOGD("Waiting because there is no focused window but there is a "
+            ALOGD("Waiting because there is no focused window but there is a "
                     "focused application that may eventually add a window: %s.",
                     getApplicationWindowLabelLocked(mFocusedApplicationHandle, NULL).string());
 #endif
@@ -1196,7 +1196,7 @@
     // If the currently focused window is paused then keep waiting.
     if (mFocusedWindowHandle->getInfo()->paused) {
 #if DEBUG_FOCUS
-        LOGD("Waiting because focused window is paused.");
+        ALOGD("Waiting because focused window is paused.");
 #endif
         injectionResult = handleTargetsNotReadyLocked(currentTime, entry,
                 mFocusedApplicationHandle, mFocusedWindowHandle, nextWakeupTime);
@@ -1206,7 +1206,7 @@
     // If the currently focused window is still working on previous events then keep waiting.
     if (! isWindowFinishedWithPreviousInputLocked(mFocusedWindowHandle)) {
 #if DEBUG_FOCUS
-        LOGD("Waiting because focused window still processing previous input.");
+        ALOGD("Waiting because focused window still processing previous input.");
 #endif
         injectionResult = handleTargetsNotReadyLocked(currentTime, entry,
                 mFocusedApplicationHandle, mFocusedWindowHandle, nextWakeupTime);
@@ -1225,7 +1225,7 @@
     updateDispatchStatisticsLocked(currentTime, entry,
             injectionResult, timeSpentWaitingForApplication);
 #if DEBUG_FOCUS
-    LOGD("findFocusedWindow finished: injectionResult=%d, "
+    ALOGD("findFocusedWindow finished: injectionResult=%d, "
             "timeSpendWaitingForApplication=%0.1fms",
             injectionResult, timeSpentWaitingForApplication / 1000000.0);
 #endif
@@ -1294,7 +1294,7 @@
         bool down = maskedAction == AMOTION_EVENT_ACTION_DOWN;
         if (switchedDevice && mTouchState.down && !down) {
 #if DEBUG_FOCUS
-            LOGD("Dropping event because a pointer for a different device is already down.");
+            ALOGD("Dropping event because a pointer for a different device is already down.");
 #endif
             mTempTouchState.copyFrom(mTouchState);
             injectionResult = INPUT_EVENT_INJECTION_FAILED;
@@ -1368,7 +1368,7 @@
         // fact be in ANR state.
         if (topErrorWindowHandle != NULL && newTouchedWindowHandle != topErrorWindowHandle) {
 #if DEBUG_FOCUS
-            LOGD("Waiting because system error window is pending.");
+            ALOGD("Waiting because system error window is pending.");
 #endif
             injectionResult = handleTargetsNotReadyLocked(currentTime, entry,
                     NULL, NULL, nextWakeupTime);
@@ -1392,7 +1392,7 @@
         if (newTouchedWindowHandle == NULL) {
             if (mFocusedApplicationHandle != NULL) {
 #if DEBUG_FOCUS
-                LOGD("Waiting because there is no touched window but there is a "
+                ALOGD("Waiting because there is no touched window but there is a "
                         "focused application that may eventually add a new window: %s.",
                         getApplicationWindowLabelLocked(mFocusedApplicationHandle, NULL).string());
 #endif
@@ -1450,7 +1450,7 @@
         // If the pointer is not currently down, then ignore the event.
         if (! mTempTouchState.down) {
 #if DEBUG_FOCUS
-            LOGD("Dropping event because the pointer is not down or we previously "
+            ALOGD("Dropping event because the pointer is not down or we previously "
                     "dropped the pointer down event.");
 #endif
             injectionResult = INPUT_EVENT_INJECTION_FAILED;
@@ -1471,7 +1471,7 @@
             if (oldTouchedWindowHandle != newTouchedWindowHandle
                     && newTouchedWindowHandle != NULL) {
 #if DEBUG_FOCUS
-                LOGD("Touch is slipping out of window %s into window %s.",
+                ALOGD("Touch is slipping out of window %s into window %s.",
                         oldTouchedWindowHandle->getName().string(),
                         newTouchedWindowHandle->getName().string());
 #endif
@@ -1512,7 +1512,7 @@
         // Let the previous window know that the hover sequence is over.
         if (mLastHoverWindowHandle != NULL) {
 #if DEBUG_HOVER
-            LOGD("Sending hover exit event to window %s.",
+            ALOGD("Sending hover exit event to window %s.",
                     mLastHoverWindowHandle->getName().string());
 #endif
             mTempTouchState.addOrUpdateWindow(mLastHoverWindowHandle,
@@ -1522,7 +1522,7 @@
         // Let the new window know that the hover sequence is starting.
         if (newHoverWindowHandle != NULL) {
 #if DEBUG_HOVER
-            LOGD("Sending hover enter event to window %s.",
+            ALOGD("Sending hover enter event to window %s.",
                     newHoverWindowHandle->getName().string());
 #endif
             mTempTouchState.addOrUpdateWindow(newHoverWindowHandle,
@@ -1548,7 +1548,7 @@
         }
         if (! haveForegroundWindow) {
 #if DEBUG_FOCUS
-            LOGD("Dropping event because there is no touched foreground window to receive it.");
+            ALOGD("Dropping event because there is no touched foreground window to receive it.");
 #endif
             injectionResult = INPUT_EVENT_INJECTION_FAILED;
             goto Failed;
@@ -1583,7 +1583,7 @@
             // If the touched window is paused then keep waiting.
             if (touchedWindow.windowHandle->getInfo()->paused) {
 #if DEBUG_FOCUS
-                LOGD("Waiting because touched window is paused.");
+                ALOGD("Waiting because touched window is paused.");
 #endif
                 injectionResult = handleTargetsNotReadyLocked(currentTime, entry,
                         NULL, touchedWindow.windowHandle, nextWakeupTime);
@@ -1593,7 +1593,7 @@
             // If the touched window is still working on previous events then keep waiting.
             if (! isWindowFinishedWithPreviousInputLocked(touchedWindow.windowHandle)) {
 #if DEBUG_FOCUS
-                LOGD("Waiting because touched window still processing previous input.");
+                ALOGD("Waiting because touched window still processing previous input.");
 #endif
                 injectionResult = handleTargetsNotReadyLocked(currentTime, entry,
                         NULL, touchedWindow.windowHandle, nextWakeupTime);
@@ -1653,7 +1653,7 @@
         if (!wrongDevice) {
             if (switchedDevice) {
 #if DEBUG_FOCUS
-                LOGD("Conflicting pointer actions: Switched to a different device.");
+                ALOGD("Conflicting pointer actions: Switched to a different device.");
 #endif
                 *outConflictingPointerActions = true;
             }
@@ -1662,7 +1662,7 @@
                 // Started hovering, therefore no longer down.
                 if (mTouchState.down) {
 #if DEBUG_FOCUS
-                    LOGD("Conflicting pointer actions: Hover received while pointer was down.");
+                    ALOGD("Conflicting pointer actions: Hover received while pointer was down.");
 #endif
                     *outConflictingPointerActions = true;
                 }
@@ -1680,7 +1680,7 @@
                 // First pointer went down.
                 if (mTouchState.down) {
 #if DEBUG_FOCUS
-                    LOGD("Conflicting pointer actions: Down received while already down.");
+                    ALOGD("Conflicting pointer actions: Down received while already down.");
 #endif
                     *outConflictingPointerActions = true;
                 }
@@ -1716,7 +1716,7 @@
         }
     } else {
 #if DEBUG_FOCUS
-        LOGD("Not updating touch focus because injection was denied.");
+        ALOGD("Not updating touch focus because injection was denied.");
 #endif
     }
 
@@ -1728,7 +1728,7 @@
     updateDispatchStatisticsLocked(currentTime, entry,
             injectionResult, timeSpentWaitingForApplication);
 #if DEBUG_FOCUS
-    LOGD("findTouchedWindow finished: injectionResult=%d, injectionPermission=%d, "
+    ALOGD("findTouchedWindow finished: injectionResult=%d, injectionPermission=%d, "
             "timeSpentWaitingForApplication=%0.1fms",
             injectionResult, injectionPermission, timeSpentWaitingForApplication / 1000000.0);
 #endif
@@ -1866,7 +1866,7 @@
         const sp<Connection>& connection, EventEntry* eventEntry, const InputTarget* inputTarget,
         bool resumeWithAppendedMotionSample) {
 #if DEBUG_DISPATCH_CYCLE
-    LOGD("channel '%s' ~ prepareDispatchCycle - flags=0x%08x, "
+    ALOGD("channel '%s' ~ prepareDispatchCycle - flags=0x%08x, "
             "xOffset=%f, yOffset=%f, scaleFactor=%f, "
             "pointerIds=0x%x, "
             "resumeWithAppendedMotionSample=%s",
@@ -1884,7 +1884,7 @@
     // We don't want to enqueue additional outbound events if the connection is broken.
     if (connection->status != Connection::STATUS_NORMAL) {
 #if DEBUG_DISPATCH_CYCLE
-        LOGD("channel '%s' ~ Dropping event because the channel status is %s",
+        ALOGD("channel '%s' ~ Dropping event because the channel status is %s",
                 connection->getInputChannelName(), connection->getStatusLabel());
 #endif
         return;
@@ -1902,7 +1902,7 @@
                 return; // split event was dropped
             }
 #if DEBUG_FOCUS
-            LOGD("channel '%s' ~ Split motion event.",
+            ALOGD("channel '%s' ~ Split motion event.",
                     connection->getInputChannelName());
             logOutboundMotionDetailsLocked("  ", splitMotionEntry);
 #endif
@@ -1925,7 +1925,7 @@
             // be dispatched later.
             if (! motionEventDispatchEntry->inProgress) {
 #if DEBUG_BATCHING
-                LOGD("channel '%s' ~ Not streaming because the motion event has "
+                ALOGD("channel '%s' ~ Not streaming because the motion event has "
                         "not yet been dispatched.  "
                         "(Waiting for earlier events to be consumed.)",
                         connection->getInputChannelName());
@@ -1940,7 +1940,7 @@
             // appended motion sample.
             if (motionEventDispatchEntry->tailMotionSample) {
 #if DEBUG_BATCHING
-                LOGD("channel '%s' ~ Not streaming because no new samples can "
+                ALOGD("channel '%s' ~ Not streaming because no new samples can "
                         "be appended to the motion event in this dispatch cycle.  "
                         "(Waiting for next dispatch cycle to start.)",
                         connection->getInputChannelName());
@@ -1952,7 +1952,7 @@
             if ((motionEventDispatchEntry->targetFlags & InputTarget::FLAG_DISPATCH_MASK)
                     != InputTarget::FLAG_DISPATCH_AS_IS) {
 #if DEBUG_BATCHING
-                LOGD("channel '%s' ~ Not streaming because the motion event was not "
+                ALOGD("channel '%s' ~ Not streaming because the motion event was not "
                         "being dispatched as-is.  "
                         "(Waiting for next dispatch cycle to start.)",
                         connection->getInputChannelName());
@@ -1980,7 +1980,7 @@
             }
             if (status == OK) {
 #if DEBUG_BATCHING
-                LOGD("channel '%s' ~ Successfully streamed new motion sample.",
+                ALOGD("channel '%s' ~ Successfully streamed new motion sample.",
                         connection->getInputChannelName());
 #endif
                 return;
@@ -1988,17 +1988,17 @@
 
 #if DEBUG_BATCHING
             if (status == NO_MEMORY) {
-                LOGD("channel '%s' ~ Could not append motion sample to currently "
+                ALOGD("channel '%s' ~ Could not append motion sample to currently "
                         "dispatched move event because the shared memory buffer is full.  "
                         "(Waiting for next dispatch cycle to start.)",
                         connection->getInputChannelName());
             } else if (status == status_t(FAILED_TRANSACTION)) {
-                LOGD("channel '%s' ~ Could not append motion sample to currently "
+                ALOGD("channel '%s' ~ Could not append motion sample to currently "
                         "dispatched move event because the event has already been consumed.  "
                         "(Waiting for next dispatch cycle to start.)",
                         connection->getInputChannelName());
             } else {
-                LOGD("channel '%s' ~ Could not append motion sample to currently "
+                ALOGD("channel '%s' ~ Could not append motion sample to currently "
                         "dispatched move event due to an error, status=%d.  "
                         "(Waiting for next dispatch cycle to start.)",
                         connection->getInputChannelName(), status);
@@ -2056,7 +2056,7 @@
     // to the list starting with the newly appended motion sample.
     if (resumeWithAppendedMotionSample) {
 #if DEBUG_BATCHING
-        LOGD("channel '%s' ~ Preparing a new dispatch cycle for additional motion samples "
+        ALOGD("channel '%s' ~ Preparing a new dispatch cycle for additional motion samples "
                 "that cannot be streamed because the motion event has already been consumed.",
                 connection->getInputChannelName());
 #endif
@@ -2074,7 +2074,7 @@
         if (!connection->inputState.trackKey(keyEntry,
                 dispatchEntry->resolvedAction, dispatchEntry->resolvedFlags)) {
 #if DEBUG_DISPATCH_CYCLE
-            LOGD("channel '%s' ~ enqueueDispatchEntryLocked: skipping inconsistent key event",
+            ALOGD("channel '%s' ~ enqueueDispatchEntryLocked: skipping inconsistent key event",
                     connection->getInputChannelName());
 #endif
             return; // skip the inconsistent event
@@ -2101,7 +2101,7 @@
                 && !connection->inputState.isHovering(
                         motionEntry->deviceId, motionEntry->source)) {
 #if DEBUG_DISPATCH_CYCLE
-        LOGD("channel '%s' ~ enqueueDispatchEntryLocked: filling in missing hover enter event",
+        ALOGD("channel '%s' ~ enqueueDispatchEntryLocked: filling in missing hover enter event",
                 connection->getInputChannelName());
 #endif
             dispatchEntry->resolvedAction = AMOTION_EVENT_ACTION_HOVER_ENTER;
@@ -2115,7 +2115,7 @@
         if (!connection->inputState.trackMotion(motionEntry,
                 dispatchEntry->resolvedAction, dispatchEntry->resolvedFlags)) {
 #if DEBUG_DISPATCH_CYCLE
-            LOGD("channel '%s' ~ enqueueDispatchEntryLocked: skipping inconsistent motion event",
+            ALOGD("channel '%s' ~ enqueueDispatchEntryLocked: skipping inconsistent motion event",
                     connection->getInputChannelName());
 #endif
             return; // skip the inconsistent event
@@ -2131,7 +2131,7 @@
 void InputDispatcher::startDispatchCycleLocked(nsecs_t currentTime,
         const sp<Connection>& connection) {
 #if DEBUG_DISPATCH_CYCLE
-    LOGD("channel '%s' ~ startDispatchCycle",
+    ALOGD("channel '%s' ~ startDispatchCycle",
             connection->getInputChannelName());
 #endif
 
@@ -2248,7 +2248,7 @@
                         nextMotionSample->eventTime, usingCoords);
                 if (status == NO_MEMORY) {
 #if DEBUG_DISPATCH_CYCLE
-                    LOGD("channel '%s' ~ Shared memory buffer full.  Some motion samples will "
+                    ALOGD("channel '%s' ~ Shared memory buffer full.  Some motion samples will "
                             "be sent in the next dispatch cycle.",
                             connection->getInputChannelName());
 #endif
@@ -2295,7 +2295,7 @@
 void InputDispatcher::finishDispatchCycleLocked(nsecs_t currentTime,
         const sp<Connection>& connection, bool handled) {
 #if DEBUG_DISPATCH_CYCLE
-    LOGD("channel '%s' ~ finishDispatchCycle - %01.1fms since event, "
+    ALOGD("channel '%s' ~ finishDispatchCycle - %01.1fms since event, "
             "%01.1fms since dispatch, handled=%s",
             connection->getInputChannelName(),
             connection->getEventLatencyMillis(currentTime),
@@ -2361,7 +2361,7 @@
 void InputDispatcher::abortBrokenDispatchCycleLocked(nsecs_t currentTime,
         const sp<Connection>& connection, bool notify) {
 #if DEBUG_DISPATCH_CYCLE
-    LOGD("channel '%s' ~ abortBrokenDispatchCycle - notify=%s",
+    ALOGD("channel '%s' ~ abortBrokenDispatchCycle - notify=%s",
             connection->getInputChannelName(), toString(notify));
 #endif
 
@@ -2471,7 +2471,7 @@
     if (! mTempCancelationEvents.isEmpty()
             && connection->status != Connection::STATUS_BROKEN) {
 #if DEBUG_OUTBOUND_EVENT_DETAILS
-        LOGD("channel '%s' ~ Synthesized %d cancelation events to bring channel back in sync "
+        ALOGD("channel '%s' ~ Synthesized %d cancelation events to bring channel back in sync "
                 "with reality: %s, mode=%d.",
                 connection->getInputChannelName(), mTempCancelationEvents.size(),
                 options.reason, options.mode);
@@ -2619,7 +2619,7 @@
 
 void InputDispatcher::notifyConfigurationChanged(const NotifyConfigurationChangedArgs* args) {
 #if DEBUG_INBOUND_EVENT_DETAILS
-    LOGD("notifyConfigurationChanged - eventTime=%lld", args->eventTime);
+    ALOGD("notifyConfigurationChanged - eventTime=%lld", args->eventTime);
 #endif
 
     bool needWake;
@@ -2637,7 +2637,7 @@
 
 void InputDispatcher::notifyKey(const NotifyKeyArgs* args) {
 #if DEBUG_INBOUND_EVENT_DETAILS
-    LOGD("notifyKey - eventTime=%lld, deviceId=%d, source=0x%x, policyFlags=0x%x, action=0x%x, "
+    ALOGD("notifyKey - eventTime=%lld, deviceId=%d, source=0x%x, policyFlags=0x%x, action=0x%x, "
             "flags=0x%x, keyCode=0x%x, scanCode=0x%x, metaState=0x%x, downTime=%lld",
             args->eventTime, args->deviceId, args->source, args->policyFlags,
             args->action, args->flags, args->keyCode, args->scanCode,
@@ -2715,14 +2715,14 @@
 
 void InputDispatcher::notifyMotion(const NotifyMotionArgs* args) {
 #if DEBUG_INBOUND_EVENT_DETAILS
-    LOGD("notifyMotion - eventTime=%lld, deviceId=%d, source=0x%x, policyFlags=0x%x, "
+    ALOGD("notifyMotion - eventTime=%lld, deviceId=%d, source=0x%x, policyFlags=0x%x, "
             "action=0x%x, flags=0x%x, metaState=0x%x, buttonState=0x%x, edgeFlags=0x%x, "
             "xPrecision=%f, yPrecision=%f, downTime=%lld",
             args->eventTime, args->deviceId, args->source, args->policyFlags,
             args->action, args->flags, args->metaState, args->buttonState,
             args->edgeFlags, args->xPrecision, args->yPrecision, args->downTime);
     for (uint32_t i = 0; i < args->pointerCount; i++) {
-        LOGD("  Pointer %d: id=%d, toolType=%d, "
+        ALOGD("  Pointer %d: id=%d, toolType=%d, "
                 "x=%f, y=%f, pressure=%f, size=%f, "
                 "touchMajor=%f, touchMinor=%f, toolMajor=%f, toolMinor=%f, "
                 "orientation=%f",
@@ -2884,7 +2884,7 @@
                     if (args->action == AMOTION_EVENT_ACTION_HOVER_MOVE) {
                         if (mLastHoverWindowHandle == NULL) {
 #if DEBUG_BATCHING
-                            LOGD("Not streaming hover move because there is no "
+                            ALOGD("Not streaming hover move because there is no "
                                     "last hovered window.");
 #endif
                             goto NoBatchingOrStreaming;
@@ -2895,7 +2895,7 @@
                                 args->pointerCoords[0].getAxisValue(AMOTION_EVENT_AXIS_Y));
                         if (mLastHoverWindowHandle != hoverWindowHandle) {
 #if DEBUG_BATCHING
-                            LOGD("Not streaming hover move because the last hovered window "
+                            ALOGD("Not streaming hover move because the last hovered window "
                                     "is '%s' but the currently hovered window is '%s'.",
                                     mLastHoverWindowHandle->getName().string(),
                                     hoverWindowHandle != NULL
@@ -2909,7 +2909,7 @@
                     // that we can stream onto.  Append the motion sample and resume dispatch.
                     motionEntry->appendSample(args->eventTime, args->pointerCoords);
 #if DEBUG_BATCHING
-                    LOGD("Appended motion sample onto batch for most recently dispatched "
+                    ALOGD("Appended motion sample onto batch for most recently dispatched "
                             "motion event for this device and source in the outbound queues.  "
                             "Attempting to stream the motion sample.");
 #endif
@@ -2958,7 +2958,7 @@
         }
         lastSample->eventTime = eventTime;
 #if DEBUG_BATCHING
-        LOGD("Coalesced motion into last sample of batch for %s, events were %0.3f ms apart",
+        ALOGD("Coalesced motion into last sample of batch for %s, events were %0.3f ms apart",
                 eventDescription, interval * 0.000001f);
 #endif
         return;
@@ -2967,14 +2967,14 @@
     // Append the sample.
     entry->appendSample(eventTime, pointerCoords);
 #if DEBUG_BATCHING
-    LOGD("Appended motion sample onto batch for %s, events were %0.3f ms apart",
+    ALOGD("Appended motion sample onto batch for %s, events were %0.3f ms apart",
             eventDescription, interval * 0.000001f);
 #endif
 }
 
 void InputDispatcher::notifySwitch(const NotifySwitchArgs* args) {
 #if DEBUG_INBOUND_EVENT_DETAILS
-    LOGD("notifySwitch - eventTime=%lld, policyFlags=0x%x, switchCode=%d, switchValue=%d",
+    ALOGD("notifySwitch - eventTime=%lld, policyFlags=0x%x, switchCode=%d, switchValue=%d",
             args->eventTime, args->policyFlags,
             args->switchCode, args->switchValue);
 #endif
@@ -2987,7 +2987,7 @@
 
 void InputDispatcher::notifyDeviceReset(const NotifyDeviceResetArgs* args) {
 #if DEBUG_INBOUND_EVENT_DETAILS
-    LOGD("notifyDeviceReset - eventTime=%lld, deviceId=%d",
+    ALOGD("notifyDeviceReset - eventTime=%lld, deviceId=%d",
             args->eventTime, args->deviceId);
 #endif
 
@@ -3008,7 +3008,7 @@
         int32_t injectorPid, int32_t injectorUid, int32_t syncMode, int32_t timeoutMillis,
         uint32_t policyFlags) {
 #if DEBUG_INBOUND_EVENT_DETAILS
-    LOGD("injectInputEvent - eventType=%d, injectorPid=%d, injectorUid=%d, "
+    ALOGD("injectInputEvent - eventType=%d, injectorPid=%d, injectorUid=%d, "
             "syncMode=%d, timeoutMillis=%d, policyFlags=0x%08x",
             event->getType(), injectorPid, injectorUid, syncMode, timeoutMillis, policyFlags);
 #endif
@@ -3121,7 +3121,7 @@
                 nsecs_t remainingTimeout = endTime - now();
                 if (remainingTimeout <= 0) {
 #if DEBUG_INJECTION
-                    LOGD("injectInputEvent - Timed out waiting for injection result "
+                    ALOGD("injectInputEvent - Timed out waiting for injection result "
                             "to become available.");
 #endif
                     injectionResult = INPUT_EVENT_INJECTION_TIMED_OUT;
@@ -3135,13 +3135,13 @@
                     && syncMode == INPUT_EVENT_INJECTION_SYNC_WAIT_FOR_FINISHED) {
                 while (injectionState->pendingForegroundDispatches != 0) {
 #if DEBUG_INJECTION
-                    LOGD("injectInputEvent - Waiting for %d pending foreground dispatches.",
+                    ALOGD("injectInputEvent - Waiting for %d pending foreground dispatches.",
                             injectionState->pendingForegroundDispatches);
 #endif
                     nsecs_t remainingTimeout = endTime - now();
                     if (remainingTimeout <= 0) {
 #if DEBUG_INJECTION
-                    LOGD("injectInputEvent - Timed out waiting for pending foreground "
+                    ALOGD("injectInputEvent - Timed out waiting for pending foreground "
                             "dispatches to finish.");
 #endif
                         injectionResult = INPUT_EVENT_INJECTION_TIMED_OUT;
@@ -3157,7 +3157,7 @@
     } // release lock
 
 #if DEBUG_INJECTION
-    LOGD("injectInputEvent - Finished with result %d.  "
+    ALOGD("injectInputEvent - Finished with result %d.  "
             "injectorPid=%d, injectorUid=%d",
             injectionResult, injectorPid, injectorUid);
 #endif
@@ -3174,7 +3174,7 @@
     InjectionState* injectionState = entry->injectionState;
     if (injectionState) {
 #if DEBUG_INJECTION
-        LOGD("Setting input event injection result to %d.  "
+        ALOGD("Setting input event injection result to %d.  "
                 "injectorPid=%d, injectorUid=%d",
                  injectionResult, injectionState->injectorPid, injectionState->injectorUid);
 #endif
@@ -3246,7 +3246,7 @@
 
 void InputDispatcher::setInputWindows(const Vector<sp<InputWindowHandle> >& inputWindowHandles) {
 #if DEBUG_FOCUS
-    LOGD("setInputWindows");
+    ALOGD("setInputWindows");
 #endif
     { // acquire lock
         AutoMutex _l(mLock);
@@ -3277,7 +3277,7 @@
         if (mFocusedWindowHandle != newFocusedWindowHandle) {
             if (mFocusedWindowHandle != NULL) {
 #if DEBUG_FOCUS
-                LOGD("Focus left window: %s",
+                ALOGD("Focus left window: %s",
                         mFocusedWindowHandle->getName().string());
 #endif
                 sp<InputChannel> focusedInputChannel = mFocusedWindowHandle->getInputChannel();
@@ -3290,7 +3290,7 @@
             }
             if (newFocusedWindowHandle != NULL) {
 #if DEBUG_FOCUS
-                LOGD("Focus entered window: %s",
+                ALOGD("Focus entered window: %s",
                         newFocusedWindowHandle->getName().string());
 #endif
             }
@@ -3301,7 +3301,7 @@
             TouchedWindow& touchedWindow = mTouchState.windows.editItemAt(i);
             if (!hasWindowHandleLocked(touchedWindow.windowHandle)) {
 #if DEBUG_FOCUS
-                LOGD("Touched window was removed: %s",
+                ALOGD("Touched window was removed: %s",
                         touchedWindow.windowHandle->getName().string());
 #endif
                 sp<InputChannel> touchedInputChannel =
@@ -3324,7 +3324,7 @@
             const sp<InputWindowHandle>& oldWindowHandle = oldWindowHandles.itemAt(i);
             if (!hasWindowHandleLocked(oldWindowHandle)) {
 #if DEBUG_FOCUS
-                LOGD("Window went away: %s", oldWindowHandle->getName().string());
+                ALOGD("Window went away: %s", oldWindowHandle->getName().string());
 #endif
                 oldWindowHandle->releaseInfo();
             }
@@ -3338,7 +3338,7 @@
 void InputDispatcher::setFocusedApplication(
         const sp<InputApplicationHandle>& inputApplicationHandle) {
 #if DEBUG_FOCUS
-    LOGD("setFocusedApplication");
+    ALOGD("setFocusedApplication");
 #endif
     { // acquire lock
         AutoMutex _l(mLock);
@@ -3368,7 +3368,7 @@
 
 void InputDispatcher::setInputDispatchMode(bool enabled, bool frozen) {
 #if DEBUG_FOCUS
-    LOGD("setInputDispatchMode: enabled=%d, frozen=%d", enabled, frozen);
+    ALOGD("setInputDispatchMode: enabled=%d, frozen=%d", enabled, frozen);
 #endif
 
     bool changed;
@@ -3404,7 +3404,7 @@
 
 void InputDispatcher::setInputFilterEnabled(bool enabled) {
 #if DEBUG_FOCUS
-    LOGD("setInputFilterEnabled: enabled=%d", enabled);
+    ALOGD("setInputFilterEnabled: enabled=%d", enabled);
 #endif
 
     { // acquire lock
@@ -3425,7 +3425,7 @@
 bool InputDispatcher::transferTouchFocus(const sp<InputChannel>& fromChannel,
         const sp<InputChannel>& toChannel) {
 #if DEBUG_FOCUS
-    LOGD("transferTouchFocus: fromChannel=%s, toChannel=%s",
+    ALOGD("transferTouchFocus: fromChannel=%s, toChannel=%s",
             fromChannel->getName().string(), toChannel->getName().string());
 #endif
     { // acquire lock
@@ -3435,13 +3435,13 @@
         sp<InputWindowHandle> toWindowHandle = getWindowHandleLocked(toChannel);
         if (fromWindowHandle == NULL || toWindowHandle == NULL) {
 #if DEBUG_FOCUS
-            LOGD("Cannot transfer focus because from or to window not found.");
+            ALOGD("Cannot transfer focus because from or to window not found.");
 #endif
             return false;
         }
         if (fromWindowHandle == toWindowHandle) {
 #if DEBUG_FOCUS
-            LOGD("Trivial transfer to same window.");
+            ALOGD("Trivial transfer to same window.");
 #endif
             return true;
         }
@@ -3467,7 +3467,7 @@
 
         if (! found) {
 #if DEBUG_FOCUS
-            LOGD("Focus transfer failed because from window did not have focus.");
+            ALOGD("Focus transfer failed because from window did not have focus.");
 #endif
             return false;
         }
@@ -3496,7 +3496,7 @@
 
 void InputDispatcher::resetAndDropEverythingLocked(const char* reason) {
 #if DEBUG_FOCUS
-    LOGD("Resetting and dropping all events (%s).", reason);
+    ALOGD("Resetting and dropping all events (%s).", reason);
 #endif
 
     CancelationOptions options(CancelationOptions::CANCEL_ALL_EVENTS, reason);
@@ -3522,7 +3522,7 @@
         if (*end == '\n') {
             *(end++) = '\0';
         }
-        LOGD("%s", start);
+        ALOGD("%s", start);
         start = end;
     }
 }
@@ -3627,7 +3627,7 @@
 status_t InputDispatcher::registerInputChannel(const sp<InputChannel>& inputChannel,
         const sp<InputWindowHandle>& inputWindowHandle, bool monitor) {
 #if DEBUG_REGISTRATION
-    LOGD("channel '%s' ~ registerInputChannel - monitor=%s", inputChannel->getName().string(),
+    ALOGD("channel '%s' ~ registerInputChannel - monitor=%s", inputChannel->getName().string(),
             toString(monitor));
 #endif
 
@@ -3664,7 +3664,7 @@
 
 status_t InputDispatcher::unregisterInputChannel(const sp<InputChannel>& inputChannel) {
 #if DEBUG_REGISTRATION
-    LOGD("channel '%s' ~ unregisterInputChannel", inputChannel->getName().string());
+    ALOGD("channel '%s' ~ unregisterInputChannel", inputChannel->getName().string());
 #endif
 
     { // acquire lock
@@ -3907,7 +3907,7 @@
                     && keyEntry->repeatCount == 0;
             if (fallbackKeyCode == -1 && !initialDown) {
 #if DEBUG_OUTBOUND_EVENT_DETAILS
-                LOGD("Unhandled key event: Skipping unhandled key event processing "
+                ALOGD("Unhandled key event: Skipping unhandled key event processing "
                         "since this is not an initial down.  "
                         "keyCode=%d, action=%d, repeatCount=%d",
                         originalKeyCode, keyEntry->action, keyEntry->repeatCount);
@@ -3917,7 +3917,7 @@
 
             // Dispatch the unhandled key to the policy.
 #if DEBUG_OUTBOUND_EVENT_DETAILS
-            LOGD("Unhandled key event: Asking policy to perform fallback action.  "
+            ALOGD("Unhandled key event: Asking policy to perform fallback action.  "
                     "keyCode=%d, action=%d, repeatCount=%d",
                     keyEntry->keyCode, keyEntry->action, keyEntry->repeatCount);
 #endif
@@ -3958,12 +3958,12 @@
                     && (!fallback || fallbackKeyCode != event.getKeyCode())) {
 #if DEBUG_OUTBOUND_EVENT_DETAILS
                 if (fallback) {
-                    LOGD("Unhandled key event: Policy requested to send key %d"
+                    ALOGD("Unhandled key event: Policy requested to send key %d"
                             "as a fallback for %d, but on the DOWN it had requested "
                             "to send %d instead.  Fallback canceled.",
                             event.getKeyCode(), originalKeyCode, fallbackKeyCode);
                 } else {
-                    LOGD("Unhandled key event: Policy did not request fallback for %d,"
+                    ALOGD("Unhandled key event: Policy did not request fallback for %d,"
                             "but on the DOWN it had requested to send %d.  "
                             "Fallback canceled.",
                             originalKeyCode, fallbackKeyCode);
@@ -3992,7 +3992,7 @@
                     msg.appendFormat(", %d->%d", fallbackKeys.keyAt(i),
                             fallbackKeys.valueAt(i));
                 }
-                LOGD("Unhandled key event: %d currently tracked fallback keys%s.",
+                ALOGD("Unhandled key event: %d currently tracked fallback keys%s.",
                         fallbackKeys.size(), msg.string());
             }
 #endif
@@ -4011,7 +4011,7 @@
                 keyEntry->syntheticRepeat = false;
 
 #if DEBUG_OUTBOUND_EVENT_DETAILS
-                LOGD("Unhandled key event: Dispatching fallback key.  "
+                ALOGD("Unhandled key event: Dispatching fallback key.  "
                         "originalKeyCode=%d, fallbackKeyCode=%d, fallbackMetaState=%08x",
                         originalKeyCode, fallbackKeyCode, keyEntry->metaState);
 #endif
@@ -4021,7 +4021,7 @@
                 return true; // already started next cycle
             } else {
 #if DEBUG_OUTBOUND_EVENT_DETAILS
-                LOGD("Unhandled key event: No fallback key.");
+                ALOGD("Unhandled key event: No fallback key.");
 #endif
             }
         }
@@ -4322,7 +4322,7 @@
          * So for now, allow inconsistent key up events to be dispatched.
          *
 #if DEBUG_OUTBOUND_EVENT_DETAILS
-        LOGD("Dropping inconsistent key up event: deviceId=%d, source=%08x, "
+        ALOGD("Dropping inconsistent key up event: deviceId=%d, source=%08x, "
                 "keyCode=%d, scanCode=%d",
                 entry->deviceId, entry->source, entry->keyCode, entry->scanCode);
 #endif
@@ -4357,7 +4357,7 @@
             return true;
         }
 #if DEBUG_OUTBOUND_EVENT_DETAILS
-        LOGD("Dropping inconsistent motion up or cancel event: deviceId=%d, source=%08x, "
+        ALOGD("Dropping inconsistent motion up or cancel event: deviceId=%d, source=%08x, "
                 "actionMasked=%d",
                 entry->deviceId, entry->source, actionMasked);
 #endif
@@ -4389,7 +4389,7 @@
             return true;
         }
 #if DEBUG_OUTBOUND_EVENT_DETAILS
-        LOGD("Dropping inconsistent motion pointer up/down or move event: "
+        ALOGD("Dropping inconsistent motion pointer up/down or move event: "
                 "deviceId=%d, source=%08x, actionMasked=%d",
                 entry->deviceId, entry->source, actionMasked);
 #endif
@@ -4403,7 +4403,7 @@
             return true;
         }
 #if DEBUG_OUTBOUND_EVENT_DETAILS
-        LOGD("Dropping inconsistent motion hover exit event: deviceId=%d, source=%08x",
+        ALOGD("Dropping inconsistent motion hover exit event: deviceId=%d, source=%08x",
                 entry->deviceId, entry->source);
 #endif
         return false;
diff --git a/services/input/InputReader.cpp b/services/input/InputReader.cpp
index 382987b..55ab0f6 100644
--- a/services/input/InputReader.cpp
+++ b/services/input/InputReader.cpp
@@ -285,7 +285,7 @@
         if (!count || timeoutMillis == 0) {
             nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
 #if DEBUG_RAW_EVENTS
-            LOGD("Timeout expired, latency=%0.3fms", (now - mNextTimeout) * 0.000001f);
+            ALOGD("Timeout expired, latency=%0.3fms", (now - mNextTimeout) * 0.000001f);
 #endif
             mNextTimeout = LLONG_MAX;
             timeoutExpiredLocked(now);
@@ -316,7 +316,7 @@
                 batchSize += 1;
             }
 #if DEBUG_RAW_EVENTS
-            LOGD("BatchSize: %d Count: %d", batchSize, count);
+            ALOGD("BatchSize: %d Count: %d", batchSize, count);
 #endif
             processEventsForDeviceLocked(deviceId, rawEvent, batchSize);
         } else {
@@ -452,7 +452,7 @@
 
     InputDevice* device = mDevices.valueAt(deviceIndex);
     if (device->isIgnored()) {
-        //LOGD("Discarding event for ignored deviceId %d.", deviceId);
+        //ALOGD("Discarding event for ignored deviceId %d.", deviceId);
         return;
     }
 
@@ -938,7 +938,7 @@
     size_t numMappers = mMappers.size();
     for (const RawEvent* rawEvent = rawEvents; count--; rawEvent++) {
 #if DEBUG_RAW_EVENTS
-        LOGD("Input event: device=%d type=0x%04x scancode=0x%04x "
+        ALOGD("Input event: device=%d type=0x%04x scancode=0x%04x "
                 "keycode=0x%04x value=0x%08x flags=0x%08x",
                 rawEvent->deviceId, rawEvent->type, rawEvent->scanCode, rawEvent->keyCode,
                 rawEvent->value, rawEvent->flags);
@@ -948,11 +948,11 @@
             if (rawEvent->type == EV_SYN && rawEvent->scanCode == SYN_REPORT) {
                 mDropUntilNextSync = false;
 #if DEBUG_RAW_EVENTS
-                LOGD("Recovered from input event buffer overrun.");
+                ALOGD("Recovered from input event buffer overrun.");
 #endif
             } else {
 #if DEBUG_RAW_EVENTS
-                LOGD("Dropped input event while waiting for next input sync.");
+                ALOGD("Dropped input event while waiting for next input sync.");
 #endif
             }
         } else if (rawEvent->type == EV_SYN && rawEvent->scanCode == SYN_DROPPED) {
@@ -1521,7 +1521,7 @@
         status_t status = device->getEventHub()->getAbsoluteAxisValue(device->getId(),
                 ABS_MT_SLOT, &initialSlot);
         if (status) {
-            LOGD("Could not retrieve current multitouch slot index.  status=%d", status);
+            ALOGD("Could not retrieve current multitouch slot index.  status=%d", status);
             initialSlot = -1;
         }
         clearSlots(initialSlot);
@@ -3325,11 +3325,11 @@
 
 #if DEBUG_RAW_EVENTS
     if (!havePointerIds) {
-        LOGD("syncTouch: pointerCount %d -> %d, no pointer ids",
+        ALOGD("syncTouch: pointerCount %d -> %d, no pointer ids",
                 mLastRawPointerData.pointerCount,
                 mCurrentRawPointerData.pointerCount);
     } else {
-        LOGD("syncTouch: pointerCount %d -> %d, touching ids 0x%08x -> 0x%08x, "
+        ALOGD("syncTouch: pointerCount %d -> %d, touching ids 0x%08x -> 0x%08x, "
                 "hovering ids 0x%08x -> 0x%08x",
                 mLastRawPointerData.pointerCount,
                 mCurrentRawPointerData.pointerCount,
@@ -3480,7 +3480,7 @@
             mCurrentVirtualKey.down = false;
             if (!mCurrentVirtualKey.ignored) {
 #if DEBUG_VIRTUAL_KEYS
-                LOGD("VirtualKeys: Generating key up: keyCode=%d, scanCode=%d",
+                ALOGD("VirtualKeys: Generating key up: keyCode=%d, scanCode=%d",
                         mCurrentVirtualKey.keyCode, mCurrentVirtualKey.scanCode);
 #endif
                 dispatchVirtualKey(when, policyFlags,
@@ -3507,7 +3507,7 @@
         mCurrentVirtualKey.down = false;
         if (!mCurrentVirtualKey.ignored) {
 #if DEBUG_VIRTUAL_KEYS
-            LOGD("VirtualKeys: Canceling key: keyCode=%d, scanCode=%d",
+            ALOGD("VirtualKeys: Canceling key: keyCode=%d, scanCode=%d",
                     mCurrentVirtualKey.keyCode, mCurrentVirtualKey.scanCode);
 #endif
             dispatchVirtualKey(when, policyFlags,
@@ -3537,7 +3537,7 @@
 
                     if (!mCurrentVirtualKey.ignored) {
 #if DEBUG_VIRTUAL_KEYS
-                        LOGD("VirtualKeys: Generating key down: keyCode=%d, scanCode=%d",
+                        ALOGD("VirtualKeys: Generating key down: keyCode=%d, scanCode=%d",
                                 mCurrentVirtualKey.keyCode,
                                 mCurrentVirtualKey.scanCode);
 #endif
@@ -4199,7 +4199,7 @@
     // Handle TAP timeout.
     if (isTimeout) {
 #if DEBUG_GESTURES
-        LOGD("Gestures: Processing timeout");
+        ALOGD("Gestures: Processing timeout");
 #endif
 
         if (mPointerGesture.lastGestureMode == PointerGesture::TAP) {
@@ -4210,7 +4210,7 @@
             } else {
                 // The tap is finished.
 #if DEBUG_GESTURES
-                LOGD("Gestures: TAP finished");
+                ALOGD("Gestures: TAP finished");
 #endif
                 *outFinishPreviousGesture = true;
 
@@ -4302,7 +4302,7 @@
     if (isQuietTime) {
         // Case 1: Quiet time. (QUIET)
 #if DEBUG_GESTURES
-        LOGD("Gestures: QUIET for next %0.3fms", (mPointerGesture.quietTime
+        ALOGD("Gestures: QUIET for next %0.3fms", (mPointerGesture.quietTime
                 + mConfig.pointerGestureQuietInterval - when) * 0.000001f);
 #endif
         if (mPointerGesture.lastGestureMode != PointerGesture::QUIET) {
@@ -4329,7 +4329,7 @@
         // finger to drag then the active pointer should switch to the finger that is
         // being dragged.
 #if DEBUG_GESTURES
-        LOGD("Gestures: BUTTON_CLICK_OR_DRAG activeTouchId=%d, "
+        ALOGD("Gestures: BUTTON_CLICK_OR_DRAG activeTouchId=%d, "
                 "currentFingerCount=%d", activeTouchId, currentFingerCount);
 #endif
         // Reset state when just starting.
@@ -4358,7 +4358,7 @@
                 mPointerGesture.activeTouchId = activeTouchId = bestId;
                 activeTouchChanged = true;
 #if DEBUG_GESTURES
-                LOGD("Gestures: BUTTON_CLICK_OR_DRAG switched pointers, "
+                ALOGD("Gestures: BUTTON_CLICK_OR_DRAG switched pointers, "
                         "bestId=%d, bestSpeed=%0.3f", bestId, bestSpeed);
 #endif
             }
@@ -4415,7 +4415,7 @@
                 if (fabs(x - mPointerGesture.tapX) <= mConfig.pointerGestureTapSlop
                         && fabs(y - mPointerGesture.tapY) <= mConfig.pointerGestureTapSlop) {
 #if DEBUG_GESTURES
-                    LOGD("Gestures: TAP");
+                    ALOGD("Gestures: TAP");
 #endif
 
                     mPointerGesture.tapUpTime = when;
@@ -4445,14 +4445,14 @@
                     tapped = true;
                 } else {
 #if DEBUG_GESTURES
-                    LOGD("Gestures: Not a TAP, deltaX=%f, deltaY=%f",
+                    ALOGD("Gestures: Not a TAP, deltaX=%f, deltaY=%f",
                             x - mPointerGesture.tapX,
                             y - mPointerGesture.tapY);
 #endif
                 }
             } else {
 #if DEBUG_GESTURES
-                LOGD("Gestures: Not a TAP, %0.3fms since down",
+                ALOGD("Gestures: Not a TAP, %0.3fms since down",
                         (when - mPointerGesture.tapDownTime) * 0.000001f);
 #endif
             }
@@ -4462,7 +4462,7 @@
 
         if (!tapped) {
 #if DEBUG_GESTURES
-            LOGD("Gestures: NEUTRAL");
+            ALOGD("Gestures: NEUTRAL");
 #endif
             mPointerGesture.activeGestureId = -1;
             mPointerGesture.currentGestureMode = PointerGesture::NEUTRAL;
@@ -4485,14 +4485,14 @@
                     mPointerGesture.currentGestureMode = PointerGesture::TAP_DRAG;
                 } else {
 #if DEBUG_GESTURES
-                    LOGD("Gestures: Not a TAP_DRAG, deltaX=%f, deltaY=%f",
+                    ALOGD("Gestures: Not a TAP_DRAG, deltaX=%f, deltaY=%f",
                             x - mPointerGesture.tapX,
                             y - mPointerGesture.tapY);
 #endif
                 }
             } else {
 #if DEBUG_GESTURES
-                LOGD("Gestures: Not a TAP_DRAG, %0.3fms time since up",
+                ALOGD("Gestures: Not a TAP_DRAG, %0.3fms time since up",
                         (when - mPointerGesture.tapUpTime) * 0.000001f);
 #endif
             }
@@ -4523,12 +4523,12 @@
         bool down;
         if (mPointerGesture.currentGestureMode == PointerGesture::TAP_DRAG) {
 #if DEBUG_GESTURES
-            LOGD("Gestures: TAP_DRAG");
+            ALOGD("Gestures: TAP_DRAG");
 #endif
             down = true;
         } else {
 #if DEBUG_GESTURES
-            LOGD("Gestures: HOVER");
+            ALOGD("Gestures: HOVER");
 #endif
             if (mPointerGesture.lastGestureMode != PointerGesture::HOVER) {
                 *outFinishPreviousGesture = true;
@@ -4585,7 +4585,7 @@
             // Additional pointers have gone down but not yet settled.
             // Reset the gesture.
 #if DEBUG_GESTURES
-            LOGD("Gestures: Resetting gesture since additional pointers went down for MULTITOUCH, "
+            ALOGD("Gestures: Resetting gesture since additional pointers went down for MULTITOUCH, "
                     "settle time remaining %0.3fms", (mPointerGesture.firstTouchTime
                             + mConfig.pointerGestureMultitouchSettleInterval - when)
                             * 0.000001f);
@@ -4604,7 +4604,7 @@
 
             // Use the centroid and pointer location as the reference points for the gesture.
 #if DEBUG_GESTURES
-            LOGD("Gestures: Using centroid as reference for MULTITOUCH, "
+            ALOGD("Gestures: Using centroid as reference for MULTITOUCH, "
                     "settle time remaining %0.3fms", (mPointerGesture.firstTouchTime
                             + mConfig.pointerGestureMultitouchSettleInterval - when)
                             * 0.000001f);
@@ -4667,7 +4667,7 @@
                 if (currentFingerCount > 2) {
                     // There are more than two pointers, switch to FREEFORM.
 #if DEBUG_GESTURES
-                    LOGD("Gestures: PRESS transitioned to FREEFORM, number of pointers %d > 2",
+                    ALOGD("Gestures: PRESS transitioned to FREEFORM, number of pointers %d > 2",
                             currentFingerCount);
 #endif
                     *outCancelPreviousGesture = true;
@@ -4684,7 +4684,7 @@
                         // There are two pointers but they are too far apart for a SWIPE,
                         // switch to FREEFORM.
 #if DEBUG_GESTURES
-                        LOGD("Gestures: PRESS transitioned to FREEFORM, distance %0.3f > %0.3f",
+                        ALOGD("Gestures: PRESS transitioned to FREEFORM, distance %0.3f > %0.3f",
                                 mutualDistance, mPointerGestureMaxSwipeWidth);
 #endif
                         *outCancelPreviousGesture = true;
@@ -4711,7 +4711,7 @@
                             if (cosine >= mConfig.pointerGestureSwipeTransitionAngleCosine) {
                                 // Pointers are moving in the same direction.  Switch to SWIPE.
 #if DEBUG_GESTURES
-                                LOGD("Gestures: PRESS transitioned to SWIPE, "
+                                ALOGD("Gestures: PRESS transitioned to SWIPE, "
                                         "dist1 %0.3f >= %0.3f, dist2 %0.3f >= %0.3f, "
                                         "cosine %0.3f >= %0.3f",
                                         dist1, mConfig.pointerGestureMultitouchMinDistance,
@@ -4722,7 +4722,7 @@
                             } else {
                                 // Pointers are moving in different directions.  Switch to FREEFORM.
 #if DEBUG_GESTURES
-                                LOGD("Gestures: PRESS transitioned to FREEFORM, "
+                                ALOGD("Gestures: PRESS transitioned to FREEFORM, "
                                         "dist1 %0.3f >= %0.3f, dist2 %0.3f >= %0.3f, "
                                         "cosine %0.3f < %0.3f",
                                         dist1, mConfig.pointerGestureMultitouchMinDistance,
@@ -4741,7 +4741,7 @@
             // Cancel previous gesture.
             if (currentFingerCount > 2) {
 #if DEBUG_GESTURES
-                LOGD("Gestures: SWIPE transitioned to FREEFORM, number of pointers %d > 2",
+                ALOGD("Gestures: SWIPE transitioned to FREEFORM, number of pointers %d > 2",
                         currentFingerCount);
 #endif
                 *outCancelPreviousGesture = true;
@@ -4778,7 +4778,7 @@
                 || mPointerGesture.currentGestureMode == PointerGesture::SWIPE) {
             // PRESS or SWIPE mode.
 #if DEBUG_GESTURES
-            LOGD("Gestures: PRESS or SWIPE activeTouchId=%d,"
+            ALOGD("Gestures: PRESS or SWIPE activeTouchId=%d,"
                     "activeGestureId=%d, currentTouchPointerCount=%d",
                     activeTouchId, mPointerGesture.activeGestureId, currentFingerCount);
 #endif
@@ -4800,7 +4800,7 @@
         } else if (mPointerGesture.currentGestureMode == PointerGesture::FREEFORM) {
             // FREEFORM mode.
 #if DEBUG_GESTURES
-            LOGD("Gestures: FREEFORM activeTouchId=%d,"
+            ALOGD("Gestures: FREEFORM activeTouchId=%d,"
                     "activeGestureId=%d, currentTouchPointerCount=%d",
                     activeTouchId, mPointerGesture.activeGestureId, currentFingerCount);
 #endif
@@ -4843,7 +4843,7 @@
             }
 
 #if DEBUG_GESTURES
-            LOGD("Gestures: FREEFORM follow up "
+            ALOGD("Gestures: FREEFORM follow up "
                     "mappedTouchIdBits=0x%08x, usedGestureIdBits=0x%08x, "
                     "activeGestureId=%d",
                     mappedTouchIdBits.value, usedGestureIdBits.value,
@@ -4858,14 +4858,14 @@
                     gestureId = usedGestureIdBits.markFirstUnmarkedBit();
                     mPointerGesture.freeformTouchToGestureIdMap[touchId] = gestureId;
 #if DEBUG_GESTURES
-                    LOGD("Gestures: FREEFORM "
+                    ALOGD("Gestures: FREEFORM "
                             "new mapping for touch id %d -> gesture id %d",
                             touchId, gestureId);
 #endif
                 } else {
                     gestureId = mPointerGesture.freeformTouchToGestureIdMap[touchId];
 #if DEBUG_GESTURES
-                    LOGD("Gestures: FREEFORM "
+                    ALOGD("Gestures: FREEFORM "
                             "existing mapping for touch id %d -> gesture id %d",
                             touchId, gestureId);
 #endif
@@ -4898,7 +4898,7 @@
                 mPointerGesture.activeGestureId =
                         mPointerGesture.currentGestureIdBits.firstMarkedBit();
 #if DEBUG_GESTURES
-                LOGD("Gestures: FREEFORM new "
+                ALOGD("Gestures: FREEFORM new "
                         "activeGestureId=%d", mPointerGesture.activeGestureId);
 #endif
             }
@@ -4908,7 +4908,7 @@
     mPointerController->setButtonState(mCurrentButtonState);
 
 #if DEBUG_GESTURES
-    LOGD("Gestures: finishPreviousGesture=%s, cancelPreviousGesture=%s, "
+    ALOGD("Gestures: finishPreviousGesture=%s, cancelPreviousGesture=%s, "
             "currentGestureMode=%d, currentGestureIdBits=0x%08x, "
             "lastGestureMode=%d, lastGestureIdBits=0x%08x",
             toString(*outFinishPreviousGesture), toString(*outCancelPreviousGesture),
@@ -4919,7 +4919,7 @@
         uint32_t index = mPointerGesture.currentGestureIdToIndex[id];
         const PointerProperties& properties = mPointerGesture.currentGestureProperties[index];
         const PointerCoords& coords = mPointerGesture.currentGestureCoords[index];
-        LOGD("  currentGesture[%d]: index=%d, toolType=%d, "
+        ALOGD("  currentGesture[%d]: index=%d, toolType=%d, "
                 "x=%0.3f, y=%0.3f, pressure=%0.3f",
                 id, index, properties.toolType,
                 coords.getAxisValue(AMOTION_EVENT_AXIS_X),
@@ -4931,7 +4931,7 @@
         uint32_t index = mPointerGesture.lastGestureIdToIndex[id];
         const PointerProperties& properties = mPointerGesture.lastGestureProperties[index];
         const PointerCoords& coords = mPointerGesture.lastGestureCoords[index];
-        LOGD("  lastGesture[%d]: index=%d, toolType=%d, "
+        ALOGD("  lastGesture[%d]: index=%d, toolType=%d, "
                 "x=%0.3f, y=%0.3f, pressure=%0.3f",
                 id, index, properties.toolType,
                 coords.getAxisValue(AMOTION_EVENT_AXIS_X),
@@ -5240,7 +5240,7 @@
         const VirtualKey& virtualKey = mVirtualKeys[i];
 
 #if DEBUG_VIRTUAL_KEYS
-        LOGD("VirtualKeys: Hit test (%d, %d): keyCode=%d, scanCode=%d, "
+        ALOGD("VirtualKeys: Hit test (%d, %d): keyCode=%d, scanCode=%d, "
                 "left=%d, top=%d, right=%d, bottom=%d",
                 x, y,
                 virtualKey.keyCode, virtualKey.scanCode,
@@ -5345,9 +5345,9 @@
     }
 
 #if DEBUG_POINTER_ASSIGNMENT
-    LOGD("assignPointerIds - initial distance min-heap: size=%d", heapSize);
+    ALOGD("assignPointerIds - initial distance min-heap: size=%d", heapSize);
     for (size_t i = 0; i < heapSize; i++) {
-        LOGD("  heap[%d]: cur=%d, last=%d, distance=%lld",
+        ALOGD("  heap[%d]: cur=%d, last=%d, distance=%lld",
                 i, heap[i].currentPointerIndex, heap[i].lastPointerIndex,
                 heap[i].distance);
     }
@@ -5391,9 +5391,9 @@
                 }
 
 #if DEBUG_POINTER_ASSIGNMENT
-                LOGD("assignPointerIds - reduced distance min-heap: size=%d", heapSize);
+                ALOGD("assignPointerIds - reduced distance min-heap: size=%d", heapSize);
                 for (size_t i = 0; i < heapSize; i++) {
-                    LOGD("  heap[%d]: cur=%d, last=%d, distance=%lld",
+                    ALOGD("  heap[%d]: cur=%d, last=%d, distance=%lld",
                             i, heap[i].currentPointerIndex, heap[i].lastPointerIndex,
                             heap[i].distance);
                 }
@@ -5419,7 +5419,7 @@
             usedIdBits.markBit(id);
 
 #if DEBUG_POINTER_ASSIGNMENT
-            LOGD("assignPointerIds - matched: cur=%d, last=%d, id=%d, distance=%lld",
+            ALOGD("assignPointerIds - matched: cur=%d, last=%d, id=%d, distance=%lld",
                     lastPointerIndex, currentPointerIndex, id, heap[0].distance);
 #endif
             break;
@@ -5437,7 +5437,7 @@
                 mCurrentRawPointerData.isHovering(currentPointerIndex));
 
 #if DEBUG_POINTER_ASSIGNMENT
-        LOGD("assignPointerIds - assigned: cur=%d, id=%d",
+        ALOGD("assignPointerIds - assigned: cur=%d, id=%d",
                 currentPointerIndex, id);
 #endif
     }
@@ -5595,7 +5595,7 @@
 
         if (outCount >= MAX_POINTERS) {
 #if DEBUG_POINTERS
-            LOGD("MultiTouch device %s emitted more than maximum of %d pointers; "
+            ALOGD("MultiTouch device %s emitted more than maximum of %d pointers; "
                     "ignoring the rest.",
                     getDeviceName().string(), MAX_POINTERS);
 #endif
diff --git a/services/input/PointerController.cpp b/services/input/PointerController.cpp
index 1d1730d..fc828a6 100644
--- a/services/input/PointerController.cpp
+++ b/services/input/PointerController.cpp
@@ -126,7 +126,7 @@
 
 void PointerController::move(float deltaX, float deltaY) {
 #if DEBUG_POINTER_UPDATES
-    LOGD("Move pointer by deltaX=%0.3f, deltaY=%0.3f", deltaX, deltaY);
+    ALOGD("Move pointer by deltaX=%0.3f, deltaY=%0.3f", deltaX, deltaY);
 #endif
     if (deltaX == 0.0f && deltaY == 0.0f) {
         return;
@@ -139,7 +139,7 @@
 
 void PointerController::setButtonState(int32_t buttonState) {
 #if DEBUG_POINTER_UPDATES
-    LOGD("Set button state 0x%08x", buttonState);
+    ALOGD("Set button state 0x%08x", buttonState);
 #endif
     AutoMutex _l(mLock);
 
@@ -156,7 +156,7 @@
 
 void PointerController::setPosition(float x, float y) {
 #if DEBUG_POINTER_UPDATES
-    LOGD("Set pointer position to x=%0.3f, y=%0.3f", x, y);
+    ALOGD("Set pointer position to x=%0.3f, y=%0.3f", x, y);
 #endif
     AutoMutex _l(mLock);
 
@@ -243,12 +243,12 @@
 void PointerController::setSpots(const PointerCoords* spotCoords,
         const uint32_t* spotIdToIndex, BitSet32 spotIdBits) {
 #if DEBUG_POINTER_UPDATES
-    LOGD("setSpots: idBits=%08x", spotIdBits.value);
+    ALOGD("setSpots: idBits=%08x", spotIdBits.value);
     for (BitSet32 idBits(spotIdBits); !idBits.isEmpty(); ) {
         uint32_t id = idBits.firstMarkedBit();
         idBits.clearBit(id);
         const PointerCoords& c = spotCoords[spotIdToIndex[id]];
-        LOGD(" spot %d: position=(%0.3f, %0.3f), pressure=%0.3f", id,
+        ALOGD(" spot %d: position=(%0.3f, %0.3f), pressure=%0.3f", id,
                 c.getAxisValue(AMOTION_EVENT_AXIS_X),
                 c.getAxisValue(AMOTION_EVENT_AXIS_Y),
                 c.getAxisValue(AMOTION_EVENT_AXIS_PRESSURE));
@@ -290,7 +290,7 @@
 
 void PointerController::clearSpots() {
 #if DEBUG_POINTER_UPDATES
-    LOGD("clearSpots");
+    ALOGD("clearSpots");
 #endif
 
     AutoMutex _l(mLock);
diff --git a/services/jni/com_android_server_AlarmManagerService.cpp b/services/jni/com_android_server_AlarmManagerService.cpp
index e80dd04..5f189a2 100644
--- a/services/jni/com_android_server_AlarmManagerService.cpp
+++ b/services/jni/com_android_server_AlarmManagerService.cpp
@@ -49,7 +49,7 @@
         LOGE("Unable to set kernel timezone to %d: %s\n", minswest, strerror(errno));
         return -1;
     } else {
-        LOGD("Kernel timezone updated to %d minutes west of GMT\n", minswest);
+        ALOGD("Kernel timezone updated to %d minutes west of GMT\n", minswest);
     }
 
     return 0;
diff --git a/services/jni/com_android_server_InputManager.cpp b/services/jni/com_android_server_InputManager.cpp
index f259883..145f713 100644
--- a/services/jni/com_android_server_InputManager.cpp
+++ b/services/jni/com_android_server_InputManager.cpp
@@ -502,7 +502,7 @@
 void NativeInputManager::notifySwitch(nsecs_t when, int32_t switchCode,
         int32_t switchValue, uint32_t policyFlags) {
 #if DEBUG_INPUT_DISPATCHER_POLICY
-    LOGD("notifySwitch - when=%lld, switchCode=%d, switchValue=%d, policyFlags=0x%x",
+    ALOGD("notifySwitch - when=%lld, switchCode=%d, switchValue=%d, policyFlags=0x%x",
             when, switchCode, switchValue, policyFlags);
 #endif
 
@@ -519,7 +519,7 @@
 
 void NativeInputManager::notifyConfigurationChanged(nsecs_t when) {
 #if DEBUG_INPUT_DISPATCHER_POLICY
-    LOGD("notifyConfigurationChanged - when=%lld", when);
+    ALOGD("notifyConfigurationChanged - when=%lld", when);
 #endif
 
     JNIEnv* env = jniEnv();
@@ -531,7 +531,7 @@
 nsecs_t NativeInputManager::notifyANR(const sp<InputApplicationHandle>& inputApplicationHandle,
         const sp<InputWindowHandle>& inputWindowHandle) {
 #if DEBUG_INPUT_DISPATCHER_POLICY
-    LOGD("notifyANR");
+    ALOGD("notifyANR");
 #endif
 
     JNIEnv* env = jniEnv();
@@ -556,7 +556,7 @@
 
 void NativeInputManager::notifyInputChannelBroken(const sp<InputWindowHandle>& inputWindowHandle) {
 #if DEBUG_INPUT_DISPATCHER_POLICY
-    LOGD("notifyInputChannelBroken");
+    ALOGD("notifyInputChannelBroken");
 #endif
 
     JNIEnv* env = jniEnv();
@@ -829,14 +829,14 @@
         uint32_t& policyFlags) {
     if (wmActions & WM_ACTION_GO_TO_SLEEP) {
 #if DEBUG_INPUT_DISPATCHER_POLICY
-        LOGD("handleInterceptActions: Going to sleep.");
+        ALOGD("handleInterceptActions: Going to sleep.");
 #endif
         android_server_PowerManagerService_goToSleep(when);
     }
 
     if (wmActions & WM_ACTION_POKE_USER_ACTIVITY) {
 #if DEBUG_INPUT_DISPATCHER_POLICY
-        LOGD("handleInterceptActions: Poking user activity.");
+        ALOGD("handleInterceptActions: Poking user activity.");
 #endif
         android_server_PowerManagerService_userActivity(when, POWER_MANAGER_BUTTON_EVENT);
     }
@@ -845,7 +845,7 @@
         policyFlags |= POLICY_FLAG_PASS_TO_USER;
     } else {
 #if DEBUG_INPUT_DISPATCHER_POLICY
-        LOGD("handleInterceptActions: Not passing key to user.");
+        ALOGD("handleInterceptActions: Not passing key to user.");
 #endif
     }
 }
diff --git a/services/jni/com_android_server_connectivity_Vpn.cpp b/services/jni/com_android_server_connectivity_Vpn.cpp
index d28a6b4..d9b8a14 100644
--- a/services/jni/com_android_server_connectivity_Vpn.cpp
+++ b/services/jni/com_android_server_connectivity_Vpn.cpp
@@ -171,7 +171,7 @@
                 break;
             }
         }
-        LOGD("Address added on %s: %s/%d", name, address, prefix);
+        ALOGD("Address added on %s: %s/%d", name, address, prefix);
         ++count;
     }
 
@@ -260,7 +260,7 @@
                 }
             }
         }
-        LOGD("Route added on %s: %s/%d", name, address, prefix);
+        ALOGD("Route added on %s: %s/%d", name, address, prefix);
         ++count;
     }
 
diff --git a/services/jni/com_android_server_location_GpsLocationProvider.cpp b/services/jni/com_android_server_location_GpsLocationProvider.cpp
index c823da5..2e5b5d6 100755
--- a/services/jni/com_android_server_location_GpsLocationProvider.cpp
+++ b/services/jni/com_android_server_location_GpsLocationProvider.cpp
@@ -107,7 +107,7 @@
 
 static void set_capabilities_callback(uint32_t capabilities)
 {
-    LOGD("set_capabilities_callback: %ld\n", capabilities);
+    ALOGD("set_capabilities_callback: %ld\n", capabilities);
     JNIEnv* env = AndroidRuntime::getJNIEnv();
     env->CallVoidMethod(mCallbacksObj, method_setEngineCapabilities, capabilities);
     checkAndClearExceptionFromCallback(env, __FUNCTION__);
@@ -182,7 +182,7 @@
 
 static void gps_ni_notify_callback(GpsNiNotification *notification)
 {
-    LOGD("gps_ni_notify_callback\n");
+    ALOGD("gps_ni_notify_callback\n");
     JNIEnv* env = AndroidRuntime::getJNIEnv();
     jstring requestor_id = env->NewStringUTF(notification->requestor_id);
     jstring text = env->NewStringUTF(notification->text);
diff --git a/services/sensorservice/SensorDevice.cpp b/services/sensorservice/SensorDevice.cpp
index 7575ebd..8f23506 100644
--- a/services/sensorservice/SensorDevice.cpp
+++ b/services/sensorservice/SensorDevice.cpp
@@ -182,13 +182,13 @@
     Info& info( mActivationCount.editValueFor(handle) );
 
 
-    LOGD_IF(DEBUG_CONNECTIONS,
+    ALOGD_IF(DEBUG_CONNECTIONS,
             "SensorDevice::activate: ident=%p, handle=0x%08x, enabled=%d, count=%d",
             ident, handle, enabled, info.rates.size());
 
     if (enabled) {
         Mutex::Autolock _l(mLock);
-        LOGD_IF(DEBUG_CONNECTIONS, "... index=%ld",
+        ALOGD_IF(DEBUG_CONNECTIONS, "... index=%ld",
                 info.rates.indexOfKey(ident));
 
         if (info.rates.indexOfKey(ident) < 0) {
@@ -201,7 +201,7 @@
         }
     } else {
         Mutex::Autolock _l(mLock);
-        LOGD_IF(DEBUG_CONNECTIONS, "... index=%ld",
+        ALOGD_IF(DEBUG_CONNECTIONS, "... index=%ld",
                 info.rates.indexOfKey(ident));
 
         ssize_t idx = info.rates.removeItem(ident);
@@ -215,7 +215,7 @@
     }
 
     if (actuateHardware) {
-        LOGD_IF(DEBUG_CONNECTIONS, "\t>>> actuating h/w");
+        ALOGD_IF(DEBUG_CONNECTIONS, "\t>>> actuating h/w");
 
         err = mSensorDevice->activate(mSensorDevice, handle, enabled);
         if (enabled) {
diff --git a/services/sensorservice/SensorFusion.cpp b/services/sensorservice/SensorFusion.cpp
index 518a1bb7..d23906d 100644
--- a/services/sensorservice/SensorFusion.cpp
+++ b/services/sensorservice/SensorFusion.cpp
@@ -76,7 +76,7 @@
 
 status_t SensorFusion::activate(void* ident, bool enabled) {
 
-    LOGD_IF(DEBUG_CONNECTIONS,
+    ALOGD_IF(DEBUG_CONNECTIONS,
             "SensorFusion::activate(ident=%p, enabled=%d)",
             ident, enabled);
 
diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp
index f61a11a..3e4a2f5 100644
--- a/services/sensorservice/SensorService.cpp
+++ b/services/sensorservice/SensorService.cpp
@@ -65,7 +65,7 @@
 
 void SensorService::onFirstRef()
 {
-    LOGD("nuSensorService starting...");
+    ALOGD("nuSensorService starting...");
 
     SensorDevice& dev(SensorDevice::getInstance());
 
@@ -222,7 +222,7 @@
 
 bool SensorService::threadLoop()
 {
-    LOGD("nuSensorService thread starting...");
+    ALOGD("nuSensorService thread starting...");
 
     const size_t numEventMax = 16 * (1 + mVirtualSensorList.size());
     sensors_event_t buffer[numEventMax];
@@ -363,11 +363,11 @@
     Mutex::Autolock _l(mLock);
     const wp<SensorEventConnection> connection(c);
     size_t size = mActiveSensors.size();
-    LOGD_IF(DEBUG_CONNECTIONS, "%d active sensors", size);
+    ALOGD_IF(DEBUG_CONNECTIONS, "%d active sensors", size);
     for (size_t i=0 ; i<size ; ) {
         int handle = mActiveSensors.keyAt(i);
         if (c->hasSensor(handle)) {
-            LOGD_IF(DEBUG_CONNECTIONS, "%i: disabling handle=0x%08x", i, handle);
+            ALOGD_IF(DEBUG_CONNECTIONS, "%i: disabling handle=0x%08x", i, handle);
             SensorInterface* sensor = mSensorMap.valueFor( handle );
             LOGE_IF(!sensor, "mSensorMap[handle=0x%08x] is null!", handle);
             if (sensor) {
@@ -376,12 +376,12 @@
         }
         SensorRecord* rec = mActiveSensors.valueAt(i);
         LOGE_IF(!rec, "mActiveSensors[%d] is null (handle=0x%08x)!", i, handle);
-        LOGD_IF(DEBUG_CONNECTIONS,
+        ALOGD_IF(DEBUG_CONNECTIONS,
                 "removing connection %p for sensor[%d].handle=0x%08x",
                 c, i, handle);
 
         if (rec && rec->removeConnection(connection)) {
-            LOGD_IF(DEBUG_CONNECTIONS, "... and it was the last connection");
+            ALOGD_IF(DEBUG_CONNECTIONS, "... and it was the last connection");
             mActiveSensors.removeItemsAt(i, 1);
             mActiveVirtualSensors.removeItem(handle);
             delete rec;
@@ -528,7 +528,7 @@
 
 SensorService::SensorEventConnection::~SensorEventConnection()
 {
-    LOGD_IF(DEBUG_CONNECTIONS, "~SensorEventConnection(%p)", this);
+    ALOGD_IF(DEBUG_CONNECTIONS, "~SensorEventConnection(%p)", this);
     mService->cleanupConnection(this);
 }
 
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp b/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp
index 3b7c09e..174dcd7 100644
--- a/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp
+++ b/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp
@@ -79,7 +79,7 @@
     LOGW_IF(err<0, "ANDROID_WAIT_FOR_FB_SLEEP failed (%s)", strerror(errno));
     if (err >= 0) {
         sp<SurfaceFlinger> flinger = mFlinger.promote();
-        LOGD("About to give-up screen, flinger = %p", flinger.get());
+        ALOGD("About to give-up screen, flinger = %p", flinger.get());
         if (flinger != 0) {
             mBarrier.close();
             flinger->screenReleased(0);
@@ -94,7 +94,7 @@
     LOGW_IF(err<0, "ANDROID_WAIT_FOR_FB_WAKE failed (%s)", strerror(errno));
     if (err >= 0) {
         sp<SurfaceFlinger> flinger = mFlinger.promote();
-        LOGD("Screen about to return, flinger = %p", flinger.get());
+        ALOGD("Screen about to return, flinger = %p", flinger.get());
         if (flinger != 0)
             flinger->screenAcquired(0);
     }
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index d3b0dbf..d4c4b1f 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -350,7 +350,7 @@
 
     if (sizeChanged) {
         // the size changed, we need to ask our client to request a new buffer
-        LOGD_IF(DEBUG_RESIZE,
+        ALOGD_IF(DEBUG_RESIZE,
                 "doTransaction: "
                 "resize (layer=%p), requested (%dx%d), drawing (%d,%d), "
                 "scalingMode=%d",
@@ -485,7 +485,7 @@
                 recomputeVisibleRegions = true;
             }
 
-            LOGD_IF(DEBUG_RESIZE,
+            ALOGD_IF(DEBUG_RESIZE,
                     "lockPageFlip : "
                     "       (layer=%p), buffer (%ux%u, tr=%02x), "
                     "requested (%dx%d)",
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 014c7e2..96a0fd66 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1290,7 +1290,7 @@
         return surfaceHandle;
     }
 
-    //LOGD("createSurface for pid %d (%d x %d)", pid, w, h);
+    //ALOGD("createSurface for pid %d (%d x %d)", pid, w, h);
     sp<Layer> normalLayer;
     switch (flags & eFXSurfaceMask) {
         case eFXSurfaceNormal:
@@ -2279,7 +2279,7 @@
     sh = (!sh) ? hw_h : sh;
     const size_t size = sw * sh * 4;
 
-    //LOGD("screenshot: sw=%d, sh=%d, minZ=%d, maxZ=%d",
+    //ALOGD("screenshot: sw=%d, sh=%d, minZ=%d, maxZ=%d",
     //        sw, sh, minLayerZ, maxLayerZ);
 
     // make sure to clear all GL error flags
@@ -2370,7 +2370,7 @@
 
     hw.compositionComplete();
 
-    // LOGD("screenshot: result = %s", result<0 ? strerror(result) : "OK");
+    // ALOGD("screenshot: result = %s", result<0 ? strerror(result) : "OK");
 
     return result;
 }
diff --git a/services/surfaceflinger/SurfaceTextureLayer.cpp b/services/surfaceflinger/SurfaceTextureLayer.cpp
index 5020e00..259b937 100644
--- a/services/surfaceflinger/SurfaceTextureLayer.cpp
+++ b/services/surfaceflinger/SurfaceTextureLayer.cpp
@@ -37,7 +37,7 @@
 
 status_t SurfaceTextureLayer::setDefaultBufferSize(uint32_t w, uint32_t h)
 {
-    //LOGD("%s, w=%u, h=%u", __PRETTY_FUNCTION__, w, h);
+    //ALOGD("%s, w=%u, h=%u", __PRETTY_FUNCTION__, w, h);
     return SurfaceTexture::setDefaultBufferSize(w, h);
 }
 
@@ -73,7 +73,7 @@
         if (format == 0)
             format = mDefaultFormat;
         uint32_t effectiveUsage = layer->getEffectiveUsage(usage);
-        //LOGD("%s, w=%u, h=%u, format=%u, usage=%08x, effectiveUsage=%08x",
+        //ALOGD("%s, w=%u, h=%u, format=%u, usage=%08x, effectiveUsage=%08x",
         //        __PRETTY_FUNCTION__, w, h, format, usage, effectiveUsage);
         res = SurfaceTexture::dequeueBuffer(buf, w, h, format, effectiveUsage);
     }
diff --git a/services/surfaceflinger/Transform.cpp b/services/surfaceflinger/Transform.cpp
index ba345ce..ca3fa6e 100644
--- a/services/surfaceflinger/Transform.cpp
+++ b/services/surfaceflinger/Transform.cpp
@@ -344,10 +344,10 @@
     if (mType&TRANSLATE)
         type.append("TRANSLATE ");
 
-    LOGD("%s 0x%08x (%s, %s)", name, mType, flags.string(), type.string());
-    LOGD("%.4f  %.4f  %.4f", m[0][0], m[1][0], m[2][0]);
-    LOGD("%.4f  %.4f  %.4f", m[0][1], m[1][1], m[2][1]);
-    LOGD("%.4f  %.4f  %.4f", m[0][2], m[1][2], m[2][2]);
+    ALOGD("%s 0x%08x (%s, %s)", name, mType, flags.string(), type.string());
+    ALOGD("%.4f  %.4f  %.4f", m[0][0], m[1][0], m[2][0]);
+    ALOGD("%.4f  %.4f  %.4f", m[0][1], m[1][1], m[2][1]);
+    ALOGD("%.4f  %.4f  %.4f", m[0][2], m[1][2], m[2][2]);
 }
 
 // ---------------------------------------------------------------------------
diff --git a/services/surfaceflinger/tests/Transaction_test.cpp b/services/surfaceflinger/tests/Transaction_test.cpp
index afafd8a..396a3fd 100644
--- a/services/surfaceflinger/tests/Transaction_test.cpp
+++ b/services/surfaceflinger/tests/Transaction_test.cpp
@@ -204,11 +204,11 @@
         sc->checkPixel(145, 145,  63,  63, 195);
     }
 
-    LOGD("resizing");
+    ALOGD("resizing");
     SurfaceComposerClient::openGlobalTransaction();
     ASSERT_EQ(NO_ERROR, mFGSurfaceControl->setSize(128, 128));
     SurfaceComposerClient::closeGlobalTransaction(true);
-    LOGD("resized");
+    ALOGD("resized");
     {
         // This should not reflect the new size or color because SurfaceFlinger
         // has not yet received a buffer of the correct size.
@@ -219,10 +219,10 @@
         sc->checkPixel(145, 145,  63,  63, 195);
     }
 
-    LOGD("drawing");
+    ALOGD("drawing");
     fillSurfaceRGBA8(mFGSurfaceControl, 63, 195, 63);
     waitForPostedBuffers();
-    LOGD("drawn");
+    ALOGD("drawn");
     {
         // This should reflect the new size and the new color.
         SCOPED_TRACE("after redraw");
diff --git a/tools/aapt/ZipEntry.cpp b/tools/aapt/ZipEntry.cpp
index d77bd3f..b00135e 100644
--- a/tools/aapt/ZipEntry.cpp
+++ b/tools/aapt/ZipEntry.cpp
@@ -47,7 +47,7 @@
     /* read the CDE */
     result = mCDE.read(fp);
     if (result != NO_ERROR) {
-        LOGD("mCDE.read failed\n");
+        ALOGD("mCDE.read failed\n");
         return result;
     }
 
@@ -56,14 +56,14 @@
     /* using the info in the CDE, go load up the LFH */
     posn = ftell(fp);
     if (fseek(fp, mCDE.mLocalHeaderRelOffset, SEEK_SET) != 0) {
-        LOGD("local header seek failed (%ld)\n",
+        ALOGD("local header seek failed (%ld)\n",
             mCDE.mLocalHeaderRelOffset);
         return UNKNOWN_ERROR;
     }
 
     result = mLFH.read(fp);
     if (result != NO_ERROR) {
-        LOGD("mLFH.read failed\n");
+        ALOGD("mLFH.read failed\n");
         return result;
     }
 
@@ -81,7 +81,7 @@
     hasDD = (mLFH.mGPBitFlag & kUsesDataDescr) != 0;
     if (hasDD) {
         // do something clever
-        //LOGD("+++ has data descriptor\n");
+        //ALOGD("+++ has data descriptor\n");
     }
 
     /*
@@ -413,7 +413,7 @@
     }
 
     if (ZipEntry::getLongLE(&buf[0x00]) != kSignature) {
-        LOGD("whoops: didn't find expected signature\n");
+        ALOGD("whoops: didn't find expected signature\n");
         result = UNKNOWN_ERROR;
         goto bail;
     }
@@ -506,17 +506,17 @@
  */
 void ZipEntry::LocalFileHeader::dump(void) const
 {
-    LOGD(" LocalFileHeader contents:\n");
-    LOGD("  versToExt=%u gpBits=0x%04x compression=%u\n",
+    ALOGD(" LocalFileHeader contents:\n");
+    ALOGD("  versToExt=%u gpBits=0x%04x compression=%u\n",
         mVersionToExtract, mGPBitFlag, mCompressionMethod);
-    LOGD("  modTime=0x%04x modDate=0x%04x crc32=0x%08lx\n",
+    ALOGD("  modTime=0x%04x modDate=0x%04x crc32=0x%08lx\n",
         mLastModFileTime, mLastModFileDate, mCRC32);
-    LOGD("  compressedSize=%lu uncompressedSize=%lu\n",
+    ALOGD("  compressedSize=%lu uncompressedSize=%lu\n",
         mCompressedSize, mUncompressedSize);
-    LOGD("  filenameLen=%u extraLen=%u\n",
+    ALOGD("  filenameLen=%u extraLen=%u\n",
         mFileNameLength, mExtraFieldLength);
     if (mFileName != NULL)
-        LOGD("  filename: '%s'\n", mFileName);
+        ALOGD("  filename: '%s'\n", mFileName);
 }
 
 
@@ -549,7 +549,7 @@
     }
 
     if (ZipEntry::getLongLE(&buf[0x00]) != kSignature) {
-        LOGD("Whoops: didn't find expected signature\n");
+        ALOGD("Whoops: didn't find expected signature\n");
         result = UNKNOWN_ERROR;
         goto bail;
     }
@@ -675,22 +675,22 @@
  */
 void ZipEntry::CentralDirEntry::dump(void) const
 {
-    LOGD(" CentralDirEntry contents:\n");
-    LOGD("  versMadeBy=%u versToExt=%u gpBits=0x%04x compression=%u\n",
+    ALOGD(" CentralDirEntry contents:\n");
+    ALOGD("  versMadeBy=%u versToExt=%u gpBits=0x%04x compression=%u\n",
         mVersionMadeBy, mVersionToExtract, mGPBitFlag, mCompressionMethod);
-    LOGD("  modTime=0x%04x modDate=0x%04x crc32=0x%08lx\n",
+    ALOGD("  modTime=0x%04x modDate=0x%04x crc32=0x%08lx\n",
         mLastModFileTime, mLastModFileDate, mCRC32);
-    LOGD("  compressedSize=%lu uncompressedSize=%lu\n",
+    ALOGD("  compressedSize=%lu uncompressedSize=%lu\n",
         mCompressedSize, mUncompressedSize);
-    LOGD("  filenameLen=%u extraLen=%u commentLen=%u\n",
+    ALOGD("  filenameLen=%u extraLen=%u commentLen=%u\n",
         mFileNameLength, mExtraFieldLength, mFileCommentLength);
-    LOGD("  diskNumStart=%u intAttr=0x%04x extAttr=0x%08lx relOffset=%lu\n",
+    ALOGD("  diskNumStart=%u intAttr=0x%04x extAttr=0x%08lx relOffset=%lu\n",
         mDiskNumberStart, mInternalAttrs, mExternalAttrs,
         mLocalHeaderRelOffset);
 
     if (mFileName != NULL)
-        LOGD("  filename: '%s'\n", mFileName);
+        ALOGD("  filename: '%s'\n", mFileName);
     if (mFileComment != NULL)
-        LOGD("  comment: '%s'\n", mFileComment);
+        ALOGD("  comment: '%s'\n", mFileComment);
 }
 
diff --git a/tools/aapt/ZipFile.cpp b/tools/aapt/ZipFile.cpp
index 9e5ee42..a2d5b80 100644
--- a/tools/aapt/ZipFile.cpp
+++ b/tools/aapt/ZipFile.cpp
@@ -78,7 +78,7 @@
         newArchive = (access(zipFileName, F_OK) != 0);
         if (!(flags & kOpenCreate) && newArchive) {
             /* not creating, must already exist */
-            LOGD("File %s does not exist", zipFileName);
+            ALOGD("File %s does not exist", zipFileName);
             return NAME_NOT_FOUND;
         }
     }
@@ -96,7 +96,7 @@
     mZipFp = fopen(zipFileName, openflags);
     if (mZipFp == NULL) {
         int err = errno;
-        LOGD("fopen failed: %d\n", err);
+        ALOGD("fopen failed: %d\n", err);
         return errnoToStatus(err);
     }
 
@@ -215,14 +215,14 @@
 
     /* too small to be a ZIP archive? */
     if (fileLength < EndOfCentralDir::kEOCDLen) {
-        LOGD("Length is %ld -- too small\n", (long)fileLength);
+        ALOGD("Length is %ld -- too small\n", (long)fileLength);
         result = INVALID_OPERATION;
         goto bail;
     }
 
     buf = new unsigned char[EndOfCentralDir::kMaxEOCDSearch];
     if (buf == NULL) {
-        LOGD("Failure allocating %d bytes for EOCD search",
+        ALOGD("Failure allocating %d bytes for EOCD search",
              EndOfCentralDir::kMaxEOCDSearch);
         result = NO_MEMORY;
         goto bail;
@@ -236,14 +236,14 @@
         readAmount = (long) fileLength;
     }
     if (fseek(mZipFp, seekStart, SEEK_SET) != 0) {
-        LOGD("Failure seeking to end of zip at %ld", (long) seekStart);
+        ALOGD("Failure seeking to end of zip at %ld", (long) seekStart);
         result = UNKNOWN_ERROR;
         goto bail;
     }
 
     /* read the last part of the file into the buffer */
     if (fread(buf, 1, readAmount, mZipFp) != (size_t) readAmount) {
-        LOGD("short file? wanted %ld\n", readAmount);
+        ALOGD("short file? wanted %ld\n", readAmount);
         result = UNKNOWN_ERROR;
         goto bail;
     }
@@ -258,7 +258,7 @@
         }
     }
     if (i < 0) {
-        LOGD("EOCD not found, not Zip\n");
+        ALOGD("EOCD not found, not Zip\n");
         result = INVALID_OPERATION;
         goto bail;
     }
@@ -266,7 +266,7 @@
     /* extract eocd values */
     result = mEOCD.readBuf(buf + i, readAmount - i);
     if (result != NO_ERROR) {
-        LOGD("Failure reading %ld bytes of EOCD values", readAmount - i);
+        ALOGD("Failure reading %ld bytes of EOCD values", readAmount - i);
         goto bail;
     }
     //mEOCD.dump();
@@ -274,7 +274,7 @@
     if (mEOCD.mDiskNumber != 0 || mEOCD.mDiskWithCentralDir != 0 ||
         mEOCD.mNumEntries != mEOCD.mTotalNumEntries)
     {
-        LOGD("Archive spanning not supported\n");
+        ALOGD("Archive spanning not supported\n");
         result = INVALID_OPERATION;
         goto bail;
     }
@@ -294,7 +294,7 @@
      * we're hoping to preserve.
      */
     if (fseek(mZipFp, mEOCD.mCentralDirOffset, SEEK_SET) != 0) {
-        LOGD("Failure seeking to central dir offset %ld\n",
+        ALOGD("Failure seeking to central dir offset %ld\n",
              mEOCD.mCentralDirOffset);
         result = UNKNOWN_ERROR;
         goto bail;
@@ -310,7 +310,7 @@
 
         result = pEntry->initFromCDE(mZipFp);
         if (result != NO_ERROR) {
-            LOGD("initFromCDE failed\n");
+            ALOGD("initFromCDE failed\n");
             delete pEntry;
             goto bail;
         }
@@ -325,12 +325,12 @@
     {
         unsigned char checkBuf[4];
         if (fread(checkBuf, 1, 4, mZipFp) != 4) {
-            LOGD("EOCD check read failed\n");
+            ALOGD("EOCD check read failed\n");
             result = INVALID_OPERATION;
             goto bail;
         }
         if (ZipEntry::getLongLE(checkBuf) != EndOfCentralDir::kSignature) {
-            LOGD("EOCD read check failed\n");
+            ALOGD("EOCD read check failed\n");
             result = UNKNOWN_ERROR;
             goto bail;
         }
@@ -416,7 +416,7 @@
             bool failed = false;
             result = compressFpToFp(mZipFp, inputFp, data, size, &crc);
             if (result != NO_ERROR) {
-                LOGD("compression failed, storing\n");
+                ALOGD("compression failed, storing\n");
                 failed = true;
             } else {
                 /*
@@ -427,7 +427,7 @@
                 long src = inputFp ? ftell(inputFp) : size;
                 long dst = ftell(mZipFp) - startPosn;
                 if (dst + (dst / 10) > src) {
-                    LOGD("insufficient compression (src=%ld dst=%ld), storing\n",
+                    ALOGD("insufficient compression (src=%ld dst=%ld), storing\n",
                         src, dst);
                     failed = true;
                 }
@@ -449,7 +449,7 @@
             }
             if (result != NO_ERROR) {
                 // don't need to truncate; happens in CDE rewrite
-                LOGD("failed copying data in\n");
+                ALOGD("failed copying data in\n");
                 goto bail;
             }
         }
@@ -468,14 +468,14 @@
         scanResult = ZipUtils::examineGzip(inputFp, &method, &uncompressedLen,
                         &compressedLen, &crc);
         if (!scanResult || method != ZipEntry::kCompressDeflated) {
-            LOGD("this isn't a deflated gzip file?");
+            ALOGD("this isn't a deflated gzip file?");
             result = UNKNOWN_ERROR;
             goto bail;
         }
 
         result = copyPartialFpToFp(mZipFp, inputFp, compressedLen, NULL);
         if (result != NO_ERROR) {
-            LOGD("failed copying gzip data in\n");
+            ALOGD("failed copying gzip data in\n");
             goto bail;
         }
     } else {
@@ -660,7 +660,7 @@
         *pCRC32 = crc32(*pCRC32, tmpBuf, count);
 
         if (fwrite(tmpBuf, 1, count, dstFp) != count) {
-            LOGD("fwrite %d bytes failed\n", (int) count);
+            ALOGD("fwrite %d bytes failed\n", (int) count);
             return UNKNOWN_ERROR;
         }
     }
@@ -682,7 +682,7 @@
     if (size > 0) {
         *pCRC32 = crc32(*pCRC32, (const unsigned char*)data, size);
         if (fwrite(data, 1, size, dstFp) != size) {
-            LOGD("fwrite %d bytes failed\n", (int) size);
+            ALOGD("fwrite %d bytes failed\n", (int) size);
             return UNKNOWN_ERROR;
         }
     }
@@ -716,7 +716,7 @@
 
         count = fread(tmpBuf, 1, readSize, srcFp);
         if ((long) count != readSize) {     // error or unexpected EOF
-            LOGD("fread %d bytes failed\n", (int) readSize);
+            ALOGD("fread %d bytes failed\n", (int) readSize);
             return UNKNOWN_ERROR;
         }
 
@@ -724,7 +724,7 @@
             *pCRC32 = crc32(*pCRC32, tmpBuf, count);
 
         if (fwrite(tmpBuf, 1, count, dstFp) != count) {
-            LOGD("fwrite %d bytes failed\n", (int) count);
+            ALOGD("fwrite %d bytes failed\n", (int) count);
             return UNKNOWN_ERROR;
         }
 
@@ -783,7 +783,7 @@
             LOGE("Installed zlib is not compatible with linked version (%s)\n",
                 ZLIB_VERSION);
         } else {
-            LOGD("Call to deflateInit2 failed (zerr=%d)\n", zerr);
+            ALOGD("Call to deflateInit2 failed (zerr=%d)\n", zerr);
         }
         goto bail;
     }
@@ -808,7 +808,7 @@
             } else {
                 getSize = fread(inBuf, 1, kBufSize, srcFp);
                 if (ferror(srcFp)) {
-                    LOGD("deflate read failed (errno=%d)\n", errno);
+                    ALOGD("deflate read failed (errno=%d)\n", errno);
                     goto z_bail;
                 }
             }
@@ -831,7 +831,7 @@
 
         zerr = deflate(&zstream, flush);
         if (zerr != Z_OK && zerr != Z_STREAM_END) {
-            LOGD("zlib deflate call failed (zerr=%d)\n", zerr);
+            ALOGD("zlib deflate call failed (zerr=%d)\n", zerr);
             result = UNKNOWN_ERROR;
             goto z_bail;
         }
@@ -844,7 +844,7 @@
             if (fwrite(outBuf, 1, zstream.next_out - outBuf, dstFp) !=
                 (size_t)(zstream.next_out - outBuf))
             {
-                LOGD("write %d failed in deflate\n",
+                ALOGD("write %d failed in deflate\n",
                     (int) (zstream.next_out - outBuf));
                 goto z_bail;
             }
@@ -1061,23 +1061,23 @@
                 getSize = n;
 
             if (fseek(fp, (long) src, SEEK_SET) != 0) {
-                LOGD("filemove src seek %ld failed\n", (long) src);
+                ALOGD("filemove src seek %ld failed\n", (long) src);
                 return UNKNOWN_ERROR;
             }
 
             if (fread(readBuf, 1, getSize, fp) != getSize) {
-                LOGD("filemove read %ld off=%ld failed\n",
+                ALOGD("filemove read %ld off=%ld failed\n",
                     (long) getSize, (long) src);
                 return UNKNOWN_ERROR;
             }
 
             if (fseek(fp, (long) dst, SEEK_SET) != 0) {
-                LOGD("filemove dst seek %ld failed\n", (long) dst);
+                ALOGD("filemove dst seek %ld failed\n", (long) dst);
                 return UNKNOWN_ERROR;
             }
 
             if (fwrite(readBuf, 1, getSize, fp) != getSize) {
-                LOGD("filemove write %ld off=%ld failed\n",
+                ALOGD("filemove write %ld off=%ld failed\n",
                     (long) getSize, (long) dst);
                 return UNKNOWN_ERROR;
             }
@@ -1104,7 +1104,7 @@
     struct stat sb;
 
     if (fstat(fd, &sb) < 0) {
-        LOGD("HEY: fstat on fd %d failed\n", fd);
+        ALOGD("HEY: fstat on fd %d failed\n", fd);
         return (time_t) -1;
     }
 
@@ -1129,7 +1129,7 @@
     int fd;
     fd = dup(fileno(mZipFp));
     if (fd < 0) {
-        LOGD("didn't work, errno=%d\n", errno);
+        ALOGD("didn't work, errno=%d\n", errno);
     }
 
     return fd;
@@ -1224,7 +1224,7 @@
 
     if (len < kEOCDLen) {
         /* looks like ZIP file got truncated */
-        LOGD(" Zip EOCD: expected >= %d bytes, found %d\n",
+        ALOGD(" Zip EOCD: expected >= %d bytes, found %d\n",
             kEOCDLen, len);
         return INVALID_OPERATION;
     }
@@ -1245,7 +1245,7 @@
 
     if (mCommentLen > 0) {
         if (kEOCDLen + mCommentLen > len) {
-            LOGD("EOCD(%d) + comment(%d) exceeds len (%d)\n",
+            ALOGD("EOCD(%d) + comment(%d) exceeds len (%d)\n",
                 kEOCDLen, mCommentLen, len);
             return UNKNOWN_ERROR;
         }
@@ -1288,10 +1288,10 @@
  */
 void ZipFile::EndOfCentralDir::dump(void) const
 {
-    LOGD(" EndOfCentralDir contents:\n");
-    LOGD("  diskNum=%u diskWCD=%u numEnt=%u totalNumEnt=%u\n",
+    ALOGD(" EndOfCentralDir contents:\n");
+    ALOGD("  diskNum=%u diskWCD=%u numEnt=%u totalNumEnt=%u\n",
         mDiskNumber, mDiskWithCentralDir, mNumEntries, mTotalNumEntries);
-    LOGD("  centDirSize=%lu centDirOff=%lu commentLen=%u\n",
+    ALOGD("  centDirSize=%lu centDirOff=%lu commentLen=%u\n",
         mCentralDirSize, mCentralDirOffset, mCommentLen);
 }
 
diff --git a/voip/jni/rtp/AudioGroup.cpp b/voip/jni/rtp/AudioGroup.cpp
index 6f8a232..270b494 100644
--- a/voip/jni/rtp/AudioGroup.cpp
+++ b/voip/jni/rtp/AudioGroup.cpp
@@ -159,7 +159,7 @@
     close(mSocket);
     delete mCodec;
     delete [] mBuffer;
-    LOGD("stream[%d] is dead", mSocket);
+    ALOGD("stream[%d] is dead", mSocket);
 }
 
 bool AudioStream::set(int mode, int socket, sockaddr_storage *remote,
@@ -218,7 +218,7 @@
         }
     }
 
-    LOGD("stream[%d] is configured as %s %dkHz %dms mode %d", mSocket,
+    ALOGD("stream[%d] is configured as %s %dkHz %dms mode %d", mSocket,
         (codec ? codec->name : "RAW"), mSampleRate, mInterval, mMode);
     return true;
 }
@@ -566,7 +566,7 @@
         delete mChain;
         mChain = next;
     }
-    LOGD("group[%d] is dead", mDeviceSocket);
+    ALOGD("group[%d] is dead", mDeviceSocket);
 }
 
 bool AudioGroup::set(int sampleRate, int sampleCount)
@@ -616,7 +616,7 @@
     }
 
     // Anything else?
-    LOGD("stream[%d] joins group[%d]", pair[1], pair[0]);
+    ALOGD("stream[%d] joins group[%d]", pair[1], pair[0]);
     return true;
 }
 
@@ -639,7 +639,7 @@
     }
 
     mDeviceThread->requestExitAndWait();
-    LOGD("group[%d] switches from mode %d to %d", mDeviceSocket, mMode, mode);
+    ALOGD("group[%d] switches from mode %d to %d", mDeviceSocket, mMode, mode);
     mMode = mode;
     return (mode == ON_HOLD) || mDeviceThread->start();
 }
@@ -687,7 +687,7 @@
         return false;
     }
 
-    LOGD("stream[%d] joins group[%d]", stream->mSocket, mDeviceSocket);
+    ALOGD("stream[%d] joins group[%d]", stream->mSocket, mDeviceSocket);
     return true;
 }
 
@@ -703,7 +703,7 @@
                 return false;
             }
             stream->mNext = target->mNext;
-            LOGD("stream[%d] leaves group[%d]", socket, mDeviceSocket);
+            ALOGD("stream[%d] leaves group[%d]", socket, mDeviceSocket);
             delete target;
             break;
         }
@@ -795,7 +795,7 @@
         LOGE("cannot compute frame count");
         return false;
     }
-    LOGD("reported frame count: output %d, input %d", output, input);
+    ALOGD("reported frame count: output %d, input %d", output, input);
 
     if (output < sampleCount * 2) {
         output = sampleCount * 2;
@@ -803,7 +803,7 @@
     if (input < sampleCount * 2) {
         input = sampleCount * 2;
     }
-    LOGD("adjusted frame count: output %d, input %d", output, input);
+    ALOGD("adjusted frame count: output %d, input %d", output, input);
 
     // Initialize AudioTrack and AudioRecord.
     AudioTrack track;
@@ -815,7 +815,7 @@
         LOGE("cannot initialize audio device");
         return false;
     }
-    LOGD("latency: output %d, input %d", track.latency(), record.latency());
+    ALOGD("latency: output %d, input %d", track.latency(), record.latency());
 
     // Give device socket a reasonable buffer size.
     setsockopt(deviceSocket, SOL_SOCKET, SO_RCVBUF, &output, sizeof(output));