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