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/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");