| Index: tools/android/mempressure.py
|
| diff --git a/tools/android/mempressure.py b/tools/android/mempressure.py
|
| index bd606f132235f70f1c4c762dff7d1e4f6a117e75..fa3daba3be6badd9a33ae7df108f6b9c9a4b6df0 100755
|
| --- a/tools/android/mempressure.py
|
| +++ b/tools/android/mempressure.py
|
| @@ -15,8 +15,10 @@ 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_errors
|
| from pylib.device import device_utils
|
|
|
| # Browser Constants
|
| @@ -85,7 +87,12 @@ def main(argv):
|
| package = package_info.package
|
| activity = package_info.activity
|
|
|
| - device = device_utils.DeviceUtils(None)
|
| + devices = android_commands.GetAttachedDevices()
|
| + if not devices:
|
| + raise device_errors.NoDevicesError()
|
| + elif len(devices) > 1:
|
| + logging.warning('Multiple devices attached. Using %s.' % devices[0])
|
| + device = device_utils.DeviceUtils(devices[0])
|
|
|
| try:
|
| device.EnableRoot()
|
|
|