Chromium Code Reviews| Index: build/android/pylib/utils/emulator.py |
| diff --git a/build/android/pylib/utils/emulator.py b/build/android/pylib/utils/emulator.py |
| index 26b91098bd0fe72a0717a660e00f1e200d544f63..9541a63777e8beaaa015ab4e53f3d18937a16669 100644 |
| --- a/build/android/pylib/utils/emulator.py |
| +++ b/build/android/pylib/utils/emulator.py |
| @@ -15,7 +15,6 @@ import subprocess |
| import time |
| # TODO(craigdh): Move these pylib dependencies to pylib/utils/. |
| -from pylib import android_commands |
| from pylib import cmd_helper |
| from pylib import constants |
| from pylib import pexpect |
| @@ -90,14 +89,14 @@ def _KillAllEmulators(): |
| running but a device slot is taken. A little bot trouble and and |
| we're out of room forever. |
| """ |
| - emulators = android_commands.GetAttachedDevices(hardware=False) |
| + emulators = [d for d in device_utils.HealthyDevices() if d.adb.is_emulator] |
| if not emulators: |
| return |
| - for emu_name in emulators: |
| - cmd_helper.RunCmd(['adb', '-s', emu_name, 'emu', 'kill']) |
| + for e in emulators: |
| + e.adb.Emulator(['kill']) |
| logging.info('Emulator killing is async; give a few seconds for all to die.') |
| for _ in range(5): |
| - if not android_commands.GetAttachedDevices(hardware=False): |
| + if not [d for d in device_utils.HealthyDevices() if d.adb.is_emulator]: |
|
perezju
2015/04/28 10:33:51
if not any(d.adb.is_emulator for d in device_utils
jbudorick
2015/04/28 13:44:59
Done.
|
| return |
| time.sleep(1) |
| @@ -141,9 +140,9 @@ class PortPool(object): |
| def _GetAvailablePort(): |
| """Returns an available TCP port for the console.""" |
| used_ports = [] |
| - emulators = android_commands.GetAttachedDevices(hardware=False) |
| + emulators = [d for d in device_utils.HealthyDevices() if d.adb.is_emulator] |
| for emulator in emulators: |
| - used_ports.append(emulator.split('-')[1]) |
| + used_ports.append(emulator.adb.GetDeviceSerial().split('-')[1]) |
| for port in PortPool.port_range(): |
| if str(port) not in used_ports: |
| return port |