Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Unified Diff: build/android/pylib/utils/emulator.py

Issue 1116493003: Revert of [Android] Remove more uses of android_commands from build/android/pylib. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/pylib/perf/setup.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/utils/emulator.py
diff --git a/build/android/pylib/utils/emulator.py b/build/android/pylib/utils/emulator.py
index 635462f208bed21d53165329c1fd02ec4aa54ef2..26b91098bd0fe72a0717a660e00f1e200d544f63 100644
--- a/build/android/pylib/utils/emulator.py
+++ b/build/android/pylib/utils/emulator.py
@@ -15,6 +15,7 @@
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
@@ -89,14 +90,14 @@
running but a device slot is taken. A little bot trouble and and
we're out of room forever.
"""
- emulators = [d for d in device_utils.HealthyDevices() if d.adb.is_emulator]
+ emulators = android_commands.GetAttachedDevices(hardware=False)
if not emulators:
return
- for e in emulators:
- e.adb.Emu(['kill'])
+ for emu_name in emulators:
+ cmd_helper.RunCmd(['adb', '-s', emu_name, '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.HealthyDevices()):
+ if not android_commands.GetAttachedDevices(hardware=False):
return
time.sleep(1)
@@ -140,9 +141,9 @@
def _GetAvailablePort():
"""Returns an available TCP port for the console."""
used_ports = []
- emulators = [d for d in device_utils.HealthyDevices() if d.adb.is_emulator]
+ emulators = android_commands.GetAttachedDevices(hardware=False)
for emulator in emulators:
- used_ports.append(emulator.adb.GetDeviceSerial().split('-')[1])
+ used_ports.append(emulator.split('-')[1])
for port in PortPool.port_range():
if str(port) not in used_ports:
return port
« no previous file with comments | « build/android/pylib/perf/setup.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698