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

Unified Diff: build/android/provision_devices.py

Issue 2059863002: [Android] Fix provision devices failure getting timeout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made reboot_timeout an arg. Created 4 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 5a8019f31a973862e7e17fb42db642a7d97ba521..e352f5b9934d5a91fbc8fcf72739f6591319fc72 100755
--- a/build/android/provision_devices.py
+++ b/build/android/provision_devices.py
@@ -89,17 +89,10 @@ def ProvisionDevices(args):
def ProvisionDevice(device, blacklist, options):
- if options.reboot_timeout:
- reboot_timeout = options.reboot_timeout
- elif device.build_version_sdk >= version_codes.LOLLIPOP:
- reboot_timeout = _DEFAULT_TIMEOUTS.LOLLIPOP
- else:
- reboot_timeout = _DEFAULT_TIMEOUTS.PRE_LOLLIPOP
-
def should_run_phase(phase_name):
return not options.phases or phase_name in options.phases
- def run_phase(phase_func, reboot=True):
+ def run_phase(phase_func, reboot_timeout, reboot=True):
try:
device.WaitUntilFullyBooted(timeout=reboot_timeout, retries=0)
except device_errors.CommandTimeoutError:
@@ -111,18 +104,25 @@ def ProvisionDevice(device, blacklist, options):
device.adb.WaitForDevice()
try:
+ if options.reboot_timeout:
+ reboot_timeout = options.reboot_timeout
+ elif device.build_version_sdk >= version_codes.LOLLIPOP:
+ reboot_timeout = _DEFAULT_TIMEOUTS.LOLLIPOP
+ else:
+ reboot_timeout = _DEFAULT_TIMEOUTS.PRE_LOLLIPOP
+
if should_run_phase(_PHASES.WIPE):
if (options.chrome_specific_wipe or device.IsUserBuild() or
device.build_version_sdk >= version_codes.MARSHMALLOW):
- run_phase(WipeChromeData)
+ run_phase(WipeChromeData, reboot_timeout)
else:
- run_phase(WipeDevice)
+ run_phase(WipeDevice, reboot_timeout)
if should_run_phase(_PHASES.PROPERTIES):
- run_phase(SetProperties)
+ run_phase(SetProperties, reboot_timeout)
if should_run_phase(_PHASES.FINISH):
- run_phase(FinishProvisioning, reboot=False)
+ run_phase(FinishProvisioning, reboot_timeout, reboot=False)
if options.chrome_specific_wipe:
package = "com.google.android.gms"
« 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