| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """Provisions Android devices with settings required for bots. | 7 """Provisions Android devices with settings required for bots. |
| 8 | 8 |
| 9 Usage: | 9 Usage: |
| 10 ./provision_devices.py [-d <device serial number>] | 10 ./provision_devices.py [-d <device serial number>] |
| 11 """ | 11 """ |
| 12 | 12 |
| 13 import argparse | 13 import argparse |
| 14 import datetime | 14 import datetime |
| 15 import json | 15 import json |
| 16 import logging | 16 import logging |
| 17 import os | 17 import os |
| 18 import posixpath | 18 import posixpath |
| 19 import re | 19 import re |
| 20 import subprocess | 20 import subprocess |
| 21 import sys | 21 import sys |
| 22 import time | 22 import time |
| 23 | 23 |
| 24 from devil.android import battery_utils |
| 25 from devil.android import device_blacklist |
| 26 from devil.android import device_errors |
| 27 from devil.android import device_utils |
| 24 from devil.android.sdk import version_codes | 28 from devil.android.sdk import version_codes |
| 25 | 29 from devil.utils import run_tests_helper |
| 30 from devil.utils import timeout_retry |
| 26 from pylib import constants | 31 from pylib import constants |
| 27 from pylib import device_settings | 32 from pylib import device_settings |
| 28 from pylib.device import battery_utils | |
| 29 from pylib.device import device_blacklist | |
| 30 from pylib.device import device_errors | |
| 31 from pylib.device import device_utils | |
| 32 from pylib.utils import run_tests_helper | |
| 33 from pylib.utils import timeout_retry | |
| 34 | 33 |
| 35 _SYSTEM_WEBVIEW_PATHS = ['/system/app/webview', '/system/app/WebViewGoogle'] | 34 _SYSTEM_WEBVIEW_PATHS = ['/system/app/webview', '/system/app/WebViewGoogle'] |
| 36 _CHROME_PACKAGE_REGEX = re.compile('.*chrom.*') | 35 _CHROME_PACKAGE_REGEX = re.compile('.*chrom.*') |
| 37 _TOMBSTONE_REGEX = re.compile('tombstone.*') | 36 _TOMBSTONE_REGEX = re.compile('tombstone.*') |
| 38 | 37 |
| 39 | 38 |
| 40 class _DEFAULT_TIMEOUTS(object): | 39 class _DEFAULT_TIMEOUTS(object): |
| 41 # L can take a while to reboot after a wipe. | 40 # L can take a while to reboot after a wipe. |
| 42 LOLLIPOP = 600 | 41 LOLLIPOP = 600 |
| 43 PRE_LOLLIPOP = 180 | 42 PRE_LOLLIPOP = 180 |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 args = parser.parse_args() | 450 args = parser.parse_args() |
| 452 constants.SetBuildType(args.target) | 451 constants.SetBuildType(args.target) |
| 453 | 452 |
| 454 run_tests_helper.SetLogLevel(args.verbose) | 453 run_tests_helper.SetLogLevel(args.verbose) |
| 455 | 454 |
| 456 return ProvisionDevices(args) | 455 return ProvisionDevices(args) |
| 457 | 456 |
| 458 | 457 |
| 459 if __name__ == '__main__': | 458 if __name__ == '__main__': |
| 460 sys.exit(main()) | 459 sys.exit(main()) |
| OLD | NEW |