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

Bug: 5449033
Change-Id: I9244d927f14c750cd359ebffb1fc1c355a755d5a
diff --git a/include/cutils/log.h b/include/cutils/log.h
index 0e63809..0a011fe 100644
--- a/include/cutils/log.h
+++ b/include/cutils/log.h
@@ -97,12 +97,12 @@
 /*
  * Simplified macro to send a debug log message using the current LOG_TAG.
  */
-#ifndef LOGD
-#define LOGD(...) ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__))
+#ifndef ALOGD
+#define ALOGD(...) ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__))
 #endif
 
-#ifndef LOGD_IF
-#define LOGD_IF(cond, ...) \
+#ifndef ALOGD_IF
+#define ALOGD_IF(cond, ...) \
     ( (CONDITION(cond)) \
     ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
     : (void)0 )
@@ -168,8 +168,8 @@
  * Conditional based on whether the current LOG_TAG is enabled at
  * debug priority.
  */
-#ifndef IF_LOGD
-#define IF_LOGD() IF_ALOG(LOG_DEBUG, LOG_TAG)
+#ifndef IF_ALOGD
+#define IF_ALOGD() IF_ALOG(LOG_DEBUG, LOG_TAG)
 #endif
 
 /*
diff --git a/libcutils/buffer.c b/libcutils/buffer.c
index f34b8f8..af99bd7 100644
--- a/libcutils/buffer.c
+++ b/libcutils/buffer.c
@@ -104,9 +104,9 @@
     if (bytesWritten >= 0) {
         buffer->remaining -= bytesWritten;
 
-        LOGD("Buffer bytes written: %d", (int) bytesWritten);
-        LOGD("Buffer size: %d", (int) buffer->size);
-        LOGD("Buffer remaining: %d", (int) buffer->remaining);        
+        ALOGD("Buffer bytes written: %d", (int) bytesWritten);
+        ALOGD("Buffer size: %d", (int) buffer->size);
+        ALOGD("Buffer remaining: %d", (int) buffer->remaining);
 
         return buffer->remaining;
     }
diff --git a/libcutils/loghack.h b/libcutils/loghack.h
index 52dfc8c..e35f887 100644
--- a/libcutils/loghack.h
+++ b/libcutils/loghack.h
@@ -28,7 +28,7 @@
 #define ALOG(level, ...) \
         ((void)printf("cutils:" level "/" LOG_TAG ": " __VA_ARGS__))
 #define ALOGV(...)   ALOG("V", __VA_ARGS__)
-#define LOGD(...)   ALOG("D", __VA_ARGS__)
+#define ALOGD(...)   ALOG("D", __VA_ARGS__)
 #define LOGI(...)   ALOG("I", __VA_ARGS__)
 #define LOGW(...)   ALOG("W", __VA_ARGS__)
 #define LOGE(...)   ALOG("E", __VA_ARGS__)
diff --git a/libcutils/mq.c b/libcutils/mq.c
index 3b65f1f..65af198 100644
--- a/libcutils/mq.c
+++ b/libcutils/mq.c
@@ -263,7 +263,7 @@
 
 /** Frees a simple, i.e. header-only, outgoing packet. */
 static void outgoingPacketFree(OutgoingPacket* packet) {
-    LOGD("Freeing outgoing packet.");
+    ALOGD("Freeing outgoing packet.");
 	free(packet);
 }
 
@@ -435,7 +435,7 @@
         // Log interruptions but otherwise ignore them.
         LOGW("%s() interrupted.", functionName);
     } else if (errno == EAGAIN) {
-    	LOGD("EWOULDBLOCK");
+        ALOGD("EWOULDBLOCK");
         // Ignore.
     } else {
         LOGW("Error returned by %s().", functionName);
@@ -461,7 +461,7 @@
 static void peerProxyWriteBytes(PeerProxy* peerProxy) {	
 	Buffer* buffer = peerProxy->currentPacket->bytes;
 	if (peerProxyWriteFromBuffer(peerProxy, buffer)) {
-        LOGD("Bytes written.");
+        ALOGD("Bytes written.");
         peerProxyNextPacket(peerProxy);
     }    
 }
@@ -527,10 +527,10 @@
     Buffer* outgoingHeader = &peerProxy->outgoingHeader;
     bool headerWritten = bufferWriteComplete(outgoingHeader);
     if (!headerWritten) {
-        LOGD("Writing header...");
+        ALOGD("Writing header...");
         headerWritten = peerProxyWriteFromBuffer(peerProxy, outgoingHeader);
         if (headerWritten) {
-            LOGD("Header written.");
+            ALOGD("Header written.");
         }
     }    
 
@@ -559,7 +559,7 @@
  * Sets up a peer proxy's fd before we try to select() it.
  */
 static void peerProxyBeforeSelect(SelectableFd* fd) {
-    LOGD("Before select...");
+    ALOGD("Before select...");
 
     PeerProxy* peerProxy = (PeerProxy*) fd->data;
   
@@ -568,7 +568,7 @@
     peerUnlock(peerProxy->peer);
     
     if (hasPackets) {
-        LOGD("Packets found. Setting onWritable().");
+        ALOGD("Packets found. Setting onWritable().");
             
         fd->onWritable = &peerProxyWrite;
     } else {
@@ -579,9 +579,9 @@
 
 /** Prepare to read bytes from the peer. */
 static void peerProxyExpectBytes(PeerProxy* peerProxy, Header* header) {
-	LOGD("Expecting %d bytes.", header->size);
-	
-	peerProxy->inputState = READING_BYTES;
+    ALOGD("Expecting %d bytes.", header->size);
+
+    peerProxy->inputState = READING_BYTES;
     if (bufferPrepareForRead(peerProxy->inputBuffer, header->size) == -1) {
         LOGW("Couldn't allocate memory for incoming data. Size: %u",
                 (unsigned int) header->size);    
@@ -963,23 +963,23 @@
  * Reads input from a peer process.
  */
 static void peerProxyRead(SelectableFd* fd) {
-    LOGD("Reading...");
+    ALOGD("Reading...");
     PeerProxy* peerProxy = (PeerProxy*) fd->data;
     int state = peerProxy->inputState;
     Buffer* in = peerProxy->inputBuffer;
     switch (state) {
         case READING_HEADER:
             if (peerProxyBufferInput(peerProxy)) {
-                LOGD("Header read.");
+                ALOGD("Header read.");
                 // We've read the complete header.
                 Header* header = (Header*) in->data;
                 peerProxyHandleHeader(peerProxy, header);
             }
             break;
         case READING_BYTES:
-            LOGD("Reading bytes...");
+            ALOGD("Reading bytes...");
             if (peerProxyBufferInput(peerProxy)) {
-                LOGD("Bytes read.");
+                ALOGD("Bytes read.");
                 // We have the complete packet. Notify bytes listener.
                 peerProxy->peer->onBytes(peerProxy->credentials,
                     in->data, in->size);
@@ -1030,7 +1030,7 @@
         return;
     }
     
-    LOGD("Accepted connection as fd %d.", socket);
+    ALOGD("Accepted connection as fd %d.", socket);
     
     // Get credentials.
     Credentials credentials;
@@ -1118,7 +1118,7 @@
 
 /** Frees a packet of bytes. */
 static void outgoingPacketFreeBytes(OutgoingPacket* packet) {
-    LOGD("Freeing outgoing packet.");
+    ALOGD("Freeing outgoing packet.");
     bufferFree(packet->bytes);
     free(packet);
 }
@@ -1270,7 +1270,7 @@
         LOG_ALWAYS_FATAL("bind() error: %s", strerror(errno));
     }
 
-    LOGD("Listener socket: %d",  listenerSocket);   
+    ALOGD("Listener socket: %d",  listenerSocket);
     
     // Queue up to 16 connections.
     result = listen(listenerSocket, 16);
diff --git a/libcutils/selector.c b/libcutils/selector.c
index 9436393..9aef5fa 100644
--- a/libcutils/selector.c
+++ b/libcutils/selector.c
@@ -96,7 +96,7 @@
         LOG_ALWAYS_FATAL("pipe() error: %s", strerror(errno));
     }
     
-    LOGD("Wakeup fd: %d", selector->wakeupPipe[0]);
+    ALOGD("Wakeup fd: %d", selector->wakeupPipe[0]);
     
     SelectableFd* wakeupFd = selectorAdd(selector, selector->wakeupPipe[0]);
     if (wakeupFd == NULL) {
@@ -169,11 +169,11 @@
             
             bool inSet = false;
             if (maybeAdd(selectableFd, selectableFd->onExcept, exceptFds)) {
-            	LOGD("Selecting fd %d for writing...", selectableFd->fd);
+                ALOGD("Selecting fd %d for writing...", selectableFd->fd);
                 inSet = true;
             }
             if (maybeAdd(selectableFd, selectableFd->onReadable, readFds)) {
-            	LOGD("Selecting fd %d for reading...", selectableFd->fd);
+                ALOGD("Selecting fd %d for reading...", selectableFd->fd);
                 inSet = true;
             }
             if (maybeAdd(selectableFd, selectableFd->onWritable, writeFds)) {
@@ -200,9 +200,9 @@
  */
 static inline void maybeInvoke(SelectableFd* selectableFd,
         void (*callback)(SelectableFd*), fd_set* fdSet) {
-	if (callback != NULL && !selectableFd->remove && 
+    if (callback != NULL && !selectableFd->remove && 
             FD_ISSET(selectableFd->fd, fdSet)) {
-		LOGD("Selected fd %d.", selectableFd->fd);
+        ALOGD("Selected fd %d.", selectableFd->fd);
         callback(selectableFd);
     }
 }
@@ -238,13 +238,13 @@
         
         prepareForSelect(selector);
 
-        LOGD("Entering select().");
+        ALOGD("Entering select().");
         
         // Select file descriptors.
         int result = select(selector->maxFd + 1, &selector->readFds, 
                 &selector->writeFds, &selector->exceptFds, NULL);
         
-        LOGD("Exiting select().");
+        ALOGD("Exiting select().");
         
         setInSelect(selector, false);
         
diff --git a/libnetutils/dhcpclient.c b/libnetutils/dhcpclient.c
index 4f2d1c1..b38e258 100644
--- a/libnetutils/dhcpclient.c
+++ b/libnetutils/dhcpclient.c
@@ -70,7 +70,7 @@
     vsnprintf(errmsg, sizeof(errmsg), fmt, ap);
     va_end(ap);
 
-    LOGD("%s", errmsg);
+    ALOGD("%s", errmsg);
 }
 
 const char *dhcp_lasterror()
@@ -151,14 +151,14 @@
 void dump_dhcp_info(dhcp_info *info)
 {
     char addr[20], gway[20], mask[20];
-    LOGD("--- dhcp %s (%d) ---",
+    ALOGD("--- dhcp %s (%d) ---",
             dhcp_type_to_name(info->type), info->type);
     strcpy(addr, ipaddr(info->ipaddr));
     strcpy(gway, ipaddr(info->gateway));
-    LOGD("ip %s gw %s prefixLength %d", addr, gway, info->prefixLength);
-    if (info->dns1) LOGD("dns1: %s", ipaddr(info->dns1));
-    if (info->dns2) LOGD("dns2: %s", ipaddr(info->dns2));
-    LOGD("server %s, lease %d seconds",
+    ALOGD("ip %s gw %s prefixLength %d", addr, gway, info->prefixLength);
+    if (info->dns1) ALOGD("dns1: %s", ipaddr(info->dns1));
+    if (info->dns2) ALOGD("dns2: %s", ipaddr(info->dns2));
+    ALOGD("server %s, lease %d seconds",
             ipaddr(info->serveraddr), info->lease);
 }
 
@@ -250,9 +250,9 @@
     const char *name;
     char buf[2048];
 
-    LOGD("===== DHCP message:");
+    ALOGD("===== DHCP message:");
     if (len < DHCP_MSG_FIXED_SIZE) {
-        LOGD("Invalid length %d, should be %d", len, DHCP_MSG_FIXED_SIZE);
+        ALOGD("Invalid length %d, should be %d", len, DHCP_MSG_FIXED_SIZE);
         return;
     }
 
@@ -264,18 +264,18 @@
         name = "BOOTREPLY";
     else
         name = "????";
-    LOGD("op = %s (%d), htype = %d, hlen = %d, hops = %d",
+    ALOGD("op = %s (%d), htype = %d, hlen = %d, hops = %d",
            name, msg->op, msg->htype, msg->hlen, msg->hops);
-    LOGD("xid = 0x%08x secs = %d, flags = 0x%04x optlen = %d",
+    ALOGD("xid = 0x%08x secs = %d, flags = 0x%04x optlen = %d",
            ntohl(msg->xid), ntohs(msg->secs), ntohs(msg->flags), len);
-    LOGD("ciaddr = %s", ipaddr(msg->ciaddr));
-    LOGD("yiaddr = %s", ipaddr(msg->yiaddr));
-    LOGD("siaddr = %s", ipaddr(msg->siaddr));
-    LOGD("giaddr = %s", ipaddr(msg->giaddr));
+    ALOGD("ciaddr = %s", ipaddr(msg->ciaddr));
+    ALOGD("yiaddr = %s", ipaddr(msg->yiaddr));
+    ALOGD("siaddr = %s", ipaddr(msg->siaddr));
+    ALOGD("giaddr = %s", ipaddr(msg->giaddr));
 
     c = msg->hlen > 16 ? 16 : msg->hlen;
     hex2str(buf, msg->chaddr, c);
-    LOGD("chaddr = {%s}", buf);
+    ALOGD("chaddr = {%s}", buf);
 
     for (n = 0; n < 64; n++) {
         if ((msg->sname[n] < ' ') || (msg->sname[n] > 127)) {
@@ -293,8 +293,8 @@
     }
     msg->file[127] = 0;
 
-    LOGD("sname = '%s'", msg->sname);
-    LOGD("file = '%s'", msg->file);
+    ALOGD("sname = '%s'", msg->sname);
+    ALOGD("file = '%s'", msg->file);
 
     if (len < 4) return;
     len -= 4;
@@ -327,7 +327,7 @@
             name = dhcp_type_to_name(x[2]);
         else
             name = NULL;
-        LOGD("op %d len %d {%s} %s", x[0], optsz, buf, name == NULL ? "" : name);
+        ALOGD("op %d len %d {%s} %s", x[0], optsz, buf, name == NULL ? "" : name);
         len -= optsz;
         x = x + optsz + 2;
     }
@@ -347,28 +347,28 @@
 static int is_valid_reply(dhcp_msg *msg, dhcp_msg *reply, int sz)
 {
     if (sz < DHCP_MSG_FIXED_SIZE) {
-        if (verbose) LOGD("netcfg: Wrong size %d != %d\n", sz, DHCP_MSG_FIXED_SIZE);
+        if (verbose) ALOGD("netcfg: Wrong size %d != %d\n", sz, DHCP_MSG_FIXED_SIZE);
         return 0;
     }
     if (reply->op != OP_BOOTREPLY) {
-        if (verbose) LOGD("netcfg: Wrong Op %d != %d\n", reply->op, OP_BOOTREPLY);
+        if (verbose) ALOGD("netcfg: Wrong Op %d != %d\n", reply->op, OP_BOOTREPLY);
         return 0;
     }
     if (reply->xid != msg->xid) {
-        if (verbose) LOGD("netcfg: Wrong Xid 0x%x != 0x%x\n", ntohl(reply->xid),
+        if (verbose) ALOGD("netcfg: Wrong Xid 0x%x != 0x%x\n", ntohl(reply->xid),
                           ntohl(msg->xid));
         return 0;
     }
     if (reply->htype != msg->htype) {
-        if (verbose) LOGD("netcfg: Wrong Htype %d != %d\n", reply->htype, msg->htype);
+        if (verbose) ALOGD("netcfg: Wrong Htype %d != %d\n", reply->htype, msg->htype);
         return 0;
     }
     if (reply->hlen != msg->hlen) {
-        if (verbose) LOGD("netcfg: Wrong Hlen %d != %d\n", reply->hlen, msg->hlen);
+        if (verbose) ALOGD("netcfg: Wrong Hlen %d != %d\n", reply->hlen, msg->hlen);
         return 0;
     }
     if (memcmp(msg->chaddr, reply->chaddr, msg->hlen)) {
-        if (verbose) LOGD("netcfg: Wrong chaddr %x != %x\n", *(reply->chaddr),*(msg->chaddr));
+        if (verbose) ALOGD("netcfg: Wrong chaddr %x != %x\n", *(reply->chaddr),*(msg->chaddr));
         return 0;
     }
     return 1;
@@ -469,7 +469,7 @@
         r = receive_packet(s, &reply);
         if (r < 0) {
             if (errno != 0) {
-                LOGD("receive_packet failed (%d): %s", r, strerror(errno));
+                ALOGD("receive_packet failed (%d): %s", r, strerror(errno));
                 if (errno == ENETDOWN || errno == ENXIO) {
                     return -1;
                 }
diff --git a/libnetutils/ifc_utils.c b/libnetutils/ifc_utils.c
index 0a2f760..f08a14d 100644
--- a/libnetutils/ifc_utils.c
+++ b/libnetutils/ifc_utils.c
@@ -46,7 +46,7 @@
 #else
 #include <stdio.h>
 #include <string.h>
-#define LOGD printf
+#define ALOGD printf
 #define LOGW printf
 #endif
 
@@ -686,7 +686,7 @@
         init_sockaddr_in(&rt.rt_genmask, mask);
         addr.s_addr = dest;
         if (ioctl(ifc_ctl_sock, SIOCDELRT, &rt) < 0) {
-            LOGD("failed to remove route for %s to %s: %s",
+            ALOGD("failed to remove route for %s to %s: %s",
                  ifname, inet_ntoa(addr), strerror(errno));
         }
     }
@@ -752,7 +752,7 @@
     ifc_init();
     addr.s_addr = gateway;
     if ((result = ifc_create_default_route(ifname, gateway)) < 0) {
-        LOGD("failed to add %s as default route for %s: %s",
+        ALOGD("failed to add %s as default route for %s: %s",
              inet_ntoa(addr), ifname, strerror(errno));
     }
     ifc_close();
@@ -773,7 +773,7 @@
     rt.rt_flags = RTF_UP|RTF_GATEWAY;
     init_sockaddr_in(&rt.rt_dst, 0);
     if ((result = ioctl(ifc_ctl_sock, SIOCDELRT, &rt)) < 0) {
-        LOGD("failed to remove default route for %s: %s", ifname, strerror(errno));
+        ALOGD("failed to remove default route for %s: %s", ifname, strerror(errno));
     }
     ifc_close();
     return result;
diff --git a/libnetutils/packet.c b/libnetutils/packet.c
index 9388345..f9112b5 100644
--- a/libnetutils/packet.c
+++ b/libnetutils/packet.c
@@ -31,7 +31,7 @@
 #else
 #include <stdio.h>
 #include <string.h>
-#define LOGD printf
+#define ALOGD printf
 #define LOGW printf
 #endif
 
@@ -179,23 +179,23 @@
     is_valid = 0;
     if (nread < (int)(sizeof(struct iphdr) + sizeof(struct udphdr))) {
 #if VERBOSE
-        LOGD("Packet is too small (%d) to be a UDP datagram", nread);
+        ALOGD("Packet is too small (%d) to be a UDP datagram", nread);
 #endif
     } else if (packet.ip.version != IPVERSION || packet.ip.ihl != (sizeof(packet.ip) >> 2)) {
 #if VERBOSE
-        LOGD("Not a valid IP packet");
+        ALOGD("Not a valid IP packet");
 #endif
     } else if (nread < ntohs(packet.ip.tot_len)) {
 #if VERBOSE
-        LOGD("Packet was truncated (read %d, needed %d)", nread, ntohs(packet.ip.tot_len));
+        ALOGD("Packet was truncated (read %d, needed %d)", nread, ntohs(packet.ip.tot_len));
 #endif
     } else if (packet.ip.protocol != IPPROTO_UDP) {
 #if VERBOSE
-        LOGD("IP protocol (%d) is not UDP", packet.ip.protocol);
+        ALOGD("IP protocol (%d) is not UDP", packet.ip.protocol);
 #endif
     } else if (packet.udp.dest != htons(PORT_BOOTP_CLIENT)) {
 #if VERBOSE
-        LOGD("UDP dest port (%d) is not DHCP client", ntohs(packet.udp.dest));
+        ALOGD("UDP dest port (%d) is not DHCP client", ntohs(packet.udp.dest));
 #endif
     } else {
         is_valid = 1;
diff --git a/libpixelflinger/trap.cpp b/libpixelflinger/trap.cpp
index 30b633f..853117c 100644
--- a/libpixelflinger/trap.cpp
+++ b/libpixelflinger/trap.cpp
@@ -94,15 +94,15 @@
 static void
 triangle_dump_points( const GGLcoord*  v0,
                       const GGLcoord*  v1,
-				 	  const GGLcoord*  v2 )
+                      const GGLcoord*  v2 )
 {
     float tri = 1.0f / TRI_ONE;
-  LOGD(     "  P0=(%.3f, %.3f)  [%08x, %08x]\n"
-            "  P1=(%.3f, %.3f)  [%08x, %08x]\n"
-            "  P2=(%.3f, %.3f)  [%08x, %08x]\n",
-		v0[0]*tri, v0[1]*tri, v0[0], v0[1],
-		v1[0]*tri, v1[1]*tri, v1[0], v1[1],
-		v2[0]*tri, v2[1]*tri, v2[0], v2[1] );
+    ALOGD("  P0=(%.3f, %.3f)  [%08x, %08x]\n"
+          "  P1=(%.3f, %.3f)  [%08x, %08x]\n"
+          "  P2=(%.3f, %.3f)  [%08x, %08x]\n",
+          v0[0]*tri, v0[1]*tri, v0[0], v0[1],
+          v1[0]*tri, v1[1]*tri, v1[0], v1[1],
+          v2[0]*tri, v2[1]*tri, v2[0], v2[1] );
 }
 
 // ----------------------------------------------------------------------------
@@ -835,7 +835,7 @@
     float tri  = 1.0f / TRI_ONE;
     float iter = 1.0f / (1<<TRI_ITERATORS_BITS);
     float fix  = 1.0f / FIXED_ONE;
-    LOGD(   "x=%08x (%.3f), "
+    ALOGD(   "x=%08x (%.3f), "
             "x_incr=%08x (%.3f), y_incr=%08x (%.3f), "
             "y_top=%08x (%.3f), y_bot=%08x (%.3f) ",
         x, x*fix,
diff --git a/libusbhost/usbhost.c b/libusbhost/usbhost.c
index b1c967d..5d261cd 100644
--- a/libusbhost/usbhost.c
+++ b/libusbhost/usbhost.c
@@ -20,7 +20,7 @@
 #ifdef USE_LIBLOG
 #define LOG_TAG "usbhost"
 #include "utils/Log.h"
-#define D LOGD
+#define D ALOGD
 #else
 #define D printf
 #endif
diff --git a/nexus/DhcpClient.cpp b/nexus/DhcpClient.cpp
index 713059d..71c2d8a 100644
--- a/nexus/DhcpClient.cpp
+++ b/nexus/DhcpClient.cpp
@@ -53,7 +53,7 @@
 }
 
 int DhcpClient::start(Controller *c) {
-    LOGD("Starting DHCP service (arp probe = %d)", mDoArpProbe);
+    ALOGD("Starting DHCP service (arp probe = %d)", mDoArpProbe);
     char svc[PROPERTY_VALUE_MAX];
     snprintf(svc,
              sizeof(svc),
diff --git a/nexus/NetworkManager.cpp b/nexus/NetworkManager.cpp
index e0df409..8ea36f8 100644
--- a/nexus/NetworkManager.cpp
+++ b/nexus/NetworkManager.cpp
@@ -107,7 +107,7 @@
 }
 
 void NetworkManager::onInterfaceConnected(Controller *c) {
-    LOGD("Controller %s interface %s connected", c->getName(), c->getBoundInterface());
+    ALOGD("Controller %s interface %s connected", c->getName(), c->getBoundInterface());
 
     if (mDhcp->start(c)) {
         LOGE("Failed to start DHCP (%s)", strerror(errno));
@@ -116,20 +116,20 @@
 }
 
 void NetworkManager::onInterfaceDisconnected(Controller *c) {
-    LOGD("Controller %s interface %s disconnected", c->getName(),
+    ALOGD("Controller %s interface %s disconnected", c->getName(),
          c->getBoundInterface());
 
     mDhcp->stop();
 }
 
 void NetworkManager::onControllerSuspending(Controller *c) {
-    LOGD("Controller %s interface %s suspending", c->getName(),
+    ALOGD("Controller %s interface %s suspending", c->getName(),
          c->getBoundInterface());
     mDhcp->stop();
 }
 
 void NetworkManager::onControllerResumed(Controller *c) {
-    LOGD("Controller %s interface %s resumed", c->getName(),
+    ALOGD("Controller %s interface %s resumed", c->getName(),
          c->getBoundInterface());
 }
 
@@ -137,7 +137,7 @@
     char tmp[255];
     char tmp2[255];
 
-    LOGD("onDhcpStateChanged(%s -> %s)",
+    ALOGD("onDhcpStateChanged(%s -> %s)",
          DhcpState::toString(mLastDhcpState, tmp, sizeof(tmp)),
          DhcpState::toString(state, tmp2, sizeof(tmp2)));
 
@@ -169,7 +169,7 @@
 
 void NetworkManager::onDhcpEvent(Controller *c, int evt) {
     char tmp[64];
-    LOGD("onDhcpEvent(%s)", DhcpEvent::toString(evt, tmp, sizeof(tmp)));
+    ALOGD("onDhcpEvent(%s)", DhcpEvent::toString(evt, tmp, sizeof(tmp)));
 }
 
 void NetworkManager::onDhcpLeaseUpdated(Controller *c, struct in_addr *addr,
diff --git a/nexus/PropertyManager.cpp b/nexus/PropertyManager.cpp
index 704b223..dbfb832 100644
--- a/nexus/PropertyManager.cpp
+++ b/nexus/PropertyManager.cpp
@@ -66,10 +66,10 @@
 int PropertyManager::attachProperty(const char *ns_name, Property *p) {
     PropertyNamespace *ns;
 
-    LOGD("Attaching property %s to namespace %s", p->getName(), ns_name);
+    ALOGD("Attaching property %s to namespace %s", p->getName(), ns_name);
     pthread_mutex_lock(&mLock);
     if (!(ns = lookupNamespace_UNLOCKED(ns_name))) {
-        LOGD("Creating namespace %s", ns_name);
+        ALOGD("Creating namespace %s", ns_name);
         ns = new PropertyNamespace(ns_name);
         mNamespaces->push_back(ns);
     }
@@ -90,7 +90,7 @@
 int PropertyManager::detachProperty(const char *ns_name, Property *p) {
     PropertyNamespace *ns;
 
-    LOGD("Detaching property %s from namespace %s", p->getName(), ns_name);
+    ALOGD("Detaching property %s from namespace %s", p->getName(), ns_name);
     pthread_mutex_lock(&mLock);
     if (!(ns = lookupNamespace_UNLOCKED(ns_name))) {
         pthread_mutex_unlock(&mLock);
@@ -193,7 +193,7 @@
 
 int PropertyManager::set(const char *name, const char *value) {
 
-    LOGD("set %s = '%s'", name, value);
+    ALOGD("set %s = '%s'", name, value);
     pthread_mutex_lock(&mLock);
     PropertyNamespaceCollection::iterator ns_it;
     for (ns_it = mNamespaces->begin(); ns_it != mNamespaces->end(); ++ns_it) {
diff --git a/nexus/Supplicant.cpp b/nexus/Supplicant.cpp
index 6aa36e8..9fa3b54 100644
--- a/nexus/Supplicant.cpp
+++ b/nexus/Supplicant.cpp
@@ -120,7 +120,7 @@
         return -1;
     }
 
-//    LOGD("sendCommand(): -> '%s'", cmd);
+//    ALOGD("sendCommand(): -> '%s'", cmd);
 
     int rc;
     memset(reply, 0, *reply_len);
@@ -133,7 +133,7 @@
         return -1;
     }
 
- //   LOGD("sendCommand(): <- '%s'", reply);
+ //   ALOGD("sendCommand(): <- '%s'", reply);
     return 0;
 }
 SupplicantStatus *Supplicant::getStatus() {
@@ -233,7 +233,7 @@
     }
 
 
-    LOGD("Networks added %d, refreshed %d, removed %d\n", 
+    ALOGD("Networks added %d, refreshed %d, removed %d\n",
          num_added, num_refreshed, num_removed);
     pthread_mutex_unlock(&mNetworksLock);
 
@@ -350,7 +350,7 @@
     char reply[64];
     size_t len = sizeof(reply);
 
-    LOGD("stopDriver()");
+    ALOGD("stopDriver()");
 
     if (sendCommand("DRIVER STOP", reply, &len)) {
         LOGW("Failed to stop driver (%s)", strerror(errno));
@@ -363,7 +363,7 @@
     char reply[64];
     size_t len = sizeof(reply);
 
-    LOGD("startDriver()");
+    ALOGD("startDriver()");
     if (sendCommand("DRIVER START", reply, &len)) {
         LOGW("Failed to start driver (%s)", strerror(errno));
         return -1;
@@ -496,7 +496,7 @@
     char reply[255];
     size_t len = sizeof(reply) -1;
 
-    LOGD("netid %d, var '%s' = '%s'", networkId, var, val);
+    ALOGD("netid %d, var '%s' = '%s'", networkId, var, val);
     char *tmp;
     asprintf(&tmp, "SET_NETWORK %d %s %s", networkId, var, val);
     if (sendCommand(tmp, reply, &len)) {
@@ -621,7 +621,7 @@
 int Supplicant::setApScanMode(int mode) {
     char req[64];
 
-//    LOGD("setApScanMode(%d)", mode);
+//    ALOGD("setApScanMode(%d)", mode);
     sprintf(req, "AP_SCAN %d", mode);
 
     char reply[16];
diff --git a/nexus/SupplicantListener.cpp b/nexus/SupplicantListener.cpp
index b91fc02..092f2d9 100644
--- a/nexus/SupplicantListener.cpp
+++ b/nexus/SupplicantListener.cpp
@@ -54,7 +54,7 @@
 
     buf[nread] = '\0';
     if (!rc && !nread) {
-        LOGD("Received EOF on supplicant socket\n");
+        ALOGD("Received EOF on supplicant socket\n");
         strncpy(buf, WPA_EVENT_TERMINATING " - signal 0 received", buflen-1);
         buf[buflen-1] = '\0';
         return false;
diff --git a/nexus/SupplicantStatus.cpp b/nexus/SupplicantStatus.cpp
index b3c560a..7868264 100644
--- a/nexus/SupplicantStatus.cpp
+++ b/nexus/SupplicantStatus.cpp
@@ -83,7 +83,7 @@
             else 
                 LOGE("Unknown supplicant state '%s'", value);
         } else
-            LOGD("Ignoring unsupported status token '%s'", token);
+            ALOGD("Ignoring unsupported status token '%s'", token);
     }
 
     return new SupplicantStatus(state, id, bssid, ssid);
diff --git a/nexus/TiwlanEventListener.cpp b/nexus/TiwlanEventListener.cpp
index 15e6930..16c63c1 100644
--- a/nexus/TiwlanEventListener.cpp
+++ b/nexus/TiwlanEventListener.cpp
@@ -45,13 +45,13 @@
     if (data->event_type == IPC_EVENT_LINK_SPEED) {
         uint32_t *spd = (uint32_t *) data->buffer;
         *spd /= 2;
-//        LOGD("Link speed = %u MB/s", *spd);
+//        ALOGD("Link speed = %u MB/s", *spd);
     } else if (data->event_type == IPC_EVENT_LOW_SNR) {
         LOGW("Low signal/noise ratio");
     } else if (data->event_type == IPC_EVENT_LOW_RSSI) {
         LOGW("Low RSSI");
     } else {
-//        LOGD("Dropping unhandled driver event %d", data->event_type);
+//        ALOGD("Dropping unhandled driver event %d", data->event_type);
     }
 
     // TODO: Tell WifiController about the event
diff --git a/nexus/TiwlanWifiController.cpp b/nexus/TiwlanWifiController.cpp
index 016c790..384f136 100644
--- a/nexus/TiwlanWifiController.cpp
+++ b/nexus/TiwlanWifiController.cpp
@@ -75,7 +75,7 @@
     while (count-- > 0) {
         if (property_get(DRIVER_PROP_NAME, driver_status, NULL)) {
             if (!strcmp(driver_status, "ok")) {
-                LOGD("Firmware loaded OK");
+                ALOGD("Firmware loaded OK");
 
                 if (startDriverEventListener()) {
                     LOGW("Failed to start driver event listener (%s)",
diff --git a/nexus/WifiController.cpp b/nexus/WifiController.cpp
index c218c30..1209d1f 100644
--- a/nexus/WifiController.cpp
+++ b/nexus/WifiController.cpp
@@ -204,26 +204,26 @@
         mHandlers->onControllerSuspending(this);
 
         char tmp[80];
-        LOGD("Suspending from supplicant state %s",
+        ALOGD("Suspending from supplicant state %s",
              SupplicantState::toString(mSupplicantState,
                                        tmp,
                                        sizeof(tmp)));
 
         if (mSupplicantState != SupplicantState::IDLE) {
-            LOGD("Forcing Supplicant disconnect");
+            ALOGD("Forcing Supplicant disconnect");
             if (mSupplicant->disconnect()) {
                 LOGW("Error disconnecting (%s)", strerror(errno));
             }
         }
 
-        LOGD("Stopping Supplicant driver");
+        ALOGD("Stopping Supplicant driver");
         if (mSupplicant->stopDriver()) {
             LOGE("Error stopping driver (%s)", strerror(errno));
             pthread_mutex_unlock(&mLock);
             return -1;
         }
     } else {
-        LOGD("Resuming");
+        ALOGD("Resuming");
 
         if (mSupplicant->startDriver()) {
             LOGE("Error resuming driver (%s)", strerror(errno));
@@ -241,7 +241,7 @@
 
     mSuspended = suspend;
     pthread_mutex_unlock(&mLock);
-    LOGD("Suspend / Resume completed");
+    ALOGD("Suspend / Resume completed");
     return 0;
 }
 
@@ -426,18 +426,18 @@
 }
 
 void WifiController::onAssociatingEvent(SupplicantAssociatingEvent *evt) {
-    LOGD("onAssociatingEvent(%s, %s, %d)",
+    ALOGD("onAssociatingEvent(%s, %s, %d)",
          (evt->getBssid() ? evt->getBssid() : "n/a"),
          (evt->getSsid() ? evt->getSsid() : "n/a"),
          evt->getFreq());
 }
 
 void WifiController::onAssociatedEvent(SupplicantAssociatedEvent *evt) {
-    LOGD("onAssociatedEvent(%s)", evt->getBssid());
+    ALOGD("onAssociatedEvent(%s)", evt->getBssid());
 }
 
 void WifiController::onConnectedEvent(SupplicantConnectedEvent *evt) {
-    LOGD("onConnectedEvent(%s, %d)", evt->getBssid(), evt->getReassociated());
+    ALOGD("onConnectedEvent(%s, %d)", evt->getBssid(), evt->getReassociated());
     SupplicantStatus *ss = mSupplicant->getStatus();
     WifiNetwork *wn;
 
@@ -530,7 +530,7 @@
     if (evt->getState() == mSupplicantState)
         return;
 
-    LOGD("onStateChangeEvent(%s -> %s)", 
+    ALOGD("onStateChangeEvent(%s -> %s)",
          SupplicantState::toString(mSupplicantState, tmp, sizeof(tmp)),
          SupplicantState::toString(evt->getState(), tmp2, sizeof(tmp2)));
 
@@ -559,7 +559,7 @@
 }
 
 void WifiController::onConnectionTimeoutEvent(SupplicantConnectionTimeoutEvent *evt) {
-    LOGD("onConnectionTimeoutEvent(%s)", evt->getBssid());
+    ALOGD("onConnectionTimeoutEvent(%s)", evt->getBssid());
 }
 
 void WifiController::onDisconnectedEvent(SupplicantDisconnectedEvent *evt) {
@@ -569,39 +569,39 @@
 
 #if 0
 void WifiController::onTerminatingEvent(SupplicantEvent *evt) {
-    LOGD("onTerminatingEvent(%s)", evt->getEvent());
+    ALOGD("onTerminatingEvent(%s)", evt->getEvent());
 }
 
 void WifiController::onPasswordChangedEvent(SupplicantEvent *evt) {
-    LOGD("onPasswordChangedEvent(%s)", evt->getEvent());
+    ALOGD("onPasswordChangedEvent(%s)", evt->getEvent());
 }
 
 void WifiController::onEapNotificationEvent(SupplicantEvent *evt) {
-    LOGD("onEapNotificationEvent(%s)", evt->getEvent());
+    ALOGD("onEapNotificationEvent(%s)", evt->getEvent());
 }
 
 void WifiController::onEapStartedEvent(SupplicantEvent *evt) {
-    LOGD("onEapStartedEvent(%s)", evt->getEvent());
+    ALOGD("onEapStartedEvent(%s)", evt->getEvent());
 }
 
 void WifiController::onEapMethodEvent(SupplicantEvent *evt) {
-    LOGD("onEapMethodEvent(%s)", evt->getEvent());
+    ALOGD("onEapMethodEvent(%s)", evt->getEvent());
 }
 
 void WifiController::onEapSuccessEvent(SupplicantEvent *evt) {
-    LOGD("onEapSuccessEvent(%s)", evt->getEvent());
+    ALOGD("onEapSuccessEvent(%s)", evt->getEvent());
 }
 
 void WifiController::onEapFailureEvent(SupplicantEvent *evt) {
-    LOGD("onEapFailureEvent(%s)", evt->getEvent());
+    ALOGD("onEapFailureEvent(%s)", evt->getEvent());
 }
 
 void WifiController::onLinkSpeedEvent(SupplicantEvent *evt) {
-    LOGD("onLinkSpeedEvent(%s)", evt->getEvent());
+    ALOGD("onLinkSpeedEvent(%s)", evt->getEvent());
 }
 
 void WifiController::onDriverStateEvent(SupplicantEvent *evt) {
-    LOGD("onDriverStateEvent(%s)", evt->getEvent());
+    ALOGD("onDriverStateEvent(%s)", evt->getEvent());
 }
 #endif
 
diff --git a/nexus/WifiNetwork.cpp b/nexus/WifiNetwork.cpp
index 6a0f684..92af0cb 100644
--- a/nexus/WifiNetwork.cpp
+++ b/nexus/WifiNetwork.cpp
@@ -51,7 +51,7 @@
     if (!(flags = strsep(&next, "\t")))
         LOGE("Failed to extract flags");
 
-   // LOGD("id '%s', ssid '%s', bssid '%s', flags '%s'", id, ssid, bssid,
+   // ALOGD("id '%s', ssid '%s', bssid '%s', flags '%s'", id, ssid, bssid,
    //      flags ? flags :"null");
 
     if (id)
@@ -511,7 +511,7 @@
     char *v_next = v_tmp;
     char *v_token;
 
-//    LOGD("parseKeyManagementMask(%s)", buffer);
+//    ALOGD("parseKeyManagementMask(%s)", buffer);
     *mask = 0;
 
     while((v_token = strsep(&v_next, " "))) {
@@ -548,7 +548,7 @@
     char *v_next = v_tmp;
     char *v_token;
 
-//    LOGD("parseProtocolsMask(%s)", buffer);
+//    ALOGD("parseProtocolsMask(%s)", buffer);
     *mask = 0;
     while((v_token = strsep(&v_next, " "))) {
         if (!strcasecmp(v_token, "WPA"))
@@ -573,7 +573,7 @@
     char *v_next = v_tmp;
     char *v_token;
 
-//    LOGD("parseAuthAlgorithmsMask(%s)", buffer);
+//    ALOGD("parseAuthAlgorithmsMask(%s)", buffer);
 
     *mask = 0;
     if (buffer[0] == '\0')
@@ -603,7 +603,7 @@
     char *v_next = v_tmp;
     char *v_token;
 
-//    LOGD("parsePairwiseCiphersMask(%s)", buffer);
+//    ALOGD("parsePairwiseCiphersMask(%s)", buffer);
 
     *mask = 0;
     while((v_token = strsep(&v_next, " "))) {
@@ -638,7 +638,7 @@
     char *v_next = v_tmp;
     char *v_token;
 
-//    LOGD("parseGroupCiphersMask(%s)", buffer);
+//    ALOGD("parseGroupCiphersMask(%s)", buffer);
 
     *mask = 0;
     while((v_token = strsep(&v_next, " "))) {
diff --git a/nexus/WifiScanner.cpp b/nexus/WifiScanner.cpp
index bdfa497..856e85f 100644
--- a/nexus/WifiScanner.cpp
+++ b/nexus/WifiScanner.cpp
@@ -74,7 +74,7 @@
 }
 
 void WifiScanner::run() {
-    LOGD("Starting wifi scanner (active = %d)", mActive);
+    ALOGD("Starting wifi scanner (active = %d)", mActive);
 
     while(1) {
         fd_set read_fds;
@@ -99,5 +99,5 @@
         } else if (FD_ISSET(mCtrlPipe[0], &read_fds))
             break;
     } // while
-    LOGD("Stopping wifi scanner");
+    ALOGD("Stopping wifi scanner");
 }
diff --git a/nexus/WifiStatusPoller.cpp b/nexus/WifiStatusPoller.cpp
index cf71733..e938fd0 100644
--- a/nexus/WifiStatusPoller.cpp
+++ b/nexus/WifiStatusPoller.cpp
@@ -68,10 +68,10 @@
     WifiStatusPoller *me = reinterpret_cast<WifiStatusPoller *>(obj);
 
     me->mStarted = true;
-    LOGD("Starting");
+    ALOGD("Starting");
     me->run();
     me->mStarted = false;
-    LOGD("Stopping");
+    ALOGD("Stopping");
     pthread_exit(NULL);
     return NULL;
 }