1 /*
2  * Copyright (C) 2020 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 // A consistent problem that automated test labs have is that devices will
20 // gradually fall offline and require manual recovery. For automated testing
21 // labs and similar other uses, adbd contains a watchdog that can be enabled
22 // to reboot the device if no client is connected for a configurable duration.
23 //
24 // To enable it, set the system property `persist.adb.watchdog` to "1".
25 // The timeout can be configured by `persist.adb.watchdog.timeout_secs`,
26 // with a default of 600 seconds.
27 //
28 // Additionally, the watchdog is automatically enabled when the device is in
29 // test harness mode (https://source.android.com/compatibility/cts/harness).
30 // Note that if `persist.adb.watchdog` is set, it will override the default
31 // in test harness mode, and `persist.adb.watchdog.timeout_secs` isn't
32 // preserved across factory reset.
33 
34 #if defined(__ANDROID__)
35 namespace watchdog {
36 
37 void Initialize();
38 void Start();
39 void Stop();
40 
41 }  // namespace watchdog
42 #endif
43