Chromium Code Reviews| Index: build/android/provision_devices.py |
| diff --git a/build/android/provision_devices.py b/build/android/provision_devices.py |
| index d282737f0a177a4a095eddc9bf7973fde1a40b19..08805363495ce7687c7f424b0dd34af42c3a84e2 100755 |
| --- a/build/android/provision_devices.py |
| +++ b/build/android/provision_devices.py |
| @@ -129,15 +129,6 @@ def ProvisionDevices(options): |
| for device_serial in devices: |
| device = device_utils.DeviceUtils(device_serial) |
| device.old_interface.EnableAdbRoot() |
| - WipeDeviceData(device) |
| - try: |
| - device_utils.DeviceUtils.parallel(devices).old_interface.Reboot(True) |
| - except errors.DeviceUnresponsiveError: |
| - pass |
| - for device_serial in devices: |
| - device = device_utils.DeviceUtils(device_serial) |
| - device.WaitUntilFullyBooted(timeout=90) |
| - device.old_interface.EnableAdbRoot() |
| _ConfigureLocalProperties(device) |
| device_settings.ConfigureContentSettingsDict( |
| device, device_settings.DETERMINISTIC_DEVICE_SETTINGS) |
| @@ -165,8 +156,8 @@ def main(argv): |
| logging.basicConfig(level=logging.INFO) |
| parser = optparse.OptionParser() |
| - parser.add_option('-w', '--wipe', action='store_true', |
| - help='Wipe device data from all attached devices.') |
| + parser.add_option('--skip-wipe', action='store_true', default=False, |
| + help="Don't wipe device data during provisioning.") |
| parser.add_option('-d', '--device', |
| help='The serial number of the device to be provisioned') |
| parser.add_option('-t', '--target', default='Debug', help='The build target') |
| @@ -180,18 +171,23 @@ def main(argv): |
| print >> sys.stderr, 'Unused args %s' % args |
| return 1 |
| - if options.wipe: |
| - devices = android_commands.GetAttachedDevices() |
| + if not options.skip_wipe: |
| + if options.device is not None: |
| + devices = [options.device] |
| + else: |
| + devices = android_commands.GetAttachedDevices() |
| for device_serial in devices: |
| device = device_utils.DeviceUtils(device_serial) |
| + device.old_interface.EnableAdbRoot() |
| WipeDeviceData(device) |
| try: |
| - (device_utils.DeviceUtils.parallel(devices) |
| - .old_interface.Reboot(True).pFinish(None)) |
| + device_utils.DeviceUtils.parallel(devices).old_interface.Reboot(True) |
| except errors.DeviceUnresponsiveError: |
| pass |
| - else: |
| - ProvisionDevices(options) |
| + for device_serial in devices: |
| + device.WaitUntilFullyBooted(timeout=90) |
| + |
| + ProvisionDevices(options) |
|
dnj
2014/06/12 01:14:02
Sorry, I should have noticed this last time. You a
jbudorick
2014/06/12 01:20:10
Either this or move the wiping logic into Provisio
navabi
2014/06/12 18:17:30
Done. Good suggestions.
|
| if __name__ == '__main__': |