| 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>] |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 # Kill if adb_reboot is already running. | 240 # Kill if adb_reboot is already running. |
| 241 device.KillAll('adb_reboot', blocking=True, timeout=2, quiet=True) | 241 device.KillAll('adb_reboot', blocking=True, timeout=2, quiet=True) |
| 242 # Push adb_reboot | 242 # Push adb_reboot |
| 243 logging.info(' Pushing adb_reboot ...') | 243 logging.info(' Pushing adb_reboot ...') |
| 244 adb_reboot = os.path.join(constants.DIR_SOURCE_ROOT, | 244 adb_reboot = os.path.join(constants.DIR_SOURCE_ROOT, |
| 245 'out/%s/adb_reboot' % target) | 245 'out/%s/adb_reboot' % target) |
| 246 device.PushChangedFiles([(adb_reboot, '/data/local/tmp/')]) | 246 device.PushChangedFiles([(adb_reboot, '/data/local/tmp/')]) |
| 247 # Launch adb_reboot | 247 # Launch adb_reboot |
| 248 logging.info(' Launching adb_reboot ...') | 248 logging.info(' Launching adb_reboot ...') |
| 249 device.RunShellCommand( | 249 device.RunShellCommand( |
| 250 [device.GetDevicePieWrapper(), '/data/local/tmp/adb_reboot'], | 250 ['/data/local/tmp/adb_reboot'], |
| 251 check_return=True) | 251 check_return=True) |
| 252 | 252 |
| 253 | 253 |
| 254 def _LaunchHostHeartbeat(): | 254 def _LaunchHostHeartbeat(): |
| 255 # Kill if existing host_heartbeat | 255 # Kill if existing host_heartbeat |
| 256 KillHostHeartbeat() | 256 KillHostHeartbeat() |
| 257 # Launch a new host_heartbeat | 257 # Launch a new host_heartbeat |
| 258 logging.info('Spawning host heartbeat...') | 258 logging.info('Spawning host heartbeat...') |
| 259 subprocess.Popen([os.path.join(constants.DIR_SOURCE_ROOT, | 259 subprocess.Popen([os.path.join(constants.DIR_SOURCE_ROOT, |
| 260 'build/android/host_heartbeat.py')]) | 260 'build/android/host_heartbeat.py')]) |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 args = parser.parse_args() | 319 args = parser.parse_args() |
| 320 constants.SetBuildType(args.target) | 320 constants.SetBuildType(args.target) |
| 321 | 321 |
| 322 run_tests_helper.SetLogLevel(args.verbose) | 322 run_tests_helper.SetLogLevel(args.verbose) |
| 323 | 323 |
| 324 return ProvisionDevices(args) | 324 return ProvisionDevices(args) |
| 325 | 325 |
| 326 | 326 |
| 327 if __name__ == '__main__': | 327 if __name__ == '__main__': |
| 328 sys.exit(main()) | 328 sys.exit(main()) |
| OLD | NEW |