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

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

Issue 15839006: Android: removes pylib.constants.CHROME_DIR. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: find_bugs Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | build/android/pylib/constants.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) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 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 """A class to keep track of devices across builds and report state.""" 7 """A class to keep track of devices across builds and report state."""
8 import logging 8 import logging
9 import optparse 9 import optparse
10 import os 10 import os
(...skipping 23 matching lines...) Expand all
34 shell=True).strip() 34 shell=True).strip()
35 35
36 device_type = AdbShellCmd('getprop ro.build.product') 36 device_type = AdbShellCmd('getprop ro.build.product')
37 device_build = AdbShellCmd('getprop ro.build.id') 37 device_build = AdbShellCmd('getprop ro.build.id')
38 device_product_name = AdbShellCmd('getprop ro.product.name') 38 device_product_name = AdbShellCmd('getprop ro.product.name')
39 39
40 setup_wizard_disabled = AdbShellCmd( 40 setup_wizard_disabled = AdbShellCmd(
41 'getprop ro.setupwizard.mode') == 'DISABLED' 41 'getprop ro.setupwizard.mode') == 'DISABLED'
42 battery = AdbShellCmd('dumpsys battery') 42 battery = AdbShellCmd('dumpsys battery')
43 install_output = GetCmdOutput( 43 install_output = GetCmdOutput(
44 ['%s/build/android/adb_install_apk.py' % constants.CHROME_DIR, '--apk', 44 ['%s/build/android/adb_install_apk.py' % constants.DIR_SOURCE_ROOT, '--apk',
45 '%s/build/android/CheckInstallApk-debug.apk' % constants.CHROME_DIR]) 45 '%s/build/android/CheckInstallApk-debug.apk' % constants.DIR_SOURCE_ROOT])
46 install_speed_found = re.findall('(\d+) KB/s', install_output) 46 install_speed_found = re.findall('(\d+) KB/s', install_output)
47 if install_speed_found: 47 if install_speed_found:
48 install_speed = int(install_speed_found[0]) 48 install_speed = int(install_speed_found[0])
49 else: 49 else:
50 install_speed = 'Unknown' 50 install_speed = 'Unknown'
51 if 'Error' in battery: 51 if 'Error' in battery:
52 ac_power = 'Unknown' 52 ac_power = 'Unknown'
53 battery_level = 'Unknown' 53 battery_level = 'Unknown'
54 battery_temp = 'Unknown' 54 battery_temp = 'Unknown'
55 else: 55 else:
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 # devices with critically low battery or install speed. Remove those devices 215 # devices with critically low battery or install speed. Remove those devices
216 # from testing, allowing build to continue with good devices. 216 # from testing, allowing build to continue with good devices.
217 return 1 217 return 1
218 218
219 if not devices: 219 if not devices:
220 return 1 220 return 1
221 221
222 222
223 if __name__ == '__main__': 223 if __name__ == '__main__':
224 sys.exit(main()) 224 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/constants.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698