| OLD | NEW | 
|---|
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be | 
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. | 
| 4 | 4 | 
| 5 """Provides a variety of device interactions with power. | 5 """Provides a variety of device interactions with power. | 
| 6 """ | 6 """ | 
| 7 # pylint: disable=unused-argument | 7 # pylint: disable=unused-argument | 
| 8 | 8 | 
| 9 import collections | 9 import collections | 
| 10 import contextlib | 10 import contextlib | 
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 88   { | 88   { | 
| 89     'name': 'Nexus 10', | 89     'name': 'Nexus 10', | 
| 90     'witness_file': None, | 90     'witness_file': None, | 
| 91     'enable_command': None, | 91     'enable_command': None, | 
| 92     'disable_command': None, | 92     'disable_command': None, | 
| 93     'charge_counter': None, | 93     'charge_counter': None, | 
| 94     'voltage': '/sys/class/power_supply/ds2784-fuelgauge/voltage_now', | 94     'voltage': '/sys/class/power_supply/ds2784-fuelgauge/voltage_now', | 
| 95     'current': '/sys/class/power_supply/ds2784-fuelgauge/current_now', | 95     'current': '/sys/class/power_supply/ds2784-fuelgauge/current_now', | 
| 96 | 96 | 
| 97   }, | 97   }, | 
|  | 98   { | 
|  | 99     'name': 'Nexus 5X', | 
|  | 100     'witness_file': None, | 
|  | 101     'enable_command': ( | 
|  | 102         'echo 1 > /sys/class/power_supply/battery/charging_enabled && ' | 
|  | 103         'dumpsys battery reset'), | 
|  | 104     'disable_command': ( | 
|  | 105         'echo 0 > /sys/class/power_supply/battery/charging_enabled && ' | 
|  | 106         'dumpsys battery set ac 0 && dumpsys battery set usb 0'), | 
|  | 107     'charge_counter': None, | 
|  | 108     'voltage': None, | 
|  | 109     'current': None, | 
|  | 110   }, | 
| 98 ] | 111 ] | 
| 99 | 112 | 
| 100 # The list of useful dumpsys columns. | 113 # The list of useful dumpsys columns. | 
| 101 # Index of the column containing the format version. | 114 # Index of the column containing the format version. | 
| 102 _DUMP_VERSION_INDEX = 0 | 115 _DUMP_VERSION_INDEX = 0 | 
| 103 # Index of the column containing the type of the row. | 116 # Index of the column containing the type of the row. | 
| 104 _ROW_TYPE_INDEX = 3 | 117 _ROW_TYPE_INDEX = 3 | 
| 105 # Index of the column containing the uid. | 118 # Index of the column containing the uid. | 
| 106 _PACKAGE_UID_INDEX = 4 | 119 _PACKAGE_UID_INDEX = 4 | 
| 107 # Index of the column containing the application package. | 120 # Index of the column containing the application package. | 
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 646     self._cache['profile'] = { | 659     self._cache['profile'] = { | 
| 647         'name': None, | 660         'name': None, | 
| 648         'witness_file': None, | 661         'witness_file': None, | 
| 649         'enable_command': None, | 662         'enable_command': None, | 
| 650         'disable_command': None, | 663         'disable_command': None, | 
| 651         'charge_counter': None, | 664         'charge_counter': None, | 
| 652         'voltage': None, | 665         'voltage': None, | 
| 653         'current': None, | 666         'current': None, | 
| 654     } | 667     } | 
| 655     return False | 668     return False | 
| OLD | NEW | 
|---|