Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """Provisions Android devices with settings required for bots. | 7 """Provisions Android devices with settings required for bots. |
| 8 | 8 |
| 9 Usage: | 9 Usage: |
| 10 ./provision_devices.py [-d <device serial number>] | 10 ./provision_devices.py [-d <device serial number>] |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 289 device_settings.ConfigureContentSettings( | 289 device_settings.ConfigureContentSettings( |
| 290 device, device_settings.NETWORK_DISABLED_SETTINGS) | 290 device, device_settings.NETWORK_DISABLED_SETTINGS) |
| 291 | 291 |
| 292 if options.disable_system_chrome: | 292 if options.disable_system_chrome: |
| 293 # The system chrome version on the device interferes with some tests. | 293 # The system chrome version on the device interferes with some tests. |
| 294 device.RunShellCommand(['pm', 'disable', 'com.android.chrome'], | 294 device.RunShellCommand(['pm', 'disable', 'com.android.chrome'], |
| 295 check_return=True) | 295 check_return=True) |
| 296 | 296 |
| 297 if options.remove_system_webview: | 297 if options.remove_system_webview: |
| 298 if device.HasRoot(): | 298 if device.HasRoot(): |
| 299 # Disabled Marshmallow's Verity security feature | |
| 300 if device.build_version_sdk >= version_codes.MARSHMALLOW: | |
| 301 device.adb.DisableVerity() | |
| 302 device.Reboot() | |
|
jbudorick
2016/05/09 21:07:33
I'm not crazy about introducing yet another reboot
Yoland Yan(Google)
2016/05/09 22:49:36
hmm, I don't think there is a good place to includ
| |
| 303 device.adb.WaitForDevice() | |
|
jbudorick
2016/05/09 21:07:33
If we keep this, this should change to device.Wait
Yoland Yan(Google)
2016/05/09 22:49:36
Done.
| |
| 304 device.EnableRoot() | |
| 299 # This is required, e.g., to replace the system webview on a device. | 305 # This is required, e.g., to replace the system webview on a device. |
| 300 device.adb.Remount() | 306 device.adb.Remount() |
| 301 device.RunShellCommand(['stop'], check_return=True) | 307 device.RunShellCommand(['stop'], check_return=True) |
| 302 device.RunShellCommand(['rm', '-rf'] + _SYSTEM_WEBVIEW_PATHS, | 308 device.RunShellCommand(['rm', '-rf'] + _SYSTEM_WEBVIEW_PATHS, |
|
mikecase (-- gone --)
2016/05/09 21:09:55
I think maybe what we should fix is that none of t
Yoland Yan(Google)
2016/05/09 22:49:36
Done.
| |
| 303 check_return=True) | 309 check_return=True) |
| 304 device.RunShellCommand(['start'], check_return=True) | 310 device.RunShellCommand(['start'], check_return=True) |
| 305 else: | 311 else: |
| 306 logging.warning('Cannot remove system webview from a non-rooted device') | 312 logging.warning('Cannot remove system webview from a non-rooted device') |
| 307 | 313 |
| 308 # Some device types can momentarily disappear after setting properties. | 314 # Some device types can momentarily disappear after setting properties. |
| 309 device.adb.WaitForDevice() | 315 device.adb.WaitForDevice() |
| 310 | 316 |
| 311 | 317 |
| 312 def _ConfigureLocalProperties(device, java_debug=True): | 318 def _ConfigureLocalProperties(device, java_debug=True): |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 536 }, | 542 }, |
| 537 } | 543 } |
| 538 | 544 |
| 539 devil_chromium.Initialize(custom_deps=devil_custom_deps) | 545 devil_chromium.Initialize(custom_deps=devil_custom_deps) |
| 540 | 546 |
| 541 return ProvisionDevices(args) | 547 return ProvisionDevices(args) |
| 542 | 548 |
| 543 | 549 |
| 544 if __name__ == '__main__': | 550 if __name__ == '__main__': |
| 545 sys.exit(main()) | 551 sys.exit(main()) |
| OLD | NEW |