Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3399)

Unified Diff: build/android/provision_devices.py

Issue 334503002: Refactor wipe option to wipe on default and have option to skip wipe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tried to rebase. Didn't pull change I expected. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/provision_devices.py
diff --git a/build/android/provision_devices.py b/build/android/provision_devices.py
index c4f8f340d5f23817464f13dc56caf042867544f4..8433e01d7bec58ee6b781346544b2782ec14ac3b 100755
--- a/build/android/provision_devices.py
+++ b/build/android/provision_devices.py
@@ -126,18 +126,24 @@ def ProvisionDevices(options):
devices = [options.device]
else:
devices = android_commands.GetAttachedDevices()
+
+ # Wipe devices (unless --skip-wipe was specified)
+ if not options.skip_wipe:
+ 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.WaitUntilFullyBooted(timeout=90)
+
+ # Provision devices
for device_serial in devices:
device = device_utils.DeviceUtils(device_serial)
device.old_interface.EnableAdbRoot()
- WipeDeviceData(device)
- try:
- device_utils.DeviceUtils.parallel(devices).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 +171,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,17 +186,7 @@ def main(argv):
print >> sys.stderr, 'Unused args %s' % args
return 1
- if options.wipe:
- devices = android_commands.GetAttachedDevices()
- for device_serial in devices:
- device = device_utils.DeviceUtils(device_serial)
- WipeDeviceData(device)
- try:
- device_utils.DeviceUtils.parallel(devices).Reboot(True)
- except errors.DeviceUnresponsiveError:
- pass
- else:
- ProvisionDevices(options)
+ ProvisionDevices(options)
if __name__ == '__main__':
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698