Merge b10f47275d9b0ad64e95cc855ce6d47494562471 on remote branch
Change-Id: I2741b9d7319d296f3cad26988474c216f03d00e7
diff --git a/suspend/1.0/default/SuspendControlService.cpp b/suspend/1.0/default/SuspendControlService.cpp
index 2a4748b..671f3dd 100644
--- a/suspend/1.0/default/SuspendControlService.cpp
+++ b/suspend/1.0/default/SuspendControlService.cpp
@@ -18,6 +18,7 @@
#include <android-base/logging.h>
#include <android-base/stringprintf.h>
+#include <signal.h>
#include "SystemSuspend.h"
@@ -29,6 +30,10 @@
namespace suspend {
namespace V1_0 {
+static void register_sig_handler() {
+ signal(SIGPIPE, SIG_IGN);
+}
+
template <typename T>
binder::Status retOk(const T& value, T* ret_val) {
*ret_val = value;
@@ -113,6 +118,8 @@
}
status_t SuspendControlService::dump(int fd, const Vector<String16>& args) {
+ register_sig_handler();
+
const auto suspendService = mSuspend.promote();
if (!suspendService) {
return DEAD_OBJECT;