| Index: build/android/pylib/forwarder.py
|
| diff --git a/build/android/pylib/forwarder.py b/build/android/pylib/forwarder.py
|
| index 1a0050a5542539376dbfe11c64d58cb296b0ee97..17a0114ee8acf8cdd88eaf4aebe59c7002249c20 100644
|
| --- a/build/android/pylib/forwarder.py
|
| +++ b/build/android/pylib/forwarder.py
|
| @@ -9,7 +9,6 @@
|
| import os
|
| import psutil
|
|
|
| -from devil import devil_env
|
| from devil.utils import cmd_helper
|
| from pylib import constants
|
| from pylib import valgrind_tools
|
| @@ -78,7 +77,7 @@
|
|
|
| device_serial = str(device)
|
| redirection_commands = [
|
| - ['--adb=' + devil_env.config.FetchPath('adb'),
|
| + ['--adb=' + constants.GetAdbPath(),
|
| '--serial-id=' + device_serial,
|
| '--map', str(device_port), str(host_port)]
|
| for device_port, host_port in port_pairs]
|
| @@ -198,8 +197,11 @@
|
| self._initialized_devices = set()
|
| self._device_to_host_port_map = dict()
|
| self._host_to_device_port_map = dict()
|
| - self._host_forwarder_path = devil_env.config.FetchPath('forwarder_host')
|
| + self._host_forwarder_path = os.path.join(
|
| + constants.GetOutDirectory(), 'host_forwarder')
|
| assert os.path.exists(self._host_forwarder_path), 'Please build forwarder2'
|
| + self._device_forwarder_path_on_host = os.path.join(
|
| + constants.GetOutDirectory(), 'forwarder_dist')
|
| self._InitHostLocked()
|
|
|
| @staticmethod
|
| @@ -214,7 +216,7 @@
|
| if not serial_with_port in instance._device_to_host_port_map:
|
| logging.error('Trying to unmap non-forwarded port %d', device_port)
|
| return
|
| - redirection_command = ['--adb=' + devil_env.config.FetchPath('adb'),
|
| + redirection_command = ['--adb=' + constants.GetAdbPath(),
|
| '--serial-id=' + serial,
|
| '--unmap', str(device_port)]
|
| logging.info('Undo forwarding using command: %s', redirection_command)
|
| @@ -277,16 +279,9 @@
|
| if device_serial in self._initialized_devices:
|
| return
|
| Forwarder._KillDeviceLocked(device, tool)
|
| - forwarder_device_path_on_host = devil_env.config.FetchPath(
|
| - 'forwarder_device', device=device)
|
| - forwarder_device_path_on_device = (
|
| - Forwarder._DEVICE_FORWARDER_FOLDER
|
| - if os.path.isdir(forwarder_device_path_on_host)
|
| - else Forwarder._DEVICE_FORWARDER_PATH)
|
| device.PushChangedFiles([(
|
| - forwarder_device_path_on_host,
|
| - forwarder_device_path_on_device)])
|
| -
|
| + self._device_forwarder_path_on_host,
|
| + Forwarder._DEVICE_FORWARDER_FOLDER)])
|
| cmd = '%s %s' % (tool.GetUtilWrapper(), Forwarder._DEVICE_FORWARDER_PATH)
|
| device.RunShellCommand(
|
| cmd, env={'LD_LIBRARY_PATH': Forwarder._DEVICE_FORWARDER_FOLDER},
|
|
|