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

Bug: 5449033
Change-Id: I9244d927f14c750cd359ebffb1fc1c355a755d5a
This commit is contained in:
Steve Block 2011-12-20 16:07:45 +00:00
parent 0fdccb561d
commit 8d66c49258
22 changed files with 130 additions and 130 deletions

View file

@ -97,12 +97,12 @@ extern "C" {
/*
* 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 @@ extern "C" {
* 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
/*

View file

@ -104,9 +104,9 @@ ssize_t bufferWrite(Buffer* buffer, int fd) {
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;
}

View file

@ -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__)

View file

@ -263,7 +263,7 @@ static void peerUnlock(Peer* peer) {
/** 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 @@ static void peerProxyHandleError(PeerProxy* peerProxy, char* functionName) {
// 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 bool peerProxyWriteFromBuffer(PeerProxy* peerProxy, Buffer* outgoing) {
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 @@ static void peerProxyWrite(SelectableFd* fd) {
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 @@ static void peerProxyWrite(SelectableFd* fd) {
* 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 @@ static void peerProxyBeforeSelect(SelectableFd* fd) {
peerUnlock(peerProxy->peer);
if (hasPackets) {
LOGD("Packets found. Setting onWritable().");
ALOGD("Packets found. Setting onWritable().");
fd->onWritable = &peerProxyWrite;
} else {
@ -579,9 +579,9 @@ static void peerProxyBeforeSelect(SelectableFd* fd) {
/** 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 @@ static bool peerProxyBufferInput(PeerProxy* peerProxy) {
* 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 @@ static void masterAcceptConnection(SelectableFd* listenerFd) {
return;
}
LOGD("Accepted connection as fd %d.", socket);
ALOGD("Accepted connection as fd %d.", socket);
// Get credentials.
Credentials credentials;
@ -1118,7 +1118,7 @@ static Peer* localPeer;
/** 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 @@ void masterPeerInitialize(BytesListener* bytesListener,
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);

View file

@ -96,7 +96,7 @@ Selector* selectorCreate(void) {
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 @@ static void prepareForSelect(Selector* selector) {
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 void prepareForSelect(Selector* selector) {
*/
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 @@ void selectorLoop(Selector* selector) {
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);

View file

@ -70,7 +70,7 @@ void printerr(char *fmt, ...)
vsnprintf(errmsg, sizeof(errmsg), fmt, ap);
va_end(ap);
LOGD("%s", errmsg);
ALOGD("%s", errmsg);
}
const char *dhcp_lasterror()
@ -151,14 +151,14 @@ static const char *dhcp_type_to_name(uint32_t type)
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 @@ void dump_dhcp_msg(dhcp_msg *msg, int len)
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 @@ void dump_dhcp_msg(dhcp_msg *msg, int len)
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 @@ void dump_dhcp_msg(dhcp_msg *msg, int len)
}
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 @@ void dump_dhcp_msg(dhcp_msg *msg, int len)
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 send_message(int sock, int if_index, dhcp_msg *msg, int size)
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 @@ int dhcp_init_ifc(const char *ifname)
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;
}

View file

@ -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 @@ int ifc_remove_host_routes(const char *name)
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 @@ int ifc_set_default_route(const char *ifname, in_addr_t gateway)
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 @@ int ifc_remove_default_route(const char *ifname)
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;

View file

@ -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 @@ int receive_packet(int s, struct dhcp_msg *msg)
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;

View file

@ -94,15 +94,15 @@ static inline void swap(T& a, T& b) {
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 @@ void AAEdge::dump()
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,

View file

@ -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

View file

@ -53,7 +53,7 @@ DhcpClient::~DhcpClient() {
}
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),

View file

@ -107,7 +107,7 @@ Controller *NetworkManager::findController(const char *name) {
}
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::onInterfaceConnected(Controller *c) {
}
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 @@ void NetworkManager::onDhcpStateChanged(Controller *c, int state) {
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::onDhcpStateChanged(Controller *c, int state) {
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,

View file

@ -66,10 +66,10 @@ Property *PropertyManager::lookupProperty_UNLOCKED(PropertyNamespace *ns, const
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::attachProperty(const char *ns_name, Property *p) {
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::doGet(Property *p, int idx, char *buffer, size_t max) {
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) {

View file

@ -120,7 +120,7 @@ int Supplicant::sendCommand(const char *cmd, char *reply, size_t *reply_len) {
return -1;
}
// LOGD("sendCommand(): -> '%s'", cmd);
// ALOGD("sendCommand(): -> '%s'", cmd);
int rc;
memset(reply, 0, *reply_len);
@ -133,7 +133,7 @@ int Supplicant::sendCommand(const char *cmd, char *reply, size_t *reply_len) {
return -1;
}
// LOGD("sendCommand(): <- '%s'", reply);
// ALOGD("sendCommand(): <- '%s'", reply);
return 0;
}
SupplicantStatus *Supplicant::getStatus() {
@ -233,7 +233,7 @@ int Supplicant::refreshNetworkList() {
}
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 @@ int Supplicant::stopDriver() {
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 @@ int Supplicant::startDriver() {
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 @@ int Supplicant::setNetworkVar(int networkId, const char *var, const char *val) {
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::setBluetoothCoexistenceMode(int mode) {
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];

View file

@ -54,7 +54,7 @@ bool SupplicantListener::onDataAvailable(SocketClient *cli) {
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;

View file

@ -83,7 +83,7 @@ SupplicantStatus *SupplicantStatus::createStatus(char *data, int len) {
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);

View file

@ -45,13 +45,13 @@ bool TiwlanEventListener::onDataAvailable(SocketClient *cli) {
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

View file

@ -75,7 +75,7 @@ int TiwlanWifiController::loadFirmware() {
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)",

View file

@ -204,26 +204,26 @@ int WifiController::setSuspend(bool suspend) {
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 @@ int WifiController::setSuspend(bool suspend) {
mSuspended = suspend;
pthread_mutex_unlock(&mLock);
LOGD("Suspend / Resume completed");
ALOGD("Suspend / Resume completed");
return 0;
}
@ -426,18 +426,18 @@ int WifiController::setBluetoothCoexistenceMode(int mode) {
}
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 @@ void WifiController::onStateChangeEvent(SupplicantStateChangeEvent *evt) {
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::onStateChangeEvent(SupplicantStateChangeEvent *evt) {
}
void WifiController::onConnectionTimeoutEvent(SupplicantConnectionTimeoutEvent *evt) {
LOGD("onConnectionTimeoutEvent(%s)", evt->getBssid());
ALOGD("onConnectionTimeoutEvent(%s)", evt->getBssid());
}
void WifiController::onDisconnectedEvent(SupplicantDisconnectedEvent *evt) {
@ -569,39 +569,39 @@ void WifiController::onDisconnectedEvent(SupplicantDisconnectedEvent *evt) {
#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

View file

@ -51,7 +51,7 @@ WifiNetwork::WifiNetwork(WifiController *c, Supplicant *suppl, const char *data)
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 @@ int WifiNetwork::parseKeyManagementMask(const char *buffer, uint32_t *mask) {
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 @@ int WifiNetwork::parseProtocolsMask(const char *buffer, uint32_t *mask) {
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 @@ int WifiNetwork::parseAuthAlgorithmsMask(const char *buffer, uint32_t *mask) {
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 @@ int WifiNetwork::parsePairwiseCiphersMask(const char *buffer, uint32_t *mask) {
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 @@ int WifiNetwork::parseGroupCiphersMask(const char *buffer, uint32_t *mask) {
char *v_next = v_tmp;
char *v_token;
// LOGD("parseGroupCiphersMask(%s)", buffer);
// ALOGD("parseGroupCiphersMask(%s)", buffer);
*mask = 0;
while((v_token = strsep(&v_next, " "))) {

View file

@ -74,7 +74,7 @@ int WifiScanner::stop() {
}
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 @@ void WifiScanner::run() {
} else if (FD_ISSET(mCtrlPipe[0], &read_fds))
break;
} // while
LOGD("Stopping wifi scanner");
ALOGD("Stopping wifi scanner");
}

View file

@ -68,10 +68,10 @@ void *WifiStatusPoller::threadStart(void *obj) {
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;
}