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

Unified Diff: telemetry/telemetry/internal/platform/android_platform_backend.py

Issue 2425473002: Revert of [Android] Check list length before printing forwarder information. (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/internal/platform/android_platform_backend.py
diff --git a/telemetry/telemetry/internal/platform/android_platform_backend.py b/telemetry/telemetry/internal/platform/android_platform_backend.py
index a3f5aa74009fc0dcc7369f0fe0129889f4dd323f..3b57f66779275d245392320e15b66ce60fb323f7 100644
--- a/telemetry/telemetry/internal/platform/android_platform_backend.py
+++ b/telemetry/telemetry/internal/platform/android_platform_backend.py
@@ -484,14 +484,9 @@
def StopForwardingHost(self, host_port):
for line in self._device.adb.ForwardList().strip().splitlines():
line = line.split(' ')
- if len(line) >= 2:
- if line[0] == self._device and line[1] == 'tcp:%s' % host_port:
- self._device.adb.ForwardRemove('tcp:%d' % host_port)
- break
- else:
- logging.warning('ADB forwarder list output format unexpected. Expected '
- 'format "<device id> tcp:<host port> but got:\n%s',
- line)
+ if line[0] == self._device and line[1] == 'tcp:%s' % host_port:
+ self._device.adb.ForwardRemove('tcp:%d' % host_port)
+ break
else:
logging.warning('Port %s not found in adb forward --list for device %s',
host_port, self._device)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698