blob: 777b0d3b820fd4ef2fd30535f360073651026dba [file] [log] [blame]
Josh Gao2dc61962021-02-03 22:11:45 -08001/*
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__)
35namespace watchdog {
36
37void Initialize();
38void Start();
39void Stop();
40
41} // namespace watchdog
42#endif