Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF)  DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: I8ab66debe4d0c3857a4b80f6f7b6925a352cda87
diff --git a/BandwidthController.cpp b/BandwidthController.cpp
index 17de451..f4b0588 100644
--- a/BandwidthController.cpp
+++ b/BandwidthController.cpp
@@ -189,7 +189,7 @@
         res = system_nosh(fullCmd.c_str());
     } else {
         if (StrncpyAndCheck(buffer, fullCmd.c_str(), sizeof(buffer))) {
-            LOGE("iptables command too long");
+            ALOGE("iptables command too long");
             return -1;
         }
 
@@ -197,7 +197,7 @@
         while ((tmp = strsep(&next, " "))) {
             argv[argc++] = tmp;
             if (argc >= MAX_CMD_ARGS) {
-                LOGE("iptables argument overflow");
+                ALOGE("iptables argument overflow");
                 return -1;
             }
         }
@@ -206,7 +206,7 @@
         res = logwrap(argc, argv, 0);
     }
     if (res) {
-        LOGE("runIptablesCmd(): failed %s res=%d", fullCmd.c_str(), res);
+        ALOGE("runIptablesCmd(): failed %s res=%d", fullCmd.c_str(), res);
     }
     return res;
 }
@@ -307,7 +307,7 @@
     for (uidNum = 0; uidNum < numUids; uidNum++) {
         appUids[uidNum] = atol(appStrUids[uidNum]);
         if (appUids[uidNum] == 0) {
-            LOGE(failLogTemplate, appUids[uidNum]);
+            ALOGE(failLogTemplate, appUids[uidNum]);
             goto fail_parse;
         }
     }
@@ -315,7 +315,7 @@
     for (uidNum = 0; uidNum < numUids; uidNum++) {
         naughtyCmd = makeIptablesNaughtyCmd(op, appUids[uidNum]);
         if (runIpxtablesCmd(naughtyCmd.c_str(), IptRejectAdd)) {
-            LOGE(failLogTemplate, appUids[uidNum]);
+            ALOGE(failLogTemplate, appUids[uidNum]);
             goto fail_with_uidNum;
         }
     }
@@ -442,11 +442,11 @@
 
     if (!maxBytes) {
         /* Don't talk about -1, deprecate it. */
-        LOGE("Invalid bytes value. 1..max_int64.");
+        ALOGE("Invalid bytes value. 1..max_int64.");
         return -1;
     }
     if (StrncpyAndCheck(ifn, iface, sizeof(ifn))) {
-        LOGE("Interface name longer than %d", MAX_IFACENAME_LEN);
+        ALOGE("Interface name longer than %d", MAX_IFACENAME_LEN);
         return -1;
     }
     ifaceName = ifn;
@@ -467,7 +467,7 @@
             quotaCmd = makeIptablesQuotaCmd(IptOpInsert, costName, maxBytes);
             res |= runIpxtablesCmd(quotaCmd.c_str(), IptRejectAdd);
             if (res) {
-                LOGE("Failed set quota rule");
+                ALOGE("Failed set quota rule");
                 goto fail;
             }
             sharedQuotaBytes = maxBytes;
@@ -479,7 +479,7 @@
     if (maxBytes != sharedQuotaBytes) {
         res |= updateQuota(costName, maxBytes);
         if (res) {
-            LOGE("Failed update quota for %s", costName);
+            ALOGE("Failed update quota for %s", costName);
             goto fail;
         }
         sharedQuotaBytes = maxBytes;
@@ -506,7 +506,7 @@
     const char *costName = "shared";
 
     if (StrncpyAndCheck(ifn, iface, sizeof(ifn))) {
-        LOGE("Interface name longer than %d", MAX_IFACENAME_LEN);
+        ALOGE("Interface name longer than %d", MAX_IFACENAME_LEN);
         return -1;
     }
     ifaceName = ifn;
@@ -516,7 +516,7 @@
             break;
     }
     if (it == sharedQuotaIfaces.end()) {
-        LOGE("No such iface %s to delete", ifn);
+        ALOGE("No such iface %s to delete", ifn);
         return -1;
     }
 
@@ -546,7 +546,7 @@
 
     if (!maxBytes) {
         /* Don't talk about -1, deprecate it. */
-        LOGE("Invalid bytes value. 1..max_int64.");
+        ALOGE("Invalid bytes value. 1..max_int64.");
         return -1;
     }
     if (maxBytes == -1) {
@@ -554,7 +554,7 @@
     }
 
     if (StrncpyAndCheck(ifn, iface, sizeof(ifn))) {
-        LOGE("Interface name longer than %d", MAX_IFACENAME_LEN);
+        ALOGE("Interface name longer than %d", MAX_IFACENAME_LEN);
         return -1;
     }
     ifaceName = ifn;
@@ -571,7 +571,7 @@
         quotaCmd = makeIptablesQuotaCmd(IptOpInsert, costName, maxBytes);
         res |= runIpxtablesCmd(quotaCmd.c_str(), IptRejectAdd);
         if (res) {
-            LOGE("Failed set quota rule");
+            ALOGE("Failed set quota rule");
             goto fail;
         }
 
@@ -580,7 +580,7 @@
     } else {
         res |= updateQuota(costName, maxBytes);
         if (res) {
-            LOGE("Failed update quota for %s", iface);
+            ALOGE("Failed update quota for %s", iface);
             goto fail;
         }
         it->quota = maxBytes;
@@ -611,7 +611,7 @@
     fp = fopen(fname, "r");
     free(fname);
     if (!fp) {
-        LOGE("Reading quota %s failed (%s)", costName, strerror(errno));
+        ALOGE("Reading quota %s failed (%s)", costName, strerror(errno));
         return -1;
     }
     scanRes = fscanf(fp, "%lld", bytes);
@@ -629,7 +629,7 @@
     std::list<QuotaInfo>::iterator it;
 
     if (StrncpyAndCheck(ifn, iface, sizeof(ifn))) {
-        LOGE("Interface name longer than %d", MAX_IFACENAME_LEN);
+        ALOGE("Interface name longer than %d", MAX_IFACENAME_LEN);
         return -1;
     }
     ifaceName = ifn;
@@ -641,7 +641,7 @@
     }
 
     if (it == quotaIfaces.end()) {
-        LOGE("No such iface %s to delete", ifn);
+        ALOGE("No such iface %s to delete", ifn);
         return -1;
     }
 
@@ -661,7 +661,7 @@
     fp = fopen(fname, "w");
     free(fname);
     if (!fp) {
-        LOGE("Updating quota %s failed (%s)", quotaName, strerror(errno));
+        ALOGE("Updating quota %s failed (%s)", quotaName, strerror(errno));
         return -1;
     }
     fprintf(fp, "%lld\n", bytes);
@@ -733,7 +733,7 @@
     int res = 0;
 
     if (!bytes) {
-        LOGE("Invalid bytes value. 1..max_int64.");
+        ALOGE("Invalid bytes value. 1..max_int64.");
         return -1;
     }
     if (globalAlertBytes) {
@@ -776,7 +776,7 @@
     int res = 0;
 
     if (!globalAlertBytes) {
-        LOGE("No prior alert set");
+        ALOGE("No prior alert set");
         return -1;
     }
     res = runIptablesAlertCmd(IptOpDelete, alertName, globalAlertBytes);
@@ -792,7 +792,7 @@
     const char *alertName = ALERT_GLOBAL_NAME;
 
     if (!globalAlertTetherCount) {
-        LOGE("No prior alert set");
+        ALOGE("No prior alert set");
         return -1;
     }
 
@@ -813,11 +813,11 @@
 
 int BandwidthController::setSharedAlert(int64_t bytes) {
     if (!sharedQuotaBytes) {
-        LOGE("Need to have a prior shared quota set to set an alert");
+        ALOGE("Need to have a prior shared quota set to set an alert");
         return -1;
     }
     if (!bytes) {
-        LOGE("Invalid bytes value. 1..max_int64.");
+        ALOGE("Invalid bytes value. 1..max_int64.");
         return -1;
     }
     return setCostlyAlert("shared", bytes, &sharedAlertBytes);
@@ -831,7 +831,7 @@
     std::list<QuotaInfo>::iterator it;
 
     if (!bytes) {
-        LOGE("Invalid bytes value. 1..max_int64.");
+        ALOGE("Invalid bytes value. 1..max_int64.");
         return -1;
     }
     for (it = quotaIfaces.begin(); it != quotaIfaces.end(); it++) {
@@ -840,7 +840,7 @@
     }
 
     if (it == quotaIfaces.end()) {
-        LOGE("Need to have a prior interface quota set to set an alert");
+        ALOGE("Need to have a prior interface quota set to set an alert");
         return -1;
     }
 
@@ -856,7 +856,7 @@
     }
 
     if (it == quotaIfaces.end()) {
-        LOGE("No prior alert set for interface %s", iface);
+        ALOGE("No prior alert set for interface %s", iface);
         return -1;
     }
 
@@ -870,7 +870,7 @@
     char *alertName;
 
     if (!bytes) {
-        LOGE("Invalid bytes value. 1..max_int64.");
+        ALOGE("Invalid bytes value. 1..max_int64.");
         return -1;
     }
     asprintf(&alertName, "%sAlert", costName);
@@ -897,7 +897,7 @@
 
     asprintf(&alertName, "%sAlert", costName);
     if (!*alertBytes) {
-        LOGE("No prior alert set for %s alert", costName);
+        ALOGE("No prior alert set for %s alert", costName);
         return -1;
     }
 
@@ -973,7 +973,7 @@
     const char *cmd;
 
     if (stats.rxBytes != -1 || stats.txBytes != -1) {
-        LOGE("Unexpected input stats. Byte counts should be -1.");
+        ALOGE("Unexpected input stats. Byte counts should be -1.");
         return -1;
     }
 
@@ -988,7 +988,7 @@
     fullCmd += " -nvx -L FORWARD";
     iptOutput = popen(fullCmd.c_str(), "r");
     if (!iptOutput) {
-            LOGE("Failed to run %s err=%s", fullCmd.c_str(), strerror(errno));
+            ALOGE("Failed to run %s err=%s", fullCmd.c_str(), strerror(errno));
             extraProcessingInfo += "Failed to run iptables.";
         return -1;
     }
diff --git a/CommandListener.cpp b/CommandListener.cpp
index 85a5288..c14fd62 100644
--- a/CommandListener.cpp
+++ b/CommandListener.cpp
@@ -87,12 +87,12 @@
 int CommandListener::writeFile(const char *path, const char *value, int size) {
     int fd = open(path, O_WRONLY);
     if (fd < 0) {
-        LOGE("Failed to open %s: %s", path, strerror(errno));
+        ALOGE("Failed to open %s: %s", path, strerror(errno));
         return -1;
     }
 
     if (write(fd, value, size) != size) {
-        LOGE("Failed to write %s: %s", path, strerror(errno));
+        ALOGE("Failed to write %s: %s", path, strerror(errno));
         close(fd);
         return -1;
     }
@@ -340,7 +340,7 @@
                 if (!strcmp(flag, "up")) {
                     ALOGD("Trying to bring up %s", argv[2]);
                     if (ifc_up(argv[2])) {
-                        LOGE("Error upping interface");
+                        ALOGE("Error upping interface");
                         cli->sendMsg(ResponseCode::OperationFailed, "Failed to up interface", true);
                         ifc_close();
                         return 0;
@@ -348,7 +348,7 @@
                 } else if (!strcmp(flag, "down")) {
                     ALOGD("Trying to bring down %s", argv[2]);
                     if (ifc_down(argv[2])) {
-                        LOGE("Error downing interface");
+                        ALOGE("Error downing interface");
                         cli->sendMsg(ResponseCode::OperationFailed, "Failed to down interface", true);
                         ifc_close();
                         return 0;
@@ -838,7 +838,7 @@
 int CommandListener::readInterfaceCounters(const char *iface, unsigned long *rx, unsigned long *tx) {
     FILE *fp = fopen("/proc/net/dev", "r");
     if (!fp) {
-        LOGE("Failed to open /proc/net/dev (%s)", strerror(errno));
+        ALOGE("Failed to open /proc/net/dev (%s)", strerror(errno));
         return -1;
     }
 
diff --git a/NatController.cpp b/NatController.cpp
index ed1b095..d609a39 100644
--- a/NatController.cpp
+++ b/NatController.cpp
@@ -49,7 +49,7 @@
     int res;
 
     if (len == 255) {
-        LOGE("command too long");
+        ALOGE("command too long");
         errno = E2BIG;
         return -1;
     }
@@ -110,13 +110,13 @@
     int tableNumber;
 
     if (!checkInterface(intIface) || !checkInterface(extIface)) {
-        LOGE("Invalid interface specified");
+        ALOGE("Invalid interface specified");
         errno = ENODEV;
         return -1;
     }
 
     if (argc < 5 + addrCount) {
-        LOGE("Missing Argument");
+        ALOGE("Missing Argument");
         errno = EINVAL;
         return -1;
     }
@@ -127,12 +127,12 @@
             snprintf(cmd, sizeof(cmd), "%s rule add from %s table %d", getVersion(argv[5+i]),
                     argv[5+i], tableNumber + BASE_TABLE_NUMBER);
             ret |= runCmd(IP_PATH, cmd);
-            if (ret) LOGE("IP rule %s got %d", cmd, ret);
+            if (ret) ALOGE("IP rule %s got %d", cmd, ret);
 
             snprintf(cmd, sizeof(cmd), "route add %s dev %s table %d", argv[5+i], intIface,
                     tableNumber + BASE_TABLE_NUMBER);
             ret |= runCmd(IP_PATH, cmd);
-            if (ret) LOGE("IP route %s got %d", cmd, ret);
+            if (ret) ALOGE("IP route %s got %d", cmd, ret);
         }
         runCmd(IP_PATH, "route flush cache");
     }
@@ -150,7 +150,7 @@
             }
             runCmd(IP_PATH, "route flush cache");
         }
-        LOGE("Error setting forward rules");
+        ALOGE("Error setting forward rules");
         errno = ENODEV;
         return -1;
     }
@@ -160,7 +160,7 @@
     if (natCount == 1) {
         snprintf(cmd, sizeof(cmd), "-t nat -A POSTROUTING -o %s -j MASQUERADE", extIface);
         if (runCmd(IPTABLES_PATH, cmd)) {
-            LOGE("Error seting postroute rule: %s", cmd);
+            ALOGE("Error seting postroute rule: %s", cmd);
             // unwind what's been done, but don't care about success - what more could we do?
             for (i = 0; i < addrCount; i++) {
                 snprintf(cmd, sizeof(cmd), "route del %s dev %s table %d", argv[5+i], intIface,
@@ -232,13 +232,13 @@
     int tableNumber;
 
     if (!checkInterface(intIface) || !checkInterface(extIface)) {
-        LOGE("Invalid interface specified");
+        ALOGE("Invalid interface specified");
         errno = ENODEV;
         return -1;
     }
 
     if (argc < 5 + addrCount) {
-        LOGE("Missing Argument");
+        ALOGE("Missing Argument");
         errno = EINVAL;
         return -1;
     }
diff --git a/NetlinkManager.cpp b/NetlinkManager.cpp
index 196945b..73e5599 100644
--- a/NetlinkManager.cpp
+++ b/NetlinkManager.cpp
@@ -63,12 +63,12 @@
     nladdr.nl_groups = groups;
 
     if ((*sock = socket(PF_NETLINK, SOCK_DGRAM, netlinkFamily)) < 0) {
-        LOGE("Unable to create netlink socket: %s", strerror(errno));
+        ALOGE("Unable to create netlink socket: %s", strerror(errno));
         return NULL;
     }
 
     if (setsockopt(*sock, SOL_SOCKET, SO_RCVBUFFORCE, &sz, sizeof(sz)) < 0) {
-        LOGE("Unable to set uevent socket SO_RCVBUFFORCE option: %s", strerror(errno));
+        ALOGE("Unable to set uevent socket SO_RCVBUFFORCE option: %s", strerror(errno));
         close(*sock);
         return NULL;
     }
@@ -80,14 +80,14 @@
     }
 
     if (bind(*sock, (struct sockaddr *) &nladdr, sizeof(nladdr)) < 0) {
-        LOGE("Unable to bind netlink socket: %s", strerror(errno));
+        ALOGE("Unable to bind netlink socket: %s", strerror(errno));
         close(*sock);
         return NULL;
     }
 
     NetlinkHandler *handler = new NetlinkHandler(this, *sock, format);
     if (handler->start()) {
-        LOGE("Unable to start NetlinkHandler: %s", strerror(errno));
+        ALOGE("Unable to start NetlinkHandler: %s", strerror(errno));
         close(*sock);
         return NULL;
     }
@@ -108,7 +108,7 @@
 
     if ((mQuotaHandler = setupSocket(&mQuotaSock, NETLINK_NFLOG,
         NFLOG_QUOTA_GROUP, NetlinkListener::NETLINK_FORMAT_BINARY)) == NULL) {
-        LOGE("Unable to open quota2 logging socket");
+        ALOGE("Unable to open quota2 logging socket");
         // TODO: return -1 once the emulator gets a new kernel.
     }
     return 0;
@@ -118,7 +118,7 @@
     int status = 0;
 
     if (mUeventHandler->stop()) {
-        LOGE("Unable to stop uevent NetlinkHandler: %s", strerror(errno));
+        ALOGE("Unable to stop uevent NetlinkHandler: %s", strerror(errno));
         status = -1;
     }
 
@@ -129,7 +129,7 @@
     mUeventSock = -1;
 
     if (mRouteHandler->stop()) {
-        LOGE("Unable to stop route NetlinkHandler: %s", strerror(errno));
+        ALOGE("Unable to stop route NetlinkHandler: %s", strerror(errno));
         status = -1;
     }
 
@@ -141,7 +141,7 @@
 
     if (mQuotaHandler) {
         if (mQuotaHandler->stop()) {
-            LOGE("Unable to stop quota NetlinkHandler: %s", strerror(errno));
+            ALOGE("Unable to stop quota NetlinkHandler: %s", strerror(errno));
             status = -1;
         }
 
diff --git a/PanController.cpp b/PanController.cpp
index c58aebb..164b01a 100644
--- a/PanController.cpp
+++ b/PanController.cpp
@@ -52,33 +52,33 @@
 
 #ifdef HAVE_BLUETOOTH
     if (!bt_is_enabled()) {
-        LOGE("Cannot start PAN services - Bluetooth not running");
+        ALOGE("Cannot start PAN services - Bluetooth not running");
         errno = ENODEV;
         return -1;
     }
 #else
-    LOGE("Cannot start PAN services - No Bluetooth support");
+    ALOGE("Cannot start PAN services - No Bluetooth support");
     errno = ENODEV;
     return -1;
 #endif
 
     if (mPid) {
-        LOGE("PAN already started");
+        ALOGE("PAN already started");
         errno = EBUSY;
         return -1;
     }
 
    if ((pid = fork()) < 0) {
-        LOGE("fork failed (%s)", strerror(errno));
+        ALOGE("fork failed (%s)", strerror(errno));
         return -1;
     }
 
     if (!pid) {
         if (execl("/system/bin/pand", "/system/bin/pand", "--nodetach", "--listen",
                   "--role", "NAP", (char *) NULL)) {
-            LOGE("execl failed (%s)", strerror(errno));
+            ALOGE("execl failed (%s)", strerror(errno));
         }
-        LOGE("Should never get here!");
+        ALOGE("Should never get here!");
         return 0;
     } else {
         mPid = pid;
@@ -89,7 +89,7 @@
 
 int PanController::stopPan() {
     if (mPid == 0) {
-        LOGE("PAN already stopped");
+        ALOGE("PAN already stopped");
         return 0;
     }
 
diff --git a/PppController.cpp b/PppController.cpp
index b50b2b7..d20cc48 100644
--- a/PppController.cpp
+++ b/PppController.cpp
@@ -56,7 +56,7 @@
     pid_t pid;
 
     if (mPid) {
-        LOGE("Multiple PPPD instances not currently supported");
+        ALOGE("Multiple PPPD instances not currently supported");
         errno = EBUSY;
         return -1;
     }
@@ -68,13 +68,13 @@
         }
     }
     if (it == mTtys->end()) {
-        LOGE("Invalid tty '%s' specified", tty);
+        ALOGE("Invalid tty '%s' specified", tty);
         errno = -EINVAL;
         return -1;
     }
 
     if ((pid = fork()) < 0) {
-        LOGE("fork failed (%s)", strerror(errno));
+        ALOGE("fork failed (%s)", strerror(errno));
         return -1;
     }
 
@@ -94,9 +94,9 @@
         // but not getting a connection
         if (execl("/system/bin/pppd", "/system/bin/pppd", "-detach", dev, "115200",
                   lr, "ms-dns", d1, "ms-dns", d2, "lcp-max-configure", "99999", (char *) NULL)) {
-            LOGE("execl failed (%s)", strerror(errno));
+            ALOGE("execl failed (%s)", strerror(errno));
         }
-        LOGE("Should never get here!");
+        ALOGE("Should never get here!");
         return 0;
     } else {
         mPid = pid;
@@ -107,7 +107,7 @@
 int PppController::detachPppd(const char *tty) {
 
     if (mPid == 0) {
-        LOGE("PPPD already stopped");
+        ALOGE("PPPD already stopped");
         return 0;
     }
 
@@ -134,7 +134,7 @@
 
     DIR *d = opendir("/sys/class/tty");
     if (!d) {
-        LOGE("Error opening /sys/class/tty (%s)", strerror(errno));
+        ALOGE("Error opening /sys/class/tty (%s)", strerror(errno));
         return -1;
     }
 
diff --git a/SecondaryTableController.cpp b/SecondaryTableController.cpp
index 287bba5..5d79f86 100644
--- a/SecondaryTableController.cpp
+++ b/SecondaryTableController.cpp
@@ -68,7 +68,7 @@
     if (tableIndex == -1) {
         tableIndex = findTableNumber(""); // look for an empty slot
         if (tableIndex == -1) {
-            LOGE("Max number of NATed interfaces reached");
+            ALOGE("Max number of NATed interfaces reached");
             errno = ENODEV;
             cli->sendMsg(ResponseCode::OperationFailed, "Max number NATed", true);
             return -1;
@@ -93,7 +93,7 @@
     }
 
     if (runAndFree(cli, cmd)) {
-        LOGE("ip route %s failed: %s route %s %s/%d via %s dev %s table %d", action,
+        ALOGE("ip route %s failed: %s route %s %s/%d via %s dev %s table %d", action,
                 IP_PATH, action, dest, prefix, gateway, iface, tableIndex+BASE_TABLE_NUMBER);
         errno = ENODEV;
         cli->sendMsg(ResponseCode::OperationFailed, "ip route modification failed", true);
@@ -116,7 +116,7 @@
         char *gateway) {
     int tableIndex = findTableNumber(iface);
     if (tableIndex == -1) {
-        LOGE("Interface not found");
+        ALOGE("Interface not found");
         errno = ENODEV;
         cli->sendMsg(ResponseCode::OperationFailed, "Interface not found", true);
         return -1;
@@ -128,7 +128,7 @@
 int SecondaryTableController::runAndFree(SocketClient *cli, char *cmd) {
     int ret = 0;
     if (strlen(cmd) >= 255) {
-        LOGE("ip command (%s) too long", cmd);
+        ALOGE("ip command (%s) too long", cmd);
         errno = E2BIG;
         cli->sendMsg(ResponseCode::CommandSyntaxError, "Too long", true);
         free(cmd);
diff --git a/SoftapController.cpp b/SoftapController.cpp
index dd75a3a..5e81ae2 100644
--- a/SoftapController.cpp
+++ b/SoftapController.cpp
@@ -47,7 +47,7 @@
     mPid = 0;
     mSock = socket(AF_INET, SOCK_DGRAM, 0);
     if (mSock < 0)
-        LOGE("Failed to open socket");
+        ALOGE("Failed to open socket");
     memset(mIface, 0, sizeof(mIface));
 }
 
@@ -71,7 +71,7 @@
     wrq.u.data.length = sizeof(tBuf) / sizeof(struct iw_priv_args);
     wrq.u.data.flags = 0;
     if ((ret = ioctl(mSock, SIOCGIWPRIV, &wrq)) < 0) {
-        LOGE("SIOCGIPRIV failed: %d", ret);
+        ALOGE("SIOCGIPRIV failed: %d", ret);
         return ret;
     }
 
@@ -84,7 +84,7 @@
     }
 
     if (i == wrq.u.data.length) {
-        LOGE("iface:%s, fname: %s - function not supported", iface, fname);
+        ALOGE("iface:%s, fname: %s - function not supported", iface, fname);
         return -1;
     }
 
@@ -96,7 +96,7 @@
                 break;
         }
         if (j == i) {
-            LOGE("iface:%s, fname: %s - invalid private ioctl", iface, fname);
+            ALOGE("iface:%s, fname: %s - invalid private ioctl", iface, fname);
             return -1;
         }
         sub_cmd = cmd;
@@ -119,7 +119,7 @@
     int ret;
 
     if (mSock < 0) {
-        LOGE("Softap driver start - failed to open socket");
+        ALOGE("Softap driver start - failed to open socket");
         return -1;
     }
     if (!iface || (iface[0] == '\0')) {
@@ -130,7 +130,7 @@
     *mBuf = 0;
     ret = setCommand(iface, "START");
     if (ret < 0) {
-        LOGE("Softap driver start: %d", ret);
+        ALOGE("Softap driver start: %d", ret);
         return ret;
     }
 #ifdef HAVE_HOSTAPD
@@ -147,7 +147,7 @@
     int ret;
 
     if (mSock < 0) {
-        LOGE("Softap driver stop - failed to open socket");
+        ALOGE("Softap driver stop - failed to open socket");
         return -1;
     }
     if (!iface || (iface[0] == '\0')) {
@@ -160,7 +160,7 @@
     ret = ifc_down(iface);
     ifc_close();
     if (ret < 0) {
-        LOGE("Softap %s down: %d", iface, ret);
+        ALOGE("Softap %s down: %d", iface, ret);
     }
 #endif
     ret = setCommand(iface, "STOP");
@@ -173,16 +173,16 @@
     int ret = 0;
 
     if (mPid) {
-        LOGE("Softap already started");
+        ALOGE("Softap already started");
         return 0;
     }
     if (mSock < 0) {
-        LOGE("Softap startap - failed to open socket");
+        ALOGE("Softap startap - failed to open socket");
         return -1;
     }
 #ifdef HAVE_HOSTAPD
     if ((pid = fork()) < 0) {
-        LOGE("fork failed (%s)", strerror(errno));
+        ALOGE("fork failed (%s)", strerror(errno));
         return -1;
     }
 #endif
@@ -192,16 +192,16 @@
         if (execl("/system/bin/hostapd", "/system/bin/hostapd",
                   "-e", WIFI_ENTROPY_FILE,
                   HOSTAPD_CONF_FILE, (char *) NULL)) {
-            LOGE("execl failed (%s)", strerror(errno));
+            ALOGE("execl failed (%s)", strerror(errno));
         }
 #endif
-        LOGE("Should never get here!");
+        ALOGE("Should never get here!");
         return -1;
     } else {
         *mBuf = 0;
         ret = setCommand(mIface, "AP_BSS_START");
         if (ret) {
-            LOGE("Softap startap - failed: %d", ret);
+            ALOGE("Softap startap - failed: %d", ret);
         }
         else {
            mPid = pid;
@@ -217,7 +217,7 @@
     int ret;
 
     if (mPid == 0) {
-        LOGE("Softap already stopped");
+        ALOGE("Softap already stopped");
         return 0;
     }
 
@@ -227,7 +227,7 @@
     waitpid(mPid, NULL, 0);
 #endif
     if (mSock < 0) {
-        LOGE("Softap stopap - failed to open socket");
+        ALOGE("Softap stopap - failed to open socket");
         return -1;
     }
     *mBuf = 0;
@@ -247,7 +247,7 @@
     if (pos < 0)
         return pos;
     if ((unsigned)(pos + strlen(cmd) + strlen(arg) + 1) >= sizeof(mBuf)) {
-        LOGE("Command line is too big");
+        ALOGE("Command line is too big");
         return -1;
     }
     pos += sprintf(&mBuf[pos], "%s=%s,", cmd, arg);
@@ -271,11 +271,11 @@
     char *ssid, *iface;
 
     if (mSock < 0) {
-        LOGE("Softap set - failed to open socket");
+        ALOGE("Softap set - failed to open socket");
         return -1;
     }
     if (argc < 4) {
-        LOGE("Softap set - missing arguments");
+        ALOGE("Softap set - missing arguments");
         return -1;
     }
 
@@ -311,13 +311,13 @@
 
     fd = open(HOSTAPD_CONF_FILE, O_CREAT | O_TRUNC | O_WRONLY, 0660);
     if (fd < 0) {
-        LOGE("Cannot update \"%s\": %s", HOSTAPD_CONF_FILE, strerror(errno));
+        ALOGE("Cannot update \"%s\": %s", HOSTAPD_CONF_FILE, strerror(errno));
         free(wbuf);
         free(fbuf);
         return -1;
     }
     if (write(fd, fbuf, strlen(fbuf)) < 0) {
-        LOGE("Cannot write to \"%s\": %s", HOSTAPD_CONF_FILE, strerror(errno));
+        ALOGE("Cannot write to \"%s\": %s", HOSTAPD_CONF_FILE, strerror(errno));
         ret = -1;
     }
     close(fd);
@@ -326,14 +326,14 @@
 
     /* Note: apparently open can fail to set permissions correctly at times */
     if (chmod(HOSTAPD_CONF_FILE, 0660) < 0) {
-        LOGE("Error changing permissions of %s to 0660: %s",
+        ALOGE("Error changing permissions of %s to 0660: %s",
                 HOSTAPD_CONF_FILE, strerror(errno));
         unlink(HOSTAPD_CONF_FILE);
         return -1;
     }
 
     if (chown(HOSTAPD_CONF_FILE, AID_SYSTEM, AID_WIFI) < 0) {
-        LOGE("Error changing group ownership of %s to %d: %s",
+        ALOGE("Error changing group ownership of %s to %d: %s",
                 HOSTAPD_CONF_FILE, AID_WIFI, strerror(errno));
         unlink(HOSTAPD_CONF_FILE);
         return -1;
@@ -375,7 +375,7 @@
         i = addParam(i, "MAX_SCB", "8");
     }
     if ((i < 0) || ((unsigned)(i + 4) >= sizeof(mBuf))) {
-        LOGE("Softap set - command is too big");
+        ALOGE("Softap set - command is too big");
         return i;
     }
     sprintf(&mBuf[i], "END");
@@ -383,7 +383,7 @@
     /* system("iwpriv eth0 WL_AP_CFG ASCII_CMD=AP_CFG,SSID=\"AndroidAP\",SEC=\"open\",KEY=12345,CHANNEL=1,PREAMBLE=0,MAX_SCB=8,END"); */
     ret = setCommand(iface, "AP_SET_CFG");
     if (ret) {
-        LOGE("Softap set - failed: %d", ret);
+        ALOGE("Softap set - failed: %d", ret);
     }
     else {
         ALOGD("Softap set - Ok");
@@ -419,11 +419,11 @@
     char *fwpath;
 
     if (mSock < 0) {
-        LOGE("Softap fwrealod - failed to open socket");
+        ALOGE("Softap fwrealod - failed to open socket");
         return -1;
     }
     if (argc < 4) {
-        LOGE("Softap fwreload - missing arguments");
+        ALOGE("Softap fwreload - missing arguments");
         return -1;
     }
 
@@ -445,7 +445,7 @@
     ret = setCommand(iface, "WL_FW_RELOAD");
 #endif
     if (ret) {
-        LOGE("Softap fwReload - failed: %d", ret);
+        ALOGE("Softap fwReload - failed: %d", ret);
     }
     else {
         ALOGD("Softap fwReload - Ok");
@@ -458,13 +458,13 @@
     int ret;
 
     if (mSock < 0) {
-        LOGE("Softap clients - failed to open socket");
+        ALOGE("Softap clients - failed to open socket");
         return -1;
     }
     *mBuf = 0;
     ret = setCommand(mIface, "AP_GET_STA_LIST", SOFTAP_MAX_BUFFER_SIZE);
     if (ret) {
-        LOGE("Softap clients - failed: %d", ret);
+        ALOGE("Softap clients - failed: %d", ret);
     } else {
         asprintf(retbuf, "Softap clients:%s", mBuf);
         ALOGD("Softap clients:%s", mBuf);
diff --git a/TetherController.cpp b/TetherController.cpp
index e065e81..8b1ecc8 100644
--- a/TetherController.cpp
+++ b/TetherController.cpp
@@ -64,12 +64,12 @@
 
     int fd = open("/proc/sys/net/ipv4/ip_forward", O_WRONLY);
     if (fd < 0) {
-        LOGE("Failed to open ip_forward (%s)", strerror(errno));
+        ALOGE("Failed to open ip_forward (%s)", strerror(errno));
         return -1;
     }
 
     if (write(fd, (enable ? "1" : "0"), 1) != 1) {
-        LOGE("Failed to write ip_forward (%s)", strerror(errno));
+        ALOGE("Failed to write ip_forward (%s)", strerror(errno));
         close(fd);
         return -1;
     }
@@ -81,13 +81,13 @@
     int fd = open("/proc/sys/net/ipv4/ip_forward", O_RDONLY);
 
     if (fd < 0) {
-        LOGE("Failed to open ip_forward (%s)", strerror(errno));
+        ALOGE("Failed to open ip_forward (%s)", strerror(errno));
         return false;
     }
 
     char enabled;
     if (read(fd, &enabled, 1) != 1) {
-        LOGE("Failed to read ip_forward (%s)", strerror(errno));
+        ALOGE("Failed to read ip_forward (%s)", strerror(errno));
         close(fd);
         return -1;
     }
@@ -98,7 +98,7 @@
 
 int TetherController::startTethering(int num_addrs, struct in_addr* addrs) {
     if (mDaemonPid != 0) {
-        LOGE("Tethering already started");
+        ALOGE("Tethering already started");
         errno = EBUSY;
         return -1;
     }
@@ -109,7 +109,7 @@
     int pipefd[2];
 
     if (pipe(pipefd) < 0) {
-        LOGE("pipe failed (%s)", strerror(errno));
+        ALOGE("pipe failed (%s)", strerror(errno));
         return -1;
     }
 
@@ -118,7 +118,7 @@
      * the daemon if it exits prematurely
      */
     if ((pid = fork()) < 0) {
-        LOGE("fork failed (%s)", strerror(errno));
+        ALOGE("fork failed (%s)", strerror(errno));
         close(pipefd[0]);
         close(pipefd[1]);
         return -1;
@@ -128,7 +128,7 @@
         close(pipefd[1]);
         if (pipefd[0] != STDIN_FILENO) {
             if (dup2(pipefd[0], STDIN_FILENO) != STDIN_FILENO) {
-                LOGE("dup2 failed (%s)", strerror(errno));
+                ALOGE("dup2 failed (%s)", strerror(errno));
                 return -1;
             }
             close(pipefd[0]);
@@ -150,9 +150,9 @@
         }
 
         if (execv(args[0], args)) {
-            LOGE("execl failed (%s)", strerror(errno));
+            ALOGE("execl failed (%s)", strerror(errno));
         }
-        LOGE("Should never get here!");
+        ALOGE("Should never get here!");
         free(args);
         return 0;
     } else {
@@ -168,7 +168,7 @@
 int TetherController::stopTethering() {
 
     if (mDaemonPid == 0) {
-        LOGE("Tethering already stopped");
+        ALOGE("Tethering already stopped");
         return 0;
     }
 
@@ -203,7 +203,7 @@
         struct in_addr a;
 
         if (!inet_aton(servers[i], &a)) {
-            LOGE("Failed to parse DNS server '%s'", servers[i]);
+            ALOGE("Failed to parse DNS server '%s'", servers[i]);
             mDnsForwarders->clear();
             return -1;
         }
@@ -222,7 +222,7 @@
     if (mDaemonFd != -1) {
         ALOGD("Sending update msg to dnsmasq [%s]", daemonCmd);
         if (write(mDaemonFd, daemonCmd, strlen(daemonCmd) +1) < 0) {
-            LOGE("Failed to send update command to dnsmasq (%s)", strerror(errno));
+            ALOGE("Failed to send update command to dnsmasq (%s)", strerror(errno));
             mDnsForwarders->clear();
             return -1;
         }
diff --git a/ThrottleController.cpp b/ThrottleController.cpp
index 1ae31b8..b4720b5 100644
--- a/ThrottleController.cpp
+++ b/ThrottleController.cpp
@@ -47,7 +47,7 @@
     int res;
 
     if (len == 255) {
-        LOGE("tc command too long");
+        ALOGE("tc command too long");
         errno = E2BIG;
         return -1;
     }
@@ -82,7 +82,7 @@
      */
     sprintf(cmd, "qdisc add dev %s root handle 1: htb default 1 r2q 1000", ifn);
     if (runTcCmd(cmd)) {
-        LOGE("Failed to add root qdisc (%s)", strerror(errno));
+        ALOGE("Failed to add root qdisc (%s)", strerror(errno));
         goto fail;
     }
 
@@ -91,7 +91,7 @@
      */
     sprintf(cmd, "class add dev %s parent 1: classid 1:1 htb rate %dkbit", ifn, txKbps);
     if (runTcCmd(cmd)) {
-        LOGE("Failed to add egress throttling class (%s)", strerror(errno));
+        ALOGE("Failed to add egress throttling class (%s)", strerror(errno));
         goto fail;
     }
 
@@ -100,7 +100,7 @@
      */
     ifc_init();
     if (ifc_up("ifb0")) {
-        LOGE("Failed to up ifb0 (%s)", strerror(errno));
+        ALOGE("Failed to up ifb0 (%s)", strerror(errno));
         goto fail;
     }
 
@@ -109,7 +109,7 @@
      */
     sprintf(cmd, "qdisc add dev ifb0 root handle 1: htb default 1 r2q 1000");
     if (runTcCmd(cmd)) {
-        LOGE("Failed to add root ifb qdisc (%s)", strerror(errno));
+        ALOGE("Failed to add root ifb qdisc (%s)", strerror(errno));
         goto fail;
     }
 
@@ -118,7 +118,7 @@
      */
     sprintf(cmd, "class add dev ifb0 parent 1: classid 1:1 htb rate %dkbit", rxKbps);
     if (runTcCmd(cmd)) {
-        LOGE("Failed to add ingress throttling class (%s)", strerror(errno));
+        ALOGE("Failed to add ingress throttling class (%s)", strerror(errno));
         goto fail;
     }
 
@@ -127,7 +127,7 @@
      */
     sprintf(cmd, "qdisc add dev %s ingress", ifn);
     if (runTcCmd(cmd)) {
-        LOGE("Failed to add ingress qdisc (%s)", strerror(errno));
+        ALOGE("Failed to add ingress qdisc (%s)", strerror(errno));
         goto fail;
     }
 
@@ -137,7 +137,7 @@
     sprintf(cmd, "filter add dev %s parent ffff: protocol ip prio 10 u32 match "
             "u32 0 0 flowid 1:1 action mirred egress redirect dev ifb0", ifn);
     if (runTcCmd(cmd)) {
-        LOGE("Failed to add ifb filter (%s)", strerror(errno));
+        ALOGE("Failed to add ifb filter (%s)", strerror(errno));
         goto fail;
     }
 
diff --git a/logwrapper.c b/logwrapper.c
index 493e85d..1c94710 100644
--- a/logwrapper.c
+++ b/logwrapper.c
@@ -201,7 +201,7 @@
      * reverted in Change: 11b4e9b2
      */
     if (strnlen(buffer, sizeof(buffer) - 1) == sizeof(buffer) - 1) {
-        LOGE("command line too long while processing: %s", command);
+        ALOGE("command line too long while processing: %s", command);
         errno = E2BIG;
         return -1;
     }
@@ -209,7 +209,7 @@
     while ((tmp = strsep(&next, " "))) {
         argp[i++] = tmp;
         if (i == 32) {
-            LOGE("argument overflow while processing: %s", command);
+            ALOGE("argument overflow while processing: %s", command);
             errno = E2BIG;
             return -1;
         }
diff --git a/main.cpp b/main.cpp
index e9e995e..2a1e7f0 100644
--- a/main.cpp
+++ b/main.cpp
@@ -48,7 +48,7 @@
 //    signal(SIGCHLD, sigchld_handler);
 
     if (!(nm = NetlinkManager::Instance())) {
-        LOGE("Unable to create NetlinkManager");
+        ALOGE("Unable to create NetlinkManager");
         exit(1);
     };
 
@@ -57,7 +57,7 @@
     nm->setBroadcaster((SocketListener *) cl);
 
     if (nm->start()) {
-        LOGE("Unable to start NetlinkManager (%s)", strerror(errno));
+        ALOGE("Unable to start NetlinkManager (%s)", strerror(errno));
         exit(1);
     }
 
@@ -66,7 +66,7 @@
     setenv("ANDROID_DNS_MODE", "local", 1);
     dpl = new DnsProxyListener();
     if (dpl->startListener()) {
-        LOGE("Unable to start DnsProxyListener (%s)", strerror(errno));
+        ALOGE("Unable to start DnsProxyListener (%s)", strerror(errno));
         exit(1);
     }
 
@@ -74,7 +74,7 @@
      * Now that we're up, we can respond to commands
      */
     if (cl->startListener()) {
-        LOGE("Unable to start CommandListener (%s)", strerror(errno));
+        ALOGE("Unable to start CommandListener (%s)", strerror(errno));
         exit(1);
     }