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

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

Issue 1126143004: [Android] Add option to wait for battery temperature to device provisioning (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/battery_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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 device_settings.ConfigureContentSettings( 177 device_settings.ConfigureContentSettings(
178 device, device_settings.NETWORK_DISABLED_SETTINGS) 178 device, device_settings.NETWORK_DISABLED_SETTINGS)
179 179
180 if options.min_battery_level is not None: 180 if options.min_battery_level is not None:
181 try: 181 try:
182 battery = battery_utils.BatteryUtils(device) 182 battery = battery_utils.BatteryUtils(device)
183 battery.ChargeDeviceToLevel(options.min_battery_level) 183 battery.ChargeDeviceToLevel(options.min_battery_level)
184 except device_errors.CommandFailedError as e: 184 except device_errors.CommandFailedError as e:
185 logging.exception('Unable to charge device to specified level.') 185 logging.exception('Unable to charge device to specified level.')
186 186
187 if options.max_battery_temp is not None:
188 try:
189 battery = battery_utils.BatteryUtils(device)
190 battery.LetBatteryCoolToTemperature(options.max_battery_temp)
191 except device_errors.CommandFailedError as e:
192 logging.exception('Unable to let battery cool to specified temperature.')
187 193
188 def _ConfigureLocalProperties(device, java_debug=True): 194 def _ConfigureLocalProperties(device, java_debug=True):
189 """Set standard readonly testing device properties prior to reboot.""" 195 """Set standard readonly testing device properties prior to reboot."""
190 local_props = [ 196 local_props = [
191 'persist.sys.usb.config=adb', 197 'persist.sys.usb.config=adb',
192 'ro.monkey=1', 198 'ro.monkey=1',
193 'ro.test_harness=1', 199 'ro.test_harness=1',
194 'ro.audio.silent=1', 200 'ro.audio.silent=1',
195 'ro.setupwizard.mode=DISABLED', 201 'ro.setupwizard.mode=DISABLED',
196 ] 202 ]
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 help='disable Java property asserts and JNI checking') 307 help='disable Java property asserts and JNI checking')
302 parser.add_argument('-t', '--target', default='Debug', 308 parser.add_argument('-t', '--target', default='Debug',
303 help='the build target (default: %(default)s)') 309 help='the build target (default: %(default)s)')
304 parser.add_argument('-r', '--auto-reconnect', action='store_true', 310 parser.add_argument('-r', '--auto-reconnect', action='store_true',
305 help='push binary which will reboot the device on adb' 311 help='push binary which will reboot the device on adb'
306 ' disconnections') 312 ' disconnections')
307 parser.add_argument('--adb-key-files', type=str, nargs='+', 313 parser.add_argument('--adb-key-files', type=str, nargs='+',
308 help='list of adb keys to push to device') 314 help='list of adb keys to push to device')
309 parser.add_argument('-v', '--verbose', action='count', default=1, 315 parser.add_argument('-v', '--verbose', action='count', default=1,
310 help='Log more information.') 316 help='Log more information.')
317 parser.add_argument('--max-battery-temp', type=int, metavar='NUM',
318 help='Wait for the battery to have this temp or lower.')
311 args = parser.parse_args() 319 args = parser.parse_args()
312 constants.SetBuildType(args.target) 320 constants.SetBuildType(args.target)
313 321
314 run_tests_helper.SetLogLevel(args.verbose) 322 run_tests_helper.SetLogLevel(args.verbose)
315 323
316 return ProvisionDevices(args) 324 return ProvisionDevices(args)
317 325
318 326
319 if __name__ == '__main__': 327 if __name__ == '__main__':
320 sys.exit(main()) 328 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/device/battery_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698