summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-07-14 23:08:18 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-07-14 23:08:18 +0000
commite7a2ecfac49bc8a546a5167b4a5b7598e7a8cfd3 (patch)
tree50b99c4ffca0c40245fbd42f45dec7391a1a7eba
parent4a79773e31395b7359a1892b3822024e5800f6dd (diff)
parenta2fe15bf96c8bb88c174ac61eab6c013a04332c4 (diff)
downloadinterfaces-android11-qpr1-s2-release.tar.gz
Change-Id: I162a63c8a378f83ea74b7bab02a81b86b7734b2c
-rw-r--r--suspend/1.0/default/SuspendControlService.cpp7
1 files changed, 7 insertions, 0 deletions
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 system {
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 @@ static std::string dumpUsage() {
}
status_t SuspendControlService::dump(int fd, const Vector<String16>& args) {
+ register_sig_handler();
+
const auto suspendService = mSuspend.promote();
if (!suspendService) {
return DEAD_OBJECT;