By setting /proc/sys/kernel/ctrl-alt-del to 1, kernel will trap
ctrl-alt-del event and send a SIGINT signal to init.
Start the ctrl-alt-del service on receiving the signal.
#include <cutils/android_reboot.h>
#include "capabilities.h"
+#include "init.h"
namespace android {
namespace init {
#endif
sigaction(SIGSYS, &action, nullptr);
sigaction(SIGTRAP, &action, nullptr);
+
+ action.sa_handler = [](int sig) {
+ LOG(INFO) << "Got ctrl-alt-del: " << sig;
+ HandleControlMessage("start", "ctrl-alt-del", getpid());
+ };
+ sigaction(SIGINT, &action, nullptr);
}
} // namespace init