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

Unified Diff: build/android/provision_devices.py

Issue 413523006: Don't wipe data when provisioning non-rooted devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 86ef9849e7a963af96842bcaefae9204de695cf4..2c56b5817a65055abadb902fc16b1f5c9413ab4b 100755
--- a/build/android/provision_devices.py
+++ b/build/android/provision_devices.py
@@ -136,6 +136,24 @@ def WipeDeviceData(device):
as_root=True)
+def WipeDevicesIfPossible(devices):
+ devices_to_reboot = []
+ for device_serial in devices:
+ device = device_utils.DeviceUtils(device_serial)
+ if not device.old_interface.EnableAdbRoot():
+ continue
+ WipeDeviceData(device)
+ devices_to_reboot.append(device)
+
+ if devices_to_reboot:
+ try:
+ device_utils.DeviceUtils.parallel(devices_to_reboot).Reboot(True)
+ except errors.DeviceUnresponsiveError:
+ pass
+ for device_serial in devices_to_reboot:
+ device.WaitUntilFullyBooted(timeout=90)
+
+
def ProvisionDevices(options):
is_perf = 'perf' in os.environ.get('BUILDBOT_BUILDERNAME', '').lower()
# TODO(jbudorick): Parallelize provisioning of all attached devices after
@@ -147,16 +165,7 @@ def ProvisionDevices(options):
# 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).Reboot(True)
- except errors.DeviceUnresponsiveError:
- pass
- for device_serial in devices:
- device.WaitUntilFullyBooted(timeout=90)
+ WipeDevicesIfPossible(devices)
# Provision devices
for device_serial in devices:
« 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