Chromium Code Reviews| Index: build/android/provision_devices.py |
| diff --git a/build/android/provision_devices.py b/build/android/provision_devices.py |
| index 2bde2b5ff2dfcf1a43966c6be923286ff3c80b25..b1fb4b8f2ccb2ad6b7ca039a223a4db9e94367b0 100755 |
| --- a/build/android/provision_devices.py |
| +++ b/build/android/provision_devices.py |
| @@ -26,6 +26,7 @@ from devil.android import device_blacklist |
| from devil.android import device_errors |
| from devil.android import device_temp_file |
| from devil.android import device_utils |
| +from devil.android.sdk import keyevent |
| from devil.android.sdk import version_codes |
| from devil.utils import run_tests_helper |
| from devil.utils import timeout_retry |
| @@ -103,7 +104,9 @@ def ProvisionDevice(device, blacklist, options): |
| try: |
| if should_run_phase(_PHASES.WIPE): |
| - if options.chrome_specific_wipe: |
| + if device.IsUserBuild(): |
|
jbudorick
2015/11/21 02:37:13
This shouldn't preempt the chrome-specific wipe, w
bpastene
2015/11/23 20:01:50
Not entirely. I moved what I could into an if_user
|
| + logging.warning('Cannot wipe data in user builds.') |
| + elif options.chrome_specific_wipe: |
| run_phase(WipeChromeData) |
| else: |
| run_phase(WipeDevice) |
| @@ -246,7 +249,10 @@ def SetProperties(device, options): |
| except device_errors.CommandFailedError as e: |
| logging.warning(str(e)) |
| - _ConfigureLocalProperties(device, options.enable_java_debug) |
| + if not device.IsUserBuild(): |
| + _ConfigureLocalProperties(device, options.enable_java_debug) |
| + else: |
| + logging.warning('Cannot configure properties in user builds.') |
| device_settings.ConfigureContentSettings( |
| device, device_settings.DETERMINISTIC_DEVICE_SETTINGS) |
| if options.disable_location: |
| @@ -311,6 +317,11 @@ def _ConfigureLocalProperties(device, java_debug=True): |
| def FinishProvisioning(device, options): |
| + # The lockscreen can't be disabled on user builds, so send a keyevent |
| + # to unlock it. |
| + if device.IsUserBuild(): |
| + device.SendKeyEvent(keyevent.KEYCODE_MENU) |
| + |
| if options.min_battery_level is not None: |
| try: |
| battery = battery_utils.BatteryUtils(device) |
| @@ -351,8 +362,9 @@ def FinishProvisioning(device, options): |
| return False |
| # Sometimes the date is not set correctly on the devices. Retry on failure. |
| - if not timeout_retry.WaitFor(_set_and_verify_date, wait_period=1, |
| - max_tries=2): |
| + # TODO(bpastene): Figure out how to set the date & time on user builds. |
| + if not device.IsUserBuild() and not timeout_retry.WaitFor( |
|
jbudorick
2015/11/21 02:37:13
nit: since this is going to be changed when you fi
bpastene
2015/11/23 20:01:50
Done.
|
| + _set_and_verify_date, wait_period=1, max_tries=2): |
| raise device_errors.CommandFailedError( |
| 'Failed to set date & time.', device_serial=str(device)) |