summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Paik2017-12-20 17:09:21 -0600
committerSteve Paik2017-12-20 19:02:31 -0600
commitdb8877463118b91e6db722187be9c14eee7003a1 (patch)
treecf9e55fc30271717f8c914aa6e12954726f8c736 /libsuspend
parentdbbba76f88d6a5d06696acd8369548f9cf7946ab (diff)
downloadplatform-system-core-db8877463118b91e6db722187be9c14eee7003a1.tar.gz
platform-system-core-db8877463118b91e6db722187be9c14eee7003a1.tar.xz
platform-system-core-db8877463118b91e6db722187be9c14eee7003a1.zip
Convert autosuspend_wakeup_count.c to cpp
Change this file to cpp before cleaning it up. Bug: 70669809 Test: Suspend works Change-Id: Ice927dbb205447a94f33b417e32f7c2cd79613eb
Diffstat (limited to 'libsuspend')
-rw-r--r--libsuspend/Android.bp2
-rw-r--r--libsuspend/autosuspend_ops.h2
-rw-r--r--libsuspend/autosuspend_wakeup_count.cpp (renamed from libsuspend/autosuspend_wakeup_count.c)6
3 files changed, 6 insertions, 4 deletions
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 {
9 9
10 srcs: [ 10 srcs: [
11 "autosuspend.c", 11 "autosuspend.c",
12 "autosuspend_wakeup_count.c", 12 "autosuspend_wakeup_count.cpp",
13 ], 13 ],
14 export_include_dirs: ["include"], 14 export_include_dirs: ["include"],
15 local_include_dirs: ["include"], 15 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 {
23 void (*set_wakeup_callback)(void (*func)(bool success)); 23 void (*set_wakeup_callback)(void (*func)(bool success));
24}; 24};
25 25
26__BEGIN_DECLS
26struct autosuspend_ops *autosuspend_wakeup_count_init(void); 27struct autosuspend_ops *autosuspend_wakeup_count_init(void);
28__END_DECLS
27 29
28#endif 30#endif
diff --git a/libsuspend/autosuspend_wakeup_count.c b/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 @@
21#include <fcntl.h> 21#include <fcntl.h>
22#include <pthread.h> 22#include <pthread.h>
23#include <semaphore.h> 23#include <semaphore.h>
24#include <stddef.h>
25#include <stdbool.h> 24#include <stdbool.h>
25#include <stddef.h>
26#include <string.h> 26#include <string.h>
27#include <sys/param.h> 27#include <sys/param.h>
28#include <sys/stat.h> 28#include <sys/stat.h>
@@ -68,8 +68,8 @@ static void* suspend_thread_func(void* arg __attribute__((unused))) {
68 success = false; 68 success = false;
69 ALOGV("%s: read wakeup_count", __func__); 69 ALOGV("%s: read wakeup_count", __func__);
70 lseek(wakeup_count_fd, 0, SEEK_SET); 70 lseek(wakeup_count_fd, 0, SEEK_SET);
71 wakeup_count_len = TEMP_FAILURE_RETRY(read(wakeup_count_fd, wakeup_count, 71 wakeup_count_len =
72 sizeof(wakeup_count))); 72 TEMP_FAILURE_RETRY(read(wakeup_count_fd, wakeup_count, sizeof(wakeup_count)));
73 if (wakeup_count_len < 0) { 73 if (wakeup_count_len < 0) {
74 strerror_r(errno, buf, sizeof(buf)); 74 strerror_r(errno, buf, sizeof(buf));
75 ALOGE("Error reading from %s: %s", SYS_POWER_WAKEUP_COUNT, buf); 75 ALOGE("Error reading from %s: %s", SYS_POWER_WAKEUP_COUNT, buf);