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

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

Issue 963093002: [Android] Check for AC and wireless charging when determining charging state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | build/android/pylib/device/device_utils.py » ('j') | 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 device, device_settings.DISABLE_LOCATION_SETTINGS) 200 device, device_settings.DISABLE_LOCATION_SETTINGS)
201 else: 201 else:
202 device_settings.ConfigureContentSettings( 202 device_settings.ConfigureContentSettings(
203 device, device_settings.ENABLE_LOCATION_SETTINGS) 203 device, device_settings.ENABLE_LOCATION_SETTINGS)
204 device_settings.SetLockScreenSettings(device) 204 device_settings.SetLockScreenSettings(device)
205 if options.disable_network: 205 if options.disable_network:
206 device_settings.ConfigureContentSettings( 206 device_settings.ConfigureContentSettings(
207 device, device_settings.NETWORK_DISABLED_SETTINGS) 207 device, device_settings.NETWORK_DISABLED_SETTINGS)
208 if options.min_battery_level is not None: 208 if options.min_battery_level is not None:
209 try: 209 try:
210 device.SetUsbCharging(True) 210 device.SetCharging(True)
211 ChargeDeviceToLevel(device, options.min_battery_level) 211 ChargeDeviceToLevel(device, options.min_battery_level)
212 except device_errors.CommandFailedError as e: 212 except device_errors.CommandFailedError as e:
213 logging.exception('Unable to charge device to specified level.') 213 logging.exception('Unable to charge device to specified level.')
214 214
215 if not options.skip_wipe: 215 if not options.skip_wipe:
216 device.Reboot(True, timeout=reboot_timeout, retries=0) 216 device.Reboot(True, timeout=reboot_timeout, retries=0)
217 device.RunShellCommand('date -s %s' % time.strftime('%Y%m%d.%H%M%S', 217 device.RunShellCommand('date -s %s' % time.strftime('%Y%m%d.%H%M%S',
218 time.gmtime()), 218 time.gmtime()),
219 as_root=True) 219 as_root=True)
220 props = device.RunShellCommand('getprop') 220 props = device.RunShellCommand('getprop')
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 parser.add_argument('--adb-key-files', type=str, nargs='+', 294 parser.add_argument('--adb-key-files', type=str, nargs='+',
295 help='list of adb keys to push to device') 295 help='list of adb keys to push to device')
296 args = parser.parse_args() 296 args = parser.parse_args()
297 constants.SetBuildType(args.target) 297 constants.SetBuildType(args.target)
298 298
299 return ProvisionDevices(args) 299 return ProvisionDevices(args)
300 300
301 301
302 if __name__ == '__main__': 302 if __name__ == '__main__':
303 sys.exit(main()) 303 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/device/device_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698