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

Unified Diff: tools/telemetry/telemetry/core/forwarders/android_forwarder.py

Issue 1132993004: [Android] Remove more references to and uses of AndroidCommands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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: tools/telemetry/telemetry/core/forwarders/android_forwarder.py
diff --git a/tools/telemetry/telemetry/core/forwarders/android_forwarder.py b/tools/telemetry/telemetry/core/forwarders/android_forwarder.py
index b2f58e04551c9b529dd6e5f400a27147dabc8dd5..ed8ed7b9c7560ddcab473d4eb94993f75623d08a 100644
--- a/tools/telemetry/telemetry/core/forwarders/android_forwarder.py
+++ b/tools/telemetry/telemetry/core/forwarders/android_forwarder.py
@@ -185,8 +185,11 @@ class AndroidRndisConfigurator(object):
def __init__(self, adb):
self._device = adb.device()
- is_root_enabled = self._device.old_interface.EnableAdbRoot()
- assert is_root_enabled, 'RNDIS forwarding requires a rooted device.'
+ try:
+ self._device.EnableRoot()
+ except device_errors.CommandFailedError:
+ logging.error('RNDIS forwarding requires a rooted device.')
+ raise
self._device_ip = None
self._host_iface = None
@@ -207,9 +210,6 @@ class AndroidRndisConfigurator(object):
"""Checks that the device has RNDIS support in the kernel."""
return self._device.FileExists('%s/f_rndis/device' % self._RNDIS_DEVICE)
- def _WaitForDevice(self):
- self._device.old_interface.Adb().SendCommand('wait-for-device')
-
def _FindDeviceRndisInterface(self):
"""Returns the name of the RNDIS network interface if present."""
config = self._device.RunShellCommand('netcfg')
@@ -279,7 +279,7 @@ class AndroidRndisConfigurator(object):
except device_errors.AdbCommandFailedError:
# Ignore exception due to USB connection being reset.
pass
- self._WaitForDevice()
+ self._device.adb.WaitForDevice()
def _EnableRndis(self):
"""Enables the RNDIS network interface."""
@@ -321,7 +321,7 @@ doit &
# TODO(szym): run via su -c if necessary.
self._device.RunShellCommand('rm %s.log' % script_prefix)
self._device.RunShellCommand('. %s.sh' % script_prefix)
- self._WaitForDevice()
+ self._device.adb.WaitForDevice()
result = self._device.ReadFile('%s.log' % script_prefix).splitlines()
assert any('DONE' in line for line in result), 'RNDIS script did not run!'
@@ -489,7 +489,7 @@ doit &
self._device.RunShellCommand(
'ifconfig %s %s netmask %s up' % (device_iface, device_ip, netmask))
# Enabling the interface sometimes breaks adb.
- self._WaitForDevice()
+ self._device.adb.WaitForDevice()
self._host_iface = host_iface
self._host_ip = host_ip
self.device_iface = device_iface
« no previous file with comments | « tools/profile_chrome_startup.py ('k') | tools/telemetry/telemetry/core/platform/android_platform_backend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698