OLD | NEW |
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 Loading... |
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 Loading... |
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()) |
OLD | NEW |