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

Side by Side Diff: build/android/provision_devices.py

Issue 2223013002: [build/android] Ensure NFC remains disabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 device_settings.ConfigureContentSettings( 281 device_settings.ConfigureContentSettings(
282 device, device_settings.DISABLE_MOCK_LOCATION_SETTINGS) 282 device, device_settings.DISABLE_MOCK_LOCATION_SETTINGS)
283 else: 283 else:
284 device_settings.ConfigureContentSettings( 284 device_settings.ConfigureContentSettings(
285 device, device_settings.ENABLE_MOCK_LOCATION_SETTINGS) 285 device, device_settings.ENABLE_MOCK_LOCATION_SETTINGS)
286 286
287 device_settings.SetLockScreenSettings(device) 287 device_settings.SetLockScreenSettings(device)
288 if options.disable_network: 288 if options.disable_network:
289 device_settings.ConfigureContentSettings( 289 device_settings.ConfigureContentSettings(
290 device, device_settings.NETWORK_DISABLED_SETTINGS) 290 device, device_settings.NETWORK_DISABLED_SETTINGS)
291 if device.build_version_sdk >= version_codes.MARSHMALLOW:
292 # Ensure that NFC is also switched off.
293 device.RunShellCommand(['svc', 'nfc', 'disable'],
294 as_root=True, check_return=True)
291 295
292 if options.disable_system_chrome: 296 if options.disable_system_chrome:
293 # The system chrome version on the device interferes with some tests. 297 # The system chrome version on the device interferes with some tests.
294 device.RunShellCommand(['pm', 'disable', 'com.android.chrome'], 298 device.RunShellCommand(['pm', 'disable', 'com.android.chrome'],
295 check_return=True) 299 check_return=True)
296 300
297 if options.remove_system_webview: 301 if options.remove_system_webview:
298 if any(device.PathExists(p) for p in _SYSTEM_WEBVIEW_PATHS): 302 if any(device.PathExists(p) for p in _SYSTEM_WEBVIEW_PATHS):
299 logging.info('System WebView exists and needs to be removed') 303 logging.info('System WebView exists and needs to be removed')
300 if device.HasRoot(): 304 if device.HasRoot():
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 devil_chromium.Initialize(adb_path=args.adb_path) 550 devil_chromium.Initialize(adb_path=args.adb_path)
547 551
548 try: 552 try:
549 return ProvisionDevices(args) 553 return ProvisionDevices(args)
550 except (device_errors.DeviceUnreachableError, device_errors.NoDevicesError): 554 except (device_errors.DeviceUnreachableError, device_errors.NoDevicesError):
551 return exit_codes.INFRA 555 return exit_codes.INFRA
552 556
553 557
554 if __name__ == '__main__': 558 if __name__ == '__main__':
555 sys.exit(main()) 559 sys.exit(main())
OLDNEW
« 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