int SensorBase::open()
{
mFd = ::open(mDevPath.c_str(), O_RDONLY);
- LOGE_IF(mFd < 0, "%s: device %s err:%d", __func__, mDevPath.c_str(), -errno);
- LOGV("%s: device path:%s, fd:%d", __func__, mDevPath.c_str(), mFd);
+ ALOGE_IF(mFd < 0, "%s: device %s err:%d", __func__, mDevPath.c_str(), -errno);
+ ALOGV("%s: device path:%s, fd:%d", __func__, mDevPath.c_str(), mFd);
return mFd;
}
{
int ret = ::close(mFd);
mFd = -1;
- LOGV("%s: device path:%s, fd:%d", __func__, mDevPath.c_str(), mFd);
+ ALOGV("%s: device path:%s, fd:%d", __func__, mDevPath.c_str(), mFd);
}
count--;
numEventReceived++;
}
- LOGV("%s:%s:, in type = EV_SYN, after, count = %d, numEventReceived = %d, mEnabled = %d",
+ ALOGV("%s:%s:, in type = EV_SYN, after, count = %d, numEventReceived = %d, mEnabled = %d",
__func__, mDevPath.c_str(), count, numEventReceived, mEnabled);
}
if (fd < 0)
continue;
- LOGV("%s: probing path %s against %s", __func__, (dev + "/" + de->d_name).c_str(), inputName.c_str());
+ ALOGV("%s: probing path %s against %s", __func__, (dev + "/" + de->d_name).c_str(), inputName.c_str());
char readName[80];
if (ioctl(fd, EVIOCGNAME(sizeof(readName) - 1), &readName) < 1)
readName[0] = '\0';
if (inputName.compare(readName) == 0) {
foundPath = (dev + "/" + de->d_name);
found = true;
- LOGV("%s: found %s", __func__, foundPath.c_str());
+ ALOGV("%s: found %s", __func__, foundPath.c_str());
break;
}
}
closedir(dir);
- LOGE_IF(!found, "couldn't find '%s' input device", inputName.c_str());
+ ALOGE_IF(!found, "couldn't find '%s' input device", inputName.c_str());
return found;
}
int wakeFds[2];
int result = pipe(wakeFds);
- LOGE_IF(result<0, "error creating wake pipe (%s)", strerror(errno));
+ ALOGE_IF(result<0, "error creating wake pipe (%s)", strerror(errno));
fcntl(wakeFds[0], F_SETFL, O_NONBLOCK);
fcntl(wakeFds[1], F_SETFL, O_NONBLOCK);
mWritePipeFd = wakeFds[1];
int index = BoardConfig::handleToDriver(handle);
if (index < 0) return index;
- LOGD("%s: %s sensor %d", __func__, enabled?"enable":"disable", index);
+ ALOGD("%s: %s sensor %d", __func__, enabled?"enable":"disable", index);
SensorBase* const s(mSensors[index]);
int err = 0;
if (enabled) {
if (((err = s->open()) > 0) && (err = s->enable(1)) == 0) {
const char wakeMessage(WAKE_MESSAGE);
int result = write(mWritePipeFd, &wakeMessage, 1);
- LOGE_IF(result<0, "error sending wake message (%s)", strerror(errno));
+ ALOGE_IF(result<0, "error sending wake message (%s)", strerror(errno));
} else
s->close();
} else {
mPollFds[i].revents = 0;
if (nb < 0) {
- LOGD("%s: handle:%d error:%d", __func__, i, nb);
+ ALOGD("%s: handle:%d error:%d", __func__, i, nb);
continue;
}
}
// anything to return
n = poll(mPollFds, numFds, nbEvents ? 0 : POLL_TIMEOUT_MSEC);
if (n<0) {
- LOGE("poll() failed (%s)", strerror(errno));
+ ALOGE("poll() failed (%s)", strerror(errno));
return -errno;
}
if (mPollFds[wake].revents & POLLIN) {
char msg;
int result = read(mPollFds[wake].fd, &msg, 1);
- LOGE_IF(result<0, "error reading from wake pipe (%s)", strerror(errno));
- LOGE_IF(msg != WAKE_MESSAGE, "unknown message on wake queue (0x%02x)", int(msg));
+ ALOGE_IF(result<0, "error reading from wake pipe (%s)", strerror(errno));
+ ALOGE_IF(msg != WAKE_MESSAGE, "unknown message on wake queue (0x%02x)", int(msg));
mPollFds[wake].revents = 0;
}
}