From db8877463118b91e6db722187be9c14eee7003a1 Mon Sep 17 00:00:00 2001 From: Steve Paik Date: Wed, 20 Dec 2017 15:09:21 -0800 Subject: [PATCH] Convert autosuspend_wakeup_count.c to cpp Change this file to cpp before cleaning it up. Bug: 70669809 Test: Suspend works Change-Id: Ice927dbb205447a94f33b417e32f7c2cd79613eb --- libsuspend/Android.bp | 2 +- libsuspend/autosuspend_ops.h | 2 ++ ...osuspend_wakeup_count.c => autosuspend_wakeup_count.cpp} | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) rename libsuspend/{autosuspend_wakeup_count.c => autosuspend_wakeup_count.cpp} (97%) diff --git a/libsuspend/Android.bp b/libsuspend/Android.bp index 32f1e1ff8..fa06dc45f 100644 --- a/libsuspend/Android.bp +++ b/libsuspend/Android.bp @@ -9,7 +9,7 @@ cc_library { srcs: [ "autosuspend.c", - "autosuspend_wakeup_count.c", + "autosuspend_wakeup_count.cpp", ], export_include_dirs: ["include"], local_include_dirs: ["include"], diff --git a/libsuspend/autosuspend_ops.h b/libsuspend/autosuspend_ops.h index 2f435d97f..357b82827 100644 --- a/libsuspend/autosuspend_ops.h +++ b/libsuspend/autosuspend_ops.h @@ -23,6 +23,8 @@ struct autosuspend_ops { void (*set_wakeup_callback)(void (*func)(bool success)); }; +__BEGIN_DECLS struct autosuspend_ops *autosuspend_wakeup_count_init(void); +__END_DECLS #endif diff --git a/libsuspend/autosuspend_wakeup_count.c b/libsuspend/autosuspend_wakeup_count.cpp similarity index 97% rename from libsuspend/autosuspend_wakeup_count.c rename to libsuspend/autosuspend_wakeup_count.cpp index 81cb44cd9..30f842738 100644 --- a/libsuspend/autosuspend_wakeup_count.c +++ b/libsuspend/autosuspend_wakeup_count.cpp @@ -21,8 +21,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -68,8 +68,8 @@ static void* suspend_thread_func(void* arg __attribute__((unused))) { success = false; 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))); + 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", SYS_POWER_WAKEUP_COUNT, buf);