| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 # running at all. | 65 # running at all. |
| 66 device.KillAll('adb_reboot', blocking=True, timeout=2, retries=0) | 66 device.KillAll('adb_reboot', blocking=True, timeout=2, retries=0) |
| 67 except device_errors.CommandFailedError: | 67 except device_errors.CommandFailedError: |
| 68 # We can safely ignore the exception because we don't expect adb_reboot | 68 # We can safely ignore the exception because we don't expect adb_reboot |
| 69 # to be running. | 69 # to be running. |
| 70 pass | 70 pass |
| 71 # Push adb_reboot | 71 # Push adb_reboot |
| 72 logging.info(' Pushing adb_reboot ...') | 72 logging.info(' Pushing adb_reboot ...') |
| 73 adb_reboot = os.path.join(constants.DIR_SOURCE_ROOT, | 73 adb_reboot = os.path.join(constants.DIR_SOURCE_ROOT, |
| 74 'out/%s/adb_reboot' % target) | 74 'out/%s/adb_reboot' % target) |
| 75 device.PushChangedFiles([(adb_reboot, '/data/local/tmp/')]) | 75 device.PushChangedFiles(adb_reboot, '/data/local/tmp/') |
| 76 # Launch adb_reboot | 76 # Launch adb_reboot |
| 77 logging.info(' Launching adb_reboot ...') | 77 logging.info(' Launching adb_reboot ...') |
| 78 device.old_interface.GetAndroidToolStatusAndOutput( | 78 device.old_interface.GetAndroidToolStatusAndOutput( |
| 79 '/data/local/tmp/adb_reboot') | 79 '/data/local/tmp/adb_reboot') |
| 80 | 80 |
| 81 | 81 |
| 82 def _ConfigureLocalProperties(device, is_perf): | 82 def _ConfigureLocalProperties(device, is_perf): |
| 83 """Set standard readonly testing device properties prior to reboot.""" | 83 """Set standard readonly testing device properties prior to reboot.""" |
| 84 local_props = [ | 84 local_props = [ |
| 85 'persist.sys.usb.config=adb', | 85 'persist.sys.usb.config=adb', |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 | 249 |
| 250 if args: | 250 if args: |
| 251 print >> sys.stderr, 'Unused args %s' % args | 251 print >> sys.stderr, 'Unused args %s' % args |
| 252 return 1 | 252 return 1 |
| 253 | 253 |
| 254 return ProvisionDevices(options) | 254 return ProvisionDevices(options) |
| 255 | 255 |
| 256 | 256 |
| 257 if __name__ == '__main__': | 257 if __name__ == '__main__': |
| 258 sys.exit(main(sys.argv)) | 258 sys.exit(main(sys.argv)) |
| OLD | NEW |