| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """This module wraps Android's adb tool. | 5 """This module wraps Android's adb tool. |
| 6 | 6 |
| 7 This is a thin wrapper around the adb interface. Any additional complexity | 7 This is a thin wrapper around the adb interface. Any additional complexity |
| 8 should be delegated to a higher level (ex. DeviceUtils). | 8 should be delegated to a higher level (ex. DeviceUtils). |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 use_iter = False | 328 use_iter = False |
| 329 if logcat_format: | 329 if logcat_format: |
| 330 cmd.extend(['-v', logcat_format]) | 330 cmd.extend(['-v', logcat_format]) |
| 331 if filter_specs: | 331 if filter_specs: |
| 332 cmd.extend(filter_specs) | 332 cmd.extend(filter_specs) |
| 333 | 333 |
| 334 if use_iter: | 334 if use_iter: |
| 335 return self._IterRunDeviceAdbCmd(cmd, timeout) | 335 return self._IterRunDeviceAdbCmd(cmd, timeout) |
| 336 else: | 336 else: |
| 337 timeout = timeout if timeout is not None else _DEFAULT_TIMEOUT | 337 timeout = timeout if timeout is not None else _DEFAULT_TIMEOUT |
| 338 return self._RunDeviceAdbCmd(cmd, timeout, retries) | 338 return self._RunDeviceAdbCmd(cmd, timeout, retries).splitlines() |
| 339 | 339 |
| 340 def Forward(self, local, remote, timeout=_DEFAULT_TIMEOUT, | 340 def Forward(self, local, remote, timeout=_DEFAULT_TIMEOUT, |
| 341 retries=_DEFAULT_RETRIES): | 341 retries=_DEFAULT_RETRIES): |
| 342 """Forward socket connections from the local socket to the remote socket. | 342 """Forward socket connections from the local socket to the remote socket. |
| 343 | 343 |
| 344 Sockets are specified by one of: | 344 Sockets are specified by one of: |
| 345 tcp:<port> | 345 tcp:<port> |
| 346 localabstract:<unix domain socket name> | 346 localabstract:<unix domain socket name> |
| 347 localreserved:<unix domain socket name> | 347 localreserved:<unix domain socket name> |
| 348 localfilesystem:<unix domain socket name> | 348 localfilesystem:<unix domain socket name> |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 """Restarts the adbd daemon with root permissions, if possible. | 516 """Restarts the adbd daemon with root permissions, if possible. |
| 517 | 517 |
| 518 Args: | 518 Args: |
| 519 timeout: (optional) Timeout per try in seconds. | 519 timeout: (optional) Timeout per try in seconds. |
| 520 retries: (optional) Number of retries to attempt. | 520 retries: (optional) Number of retries to attempt. |
| 521 """ | 521 """ |
| 522 output = self._RunDeviceAdbCmd(['root'], timeout, retries) | 522 output = self._RunDeviceAdbCmd(['root'], timeout, retries) |
| 523 if 'cannot' in output: | 523 if 'cannot' in output: |
| 524 raise device_errors.AdbCommandFailedError( | 524 raise device_errors.AdbCommandFailedError( |
| 525 ['root'], output, device_serial=self._device_serial) | 525 ['root'], output, device_serial=self._device_serial) |
| OLD | NEW |