Chromium Code Reviews| Index: tools/android/mempressure.py |
| diff --git a/tools/android/mempressure.py b/tools/android/mempressure.py |
| index bd606f132235f70f1c4c762dff7d1e4f6a117e75..6c6f2717c7a33abfee7ac0ae226e6bdebb7ff6cf 100755 |
| --- a/tools/android/mempressure.py |
| +++ b/tools/android/mempressure.py |
| @@ -15,6 +15,7 @@ BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), |
| 'build', |
| 'android') |
| sys.path.append(BUILD_ANDROID_DIR) |
| +from pylib import android_commands |
| from pylib import constants |
| from pylib import flag_changer |
| from pylib.device import device_utils |
| @@ -85,7 +86,13 @@ def main(argv): |
| package = package_info.package |
| activity = package_info.activity |
| - device = device_utils.DeviceUtils(None) |
| + devices = android_commands.GetAttachedDevices() |
| + if not len(devices): |
|
frankf
2014/07/28 22:52:31
if not devices:
jbudorick
2014/07/28 23:05:40
Done.
|
| + logging.error('No devices attached.') |
| + sys.exit(1) |
| + elif len(devices) > 1: |
| + logging.warning('Multiple devices attached. Using %s.' % devices[0]) |
| + device = device_utils.DeviceUtils(devices[0]) |
| try: |
| device.EnableRoot() |