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

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

Issue 221823011: [Android] Change object types from AndroidCommands to DeviceUtils in build/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Frank's comments. Created 6 years, 9 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
Index: build/android/pylib/utils/emulator.py
diff --git a/build/android/pylib/utils/emulator.py b/build/android/pylib/utils/emulator.py
index 6545463ae29945665b00f20deb56439ab63fb15b..ec78102153698a2c2f80ec2af5383c355b62f91b 100644
--- a/build/android/pylib/utils/emulator.py
+++ b/build/android/pylib/utils/emulator.py
@@ -21,6 +21,7 @@ from pylib import android_commands
from pylib import cmd_helper
from pylib import constants
from pylib import pexpect
+from pylib.device import device_utils
from pylib.utils import time_profile
import errors
@@ -108,7 +109,7 @@ def DeleteAllTempAVDs():
If the test exits abnormally and some temporary AVDs created when testing may
be left in the system. Clean these AVDs.
"""
- avds = android_commands.GetAVDs()
+ avds = device_utils.GetAVDs()
if not avds:
return
for avd_name in avds:
@@ -238,7 +239,7 @@ class Emulator(object):
self.emulator = os.path.join(android_sdk_root, 'tools', 'emulator')
self.android = os.path.join(android_sdk_root, 'tools', 'android')
self.popen = None
- self.device = None
+ self.device_serial = None
self.abi = abi
self.avd_name = avd_name
@@ -336,7 +337,7 @@ class Emulator(object):
if kill_all_emulators:
_KillAllEmulators() # just to be sure
self._AggressiveImageCleanup()
- (self.device, port) = self._DeviceName()
+ (self.device_serial, port) = self._DeviceName()
emulator_command = [
self.emulator,
# Speed up emulator launch by 40%. Really.
@@ -395,7 +396,7 @@ class Emulator(object):
"""
seconds_waited = 0
number_of_waits = 2 # Make sure we can wfd twice
- adb_cmd = "adb -s %s %s" % (self.device, 'wait-for-device')
+ adb_cmd = "adb -s %s %s" % (self.device_serial, 'wait-for-device')
while seconds_waited < self._LAUNCH_TIMEOUT:
try:
run_command.RunCommand(adb_cmd,
@@ -406,7 +407,7 @@ class Emulator(object):
break
except errors.WaitForResponseTimedOutError:
seconds_waited += self._WAITFORDEVICE_TIMEOUT
- adb_cmd = "adb -s %s %s" % (self.device, 'kill-server')
+ adb_cmd = "adb -s %s %s" % (self.device_serial, 'kill-server')
run_command.RunCommand(adb_cmd)
self.popen.poll()
if self.popen.returncode != None:
@@ -417,8 +418,8 @@ class Emulator(object):
if wait_for_boot:
# Now that we checked for obvious problems, wait for a boot complete.
# Waiting for the package manager is sometimes problematic.
- a = android_commands.AndroidCommands(self.device)
- a.WaitForSystemBootCompleted(self._WAITFORBOOT_TIMEOUT)
+ d = device_utils.DeviceUtils(self.device_serial)
+ d.old_interface.WaitForSystemBootCompleted(self._WAITFORBOOT_TIMEOUT)
def Shutdown(self):
"""Shuts down the process started by launch."""

Powered by Google App Engine
This is Rietveld 408576698