1<!-- Copyright 2016 The Chromium Authors. All rights reserved. 2 Use of this source code is governed by a BSD-style license that can be 3 found in the LICENSE file. 4--> 5 6# Devil: Device Denylist 7 8## What is it? 9 10The device denylist is a per-run list of devices detected to be in a known bad 11state along with the reason they are suspected of being in a bad state (offline, 12not responding, etc). It is stored as a json file. This gets reset every run 13during the device recovery step (currently part of `bb_device_status_check`). 14 15## Bots 16 17On bots, this is normally found at `//out/bad_devices.json`. If you are having 18problems with denylisted devices locally even though a device is in a good 19state, you can safely delete this file. 20 21# Tools for interacting with device deny list. 22 23You can interact with the device denylist via [devil.android.device\_denylist](https://cs.chromium.org/chromium/src/third_party/catapult/devil/devil/android/device_denylist.py). 24This allows for any interaction you would need with a device denylist: 25 26 - Reading 27 - Writing 28 - Extending 29 - Resetting 30 31An example usecase of this is: 32```python 33from devil.android import device_denylist 34 35denylist = device_denylist.Denylist(denylist_path) 36denylisted_devices = denylist.Read() 37for device in denylisted_devices: 38 print 'Device %s is denylisted' % device 39denylist.Reset() 40new_denylist = {'device_id1': {'timestamp': ts, 'reason': reason}} 41denylist.Write(new_denylist) 42denylist.Extend([device_2, device_3], reason='Reason for denylisting') 43``` 44 45 46## Where it is used. 47 48The denylist file path is passed directly to the following scripts in chromium: 49 50 - [test\_runner.py](https://cs.chromium.org/chromium/src/build/android/test_runner.py) 51 - [provision\_devices.py](https://cs.chromium.org/chromium/src/build/android/provision_devices.py) 52 - [bb\_device\_status\_check.py](https://cs.chromium.org/chromium/src/build/android/buildbot/bb_device_status_check.py) 53 54The denylist is also used in the following scripts: 55 56 - [device\_status.py](https://cs.chromium.org/chromium/src/third_party/catapult/devil/devil/android/tools/device_status.py) 57 - [device\_recovery.py](https://cs.chromium.org/chromium/src/third_party/catapult/devil/devil/android/tools/device_recovery.py) 58 59 60