diff options
Diffstat (limited to 'build/android/pylib/utils/emulator.py')
-rw-r--r-- | build/android/pylib/utils/emulator.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/build/android/pylib/utils/emulator.py b/build/android/pylib/utils/emulator.py index cc07e61..c614d0d 100644 --- a/build/android/pylib/utils/emulator.py +++ b/build/android/pylib/utils/emulator.py @@ -18,6 +18,7 @@ import time from pylib import cmd_helper from pylib import constants from pylib import pexpect +from pylib.device import adb_wrapper from pylib.device import device_errors from pylib.device import device_utils from pylib.utils import time_profile @@ -89,16 +90,16 @@ def _KillAllEmulators(): running but a device slot is taken. A little bot trouble and we're out of room forever. """ - emulators = [d for d in device_utils.DeviceUtils.HealthyDevices() - if d.adb.is_emulator] + emulators = [device_utils.DeviceUtils(a) + for a in adb_wrapper.AdbWrapper.Devices() + if a.is_emulator] if not emulators: return for e in emulators: e.adb.Emu(['kill']) logging.info('Emulator killing is async; give a few seconds for all to die.') for _ in range(5): - if not any(d.adb.is_emulator for d - in device_utils.DeviceUtils.HealthyDevices()): + if not any(a.is_emulator for a in adb_wrapper.AdbWrapper.Devices()): return time.sleep(1) @@ -142,8 +143,9 @@ class PortPool(object): def _GetAvailablePort(): """Returns an available TCP port for the console.""" used_ports = [] - emulators = [d for d in device_utils.DeviceUtils.HealthyDevices() - if d.adb.is_emulator] + emulators = [device_utils.DeviceUtils(a) + for a in adb_wrapper.AdbWrapper.Devices() + if a.is_emulator] for emulator in emulators: used_ports.append(emulator.adb.GetDeviceSerial().split('-')[1]) for port in PortPool.port_range(): |