Merge "Fix LOG() messages to drop \n"
am: 3fca67514a
Change-Id: I666cd47c924f5d6f767517bc3c9631907fb44f5e
diff --git a/libsuspend/autosuspend.c b/libsuspend/autosuspend.c
index 96e1c10..1d6c434 100644
--- a/libsuspend/autosuspend.c
+++ b/libsuspend/autosuspend.c
@@ -40,14 +40,14 @@
}
if (!autosuspend_ops) {
- ALOGE("failed to initialize autosuspend\n");
+ ALOGE("failed to initialize autosuspend");
return -1;
}
out:
autosuspend_inited = true;
- ALOGV("autosuspend initialized\n");
+ ALOGV("autosuspend initialized");
return 0;
}
@@ -60,7 +60,7 @@
return ret;
}
- ALOGV("autosuspend_enable\n");
+ ALOGV("autosuspend_enable");
if (autosuspend_enabled) {
return 0;
@@ -84,7 +84,7 @@
return ret;
}
- ALOGV("autosuspend_disable\n");
+ ALOGV("autosuspend_disable");
if (!autosuspend_enabled) {
return 0;
diff --git a/libsuspend/autosuspend_wakeup_count.c b/libsuspend/autosuspend_wakeup_count.c
index 2da204a..0a172be 100644
--- a/libsuspend/autosuspend_wakeup_count.c
+++ b/libsuspend/autosuspend_wakeup_count.c
@@ -67,36 +67,36 @@
update_sleep_time(success);
usleep(sleep_time);
success = false;
- ALOGV("%s: read wakeup_count\n", __func__);
+ ALOGV("%s: read wakeup_count", __func__);
lseek(wakeup_count_fd, 0, SEEK_SET);
wakeup_count_len = TEMP_FAILURE_RETRY(read(wakeup_count_fd, wakeup_count,
sizeof(wakeup_count)));
if (wakeup_count_len < 0) {
strerror_r(errno, buf, sizeof(buf));
- ALOGE("Error reading from %s: %s\n", SYS_POWER_WAKEUP_COUNT, buf);
+ ALOGE("Error reading from %s: %s", SYS_POWER_WAKEUP_COUNT, buf);
wakeup_count_len = 0;
continue;
}
if (!wakeup_count_len) {
- ALOGE("Empty wakeup count\n");
+ ALOGE("Empty wakeup count");
continue;
}
- ALOGV("%s: wait\n", __func__);
+ ALOGV("%s: wait", __func__);
ret = sem_wait(&suspend_lockout);
if (ret < 0) {
strerror_r(errno, buf, sizeof(buf));
- ALOGE("Error waiting on semaphore: %s\n", buf);
+ ALOGE("Error waiting on semaphore: %s", buf);
continue;
}
- ALOGV("%s: write %*s to wakeup_count\n", __func__, wakeup_count_len, wakeup_count);
+ ALOGV("%s: write %*s to wakeup_count", __func__, wakeup_count_len, wakeup_count);
ret = TEMP_FAILURE_RETRY(write(wakeup_count_fd, wakeup_count, wakeup_count_len));
if (ret < 0) {
strerror_r(errno, buf, sizeof(buf));
- ALOGE("Error writing to %s: %s\n", SYS_POWER_WAKEUP_COUNT, buf);
+ ALOGE("Error writing to %s: %s", SYS_POWER_WAKEUP_COUNT, buf);
} else {
- ALOGV("%s: write %s to %s\n", __func__, sleep_state, SYS_POWER_STATE);
+ ALOGV("%s: write %s to %s", __func__, sleep_state, SYS_POWER_STATE);
ret = TEMP_FAILURE_RETRY(write(state_fd, sleep_state, strlen(sleep_state)));
if (ret >= 0) {
success = true;
@@ -107,11 +107,11 @@
}
}
- ALOGV("%s: release sem\n", __func__);
+ ALOGV("%s: release sem", __func__);
ret = sem_post(&suspend_lockout);
if (ret < 0) {
strerror_r(errno, buf, sizeof(buf));
- ALOGE("Error releasing semaphore: %s\n", buf);
+ ALOGE("Error releasing semaphore: %s", buf);
}
}
return NULL;
@@ -122,16 +122,16 @@
char buf[80];
int ret;
- ALOGV("autosuspend_wakeup_count_enable\n");
+ ALOGV("autosuspend_wakeup_count_enable");
ret = sem_post(&suspend_lockout);
if (ret < 0) {
strerror_r(errno, buf, sizeof(buf));
- ALOGE("Error changing semaphore: %s\n", buf);
+ ALOGE("Error changing semaphore: %s", buf);
}
- ALOGV("autosuspend_wakeup_count_enable done\n");
+ ALOGV("autosuspend_wakeup_count_enable done");
return ret;
}
@@ -141,16 +141,16 @@
char buf[80];
int ret;
- ALOGV("autosuspend_wakeup_count_disable\n");
+ ALOGV("autosuspend_wakeup_count_disable");
ret = sem_wait(&suspend_lockout);
if (ret < 0) {
strerror_r(errno, buf, sizeof(buf));
- ALOGE("Error changing semaphore: %s\n", buf);
+ ALOGE("Error changing semaphore: %s", buf);
}
- ALOGV("autosuspend_wakeup_count_disable done\n");
+ ALOGV("autosuspend_wakeup_count_disable done");
return ret;
}
@@ -177,31 +177,31 @@
state_fd = TEMP_FAILURE_RETRY(open(SYS_POWER_STATE, O_RDWR));
if (state_fd < 0) {
strerror_r(errno, buf, sizeof(buf));
- ALOGE("Error opening %s: %s\n", SYS_POWER_STATE, buf);
+ ALOGE("Error opening %s: %s", SYS_POWER_STATE, buf);
goto err_open_state;
}
wakeup_count_fd = TEMP_FAILURE_RETRY(open(SYS_POWER_WAKEUP_COUNT, O_RDWR));
if (wakeup_count_fd < 0) {
strerror_r(errno, buf, sizeof(buf));
- ALOGE("Error opening %s: %s\n", SYS_POWER_WAKEUP_COUNT, buf);
+ ALOGE("Error opening %s: %s", SYS_POWER_WAKEUP_COUNT, buf);
goto err_open_wakeup_count;
}
ret = sem_init(&suspend_lockout, 0, 0);
if (ret < 0) {
strerror_r(errno, buf, sizeof(buf));
- ALOGE("Error creating semaphore: %s\n", buf);
+ ALOGE("Error creating semaphore: %s", buf);
goto err_sem_init;
}
ret = pthread_create(&suspend_thread, NULL, suspend_thread_func, NULL);
if (ret) {
strerror_r(ret, buf, sizeof(buf));
- ALOGE("Error creating thread: %s\n", buf);
+ ALOGE("Error creating thread: %s", buf);
goto err_pthread_create;
}
- ALOGI("Selected wakeup count\n");
+ ALOGI("Selected wakeup count");
return &autosuspend_wakeup_count_ops;
err_pthread_create: