1*00c7fec1SAndroid Build Coastguard Worker /* 2*00c7fec1SAndroid Build Coastguard Worker * Copyright (C) 2017 The Android Open Source Project 3*00c7fec1SAndroid Build Coastguard Worker * 4*00c7fec1SAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*00c7fec1SAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*00c7fec1SAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*00c7fec1SAndroid Build Coastguard Worker * 8*00c7fec1SAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*00c7fec1SAndroid Build Coastguard Worker * 10*00c7fec1SAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*00c7fec1SAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*00c7fec1SAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*00c7fec1SAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*00c7fec1SAndroid Build Coastguard Worker * limitations under the License. 15*00c7fec1SAndroid Build Coastguard Worker */ 16*00c7fec1SAndroid Build Coastguard Worker 17*00c7fec1SAndroid Build Coastguard Worker #ifndef _INIT_REBOOT_H 18*00c7fec1SAndroid Build Coastguard Worker #define _INIT_REBOOT_H 19*00c7fec1SAndroid Build Coastguard Worker 20*00c7fec1SAndroid Build Coastguard Worker #include <chrono> 21*00c7fec1SAndroid Build Coastguard Worker #include <set> 22*00c7fec1SAndroid Build Coastguard Worker #include <string> 23*00c7fec1SAndroid Build Coastguard Worker 24*00c7fec1SAndroid Build Coastguard Worker namespace android { 25*00c7fec1SAndroid Build Coastguard Worker namespace init { 26*00c7fec1SAndroid Build Coastguard Worker 27*00c7fec1SAndroid Build Coastguard Worker // Like StopServices, but also logs all the services that failed to stop after the provided timeout. 28*00c7fec1SAndroid Build Coastguard Worker // Returns number of violators. 29*00c7fec1SAndroid Build Coastguard Worker int StopServicesAndLogViolations(const std::set<std::string>& services, 30*00c7fec1SAndroid Build Coastguard Worker std::chrono::milliseconds timeout, bool terminate); 31*00c7fec1SAndroid Build Coastguard Worker // Parses and handles a setprop sys.powerctl message. 32*00c7fec1SAndroid Build Coastguard Worker void HandlePowerctlMessage(const std::string& command); 33*00c7fec1SAndroid Build Coastguard Worker 34*00c7fec1SAndroid Build Coastguard Worker bool IsShuttingDown(); 35*00c7fec1SAndroid Build Coastguard Worker } // namespace init 36*00c7fec1SAndroid Build Coastguard Worker } // namespace android 37*00c7fec1SAndroid Build Coastguard Worker 38*00c7fec1SAndroid Build Coastguard Worker #endif 39